// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.fasterxml.jackson.databind; import com.fasterxml.jackson.core.Base64Variant; import com.fasterxml.jackson.core.FormatSchema; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.PrettyPrinter; import com.fasterxml.jackson.core.SerializableString; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.core.Versioned; import com.fasterxml.jackson.core.io.CharacterEscapes; import com.fasterxml.jackson.core.io.SegmentedStringWriter; import com.fasterxml.jackson.core.io.SerializedString; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.util.ByteArrayBuilder; import com.fasterxml.jackson.core.util.Instantiatable; import com.fasterxml.jackson.core.util.MinimalPrettyPrinter; import com.fasterxml.jackson.databind.cfg.ContextAttributes; import com.fasterxml.jackson.databind.cfg.PackageVersion; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; import com.fasterxml.jackson.databind.ser.FilterProvider; import com.fasterxml.jackson.databind.ser.SerializerFactory; import com.fasterxml.jackson.databind.ser.impl.TypeWrappedSerializer; import com.fasterxml.jackson.databind.type.TypeFactory; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; import java.io.Writer; import java.text.DateFormat; import java.util.Locale; import java.util.Map; import java.util.TimeZone; import java.util.concurrent.atomic.AtomicReference; // Referenced classes of package com.fasterxml.jackson.databind: // ObjectMapper, JavaType, MapperFeature, SerializationConfig, // SerializationFeature, SequenceWriter, JsonMappingException, PropertyName, // JsonSerializer public class ObjectWriter implements Versioned, Serializable { public static final class GeneratorSettings implements Serializable { public static final GeneratorSettings empty = new GeneratorSettings(null, null, null, null); private static final long serialVersionUID = 1L; public final CharacterEscapes characterEscapes; public final PrettyPrinter prettyPrinter; public final SerializableString rootValueSeparator; public final FormatSchema schema; public void initialize(JsonGenerator jsongenerator) { PrettyPrinter prettyprinter1 = prettyPrinter; if (prettyPrinter != null) { if (prettyprinter1 == ObjectWriter.NULL_PRETTY_PRINTER) { jsongenerator.setPrettyPrinter(null); } else { PrettyPrinter prettyprinter = prettyprinter1; if (prettyprinter1 instanceof Instantiatable) { prettyprinter = (PrettyPrinter)((Instantiatable)prettyprinter1).createInstance(); } jsongenerator.setPrettyPrinter(prettyprinter); } } if (characterEscapes != null) { jsongenerator.setCharacterEscapes(characterEscapes); } if (schema != null) { jsongenerator.setSchema(schema); } if (rootValueSeparator != null) { jsongenerator.setRootValueSeparator(rootValueSeparator); } } public GeneratorSettings with(FormatSchema formatschema) { if (schema == formatschema) { return this; } else { return new GeneratorSettings(prettyPrinter, formatschema, characterEscapes, rootValueSeparator); } } public GeneratorSettings with(PrettyPrinter prettyprinter) { PrettyPrinter prettyprinter1 = prettyprinter; if (prettyprinter == null) { prettyprinter1 = ObjectWriter.NULL_PRETTY_PRINTER; } if (prettyprinter1 == prettyPrinter) { return this; } else { return new GeneratorSettings(prettyprinter1, schema, characterEscapes, rootValueSeparator); } } public GeneratorSettings with(CharacterEscapes characterescapes) { if (characterEscapes == characterescapes) { return this; } else { return new GeneratorSettings(prettyPrinter, schema, characterescapes, rootValueSeparator); } } public GeneratorSettings withRootValueSeparator(SerializableString serializablestring) { if (serializablestring != null ? rootValueSeparator != null && serializablestring.getValue().equals(rootValueSeparator.getValue()) : rootValueSeparator == null) { return this; } else { return new GeneratorSettings(prettyPrinter, schema, characterEscapes, serializablestring); } } public GeneratorSettings withRootValueSeparator(String s) { if (s != null ? s.equals(rootValueSeparator) : rootValueSeparator == null) { return this; } PrettyPrinter prettyprinter = prettyPrinter; FormatSchema formatschema = schema; CharacterEscapes characterescapes = characterEscapes; if (s == null) { s = null; } else { s = new SerializedString(s); } return new GeneratorSettings(prettyprinter, formatschema, characterescapes, s); } public GeneratorSettings(PrettyPrinter prettyprinter, FormatSchema formatschema, CharacterEscapes characterescapes, SerializableString serializablestring) { prettyPrinter = prettyprinter; schema = formatschema; characterEscapes = characterescapes; rootValueSeparator = serializablestring; } } public static final class Prefetch implements Serializable { public static final Prefetch empty = new Prefetch(null, null, null); private static final long serialVersionUID = 1L; private final JavaType rootType; private final TypeSerializer typeSerializer; private final JsonSerializer valueSerializer; public Prefetch forRootType(ObjectWriter objectwriter, JavaType javatype) { boolean flag1 = true; boolean flag = flag1; if (javatype != null) { if (javatype.isJavaLangObject()) { flag = flag1; } else { flag = false; } } if (!flag) goto _L2; else goto _L1 _L1: if (rootType != null && valueSerializer != null) goto _L4; else goto _L3 _L3: return this; _L4: return new Prefetch(null, null, typeSerializer); _L2: if (javatype.equals(rootType)) goto _L3; else goto _L5 _L5: if (!objectwriter.isEnabled(SerializationFeature.EAGER_SERIALIZER_FETCH)) { break MISSING_BLOCK_LABEL_131; } objectwriter = objectwriter._serializerProvider(); objectwriter = objectwriter.findTypedValueSerializer(javatype, true, null); if (objectwriter instanceof TypeWrappedSerializer) { return new Prefetch(javatype, null, ((TypeWrappedSerializer)objectwriter).typeSerializer()); } objectwriter = new Prefetch(javatype, objectwriter, null); return objectwriter; objectwriter; return new Prefetch(null, null, typeSerializer); } public final TypeSerializer getTypeSerializer() { return typeSerializer; } public final JsonSerializer getValueSerializer() { return valueSerializer; } public boolean hasSerializer() { return valueSerializer != null || typeSerializer != null; } public void serialize(JsonGenerator jsongenerator, Object obj, DefaultSerializerProvider defaultserializerprovider) throws IOException { if (typeSerializer != null) { defaultserializerprovider.serializePolymorphic(jsongenerator, obj, rootType, valueSerializer, typeSerializer); return; } if (valueSerializer != null) { defaultserializerprovider.serializeValue(jsongenerator, obj, rootType, valueSerializer); return; } else { defaultserializerprovider.serializeValue(jsongenerator, obj); return; } } private Prefetch(JavaType javatype, JsonSerializer jsonserializer, TypeSerializer typeserializer) { rootType = javatype; valueSerializer = jsonserializer; typeSerializer = typeserializer; } } protected static final PrettyPrinter NULL_PRETTY_PRINTER = new MinimalPrettyPrinter(); private static final long serialVersionUID = 1L; protected final SerializationConfig _config; protected final JsonFactory _generatorFactory; protected final GeneratorSettings _generatorSettings; protected final Prefetch _prefetch; protected final SerializerFactory _serializerFactory; protected final DefaultSerializerProvider _serializerProvider; protected ObjectWriter(ObjectMapper objectmapper, SerializationConfig serializationconfig) { _config = serializationconfig; _serializerProvider = objectmapper._serializerProvider; _serializerFactory = objectmapper._serializerFactory; _generatorFactory = objectmapper._jsonFactory; _generatorSettings = GeneratorSettings.empty; _prefetch = Prefetch.empty; } protected ObjectWriter(ObjectMapper objectmapper, SerializationConfig serializationconfig, FormatSchema formatschema) { _config = serializationconfig; _serializerProvider = objectmapper._serializerProvider; _serializerFactory = objectmapper._serializerFactory; _generatorFactory = objectmapper._jsonFactory; if (formatschema == null) { objectmapper = GeneratorSettings.empty; } else { objectmapper = new GeneratorSettings(null, formatschema, null, null); } _generatorSettings = objectmapper; _prefetch = Prefetch.empty; } protected ObjectWriter(ObjectMapper objectmapper, SerializationConfig serializationconfig, JavaType javatype, PrettyPrinter prettyprinter) { _config = serializationconfig; _serializerProvider = objectmapper._serializerProvider; _serializerFactory = objectmapper._serializerFactory; _generatorFactory = objectmapper._jsonFactory; if (prettyprinter == null) { objectmapper = GeneratorSettings.empty; } else { objectmapper = new GeneratorSettings(prettyprinter, null, null, null); } _generatorSettings = objectmapper; if (javatype == null || javatype.hasRawClass(java/lang/Object)) { _prefetch = Prefetch.empty; return; } else { objectmapper = javatype.withStaticTyping(); _prefetch = Prefetch.empty.forRootType(this, objectmapper); return; } } protected ObjectWriter(ObjectWriter objectwriter, JsonFactory jsonfactory) { _config = objectwriter._config.with(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, jsonfactory.requiresPropertyOrdering()); _serializerProvider = objectwriter._serializerProvider; _serializerFactory = objectwriter._serializerFactory; _generatorFactory = objectwriter._generatorFactory; _generatorSettings = objectwriter._generatorSettings; _prefetch = objectwriter._prefetch; } protected ObjectWriter(ObjectWriter objectwriter, SerializationConfig serializationconfig) { _config = serializationconfig; _serializerProvider = objectwriter._serializerProvider; _serializerFactory = objectwriter._serializerFactory; _generatorFactory = objectwriter._generatorFactory; _generatorSettings = objectwriter._generatorSettings; _prefetch = objectwriter._prefetch; } protected ObjectWriter(ObjectWriter objectwriter, SerializationConfig serializationconfig, GeneratorSettings generatorsettings, Prefetch prefetch) { _config = serializationconfig; _serializerProvider = objectwriter._serializerProvider; _serializerFactory = objectwriter._serializerFactory; _generatorFactory = objectwriter._generatorFactory; _generatorSettings = generatorsettings; _prefetch = prefetch; } private final void _writeCloseable(JsonGenerator jsongenerator, Object obj) throws IOException { Closeable closeable; Object obj1; Closeable closeable1; closeable1 = (Closeable)obj; closeable = closeable1; obj1 = jsongenerator; _prefetch.serialize(jsongenerator, obj, _serializerProvider()); obj = null; closeable = closeable1; obj1 = obj; jsongenerator.close(); closeable = null; obj1 = obj; closeable1.close(); if (false) { jsongenerator = com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT; throw new NullPointerException(); } if (true) { break MISSING_BLOCK_LABEL_77; } throw new NullPointerException(); return; jsongenerator; if (obj1 != null) { ((JsonGenerator) (obj1)).disable(com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); try { ((JsonGenerator) (obj1)).close(); } // Misplaced declaration of an exception variable catch (Object obj) { } } if (closeable != null) { try { closeable.close(); } // Misplaced declaration of an exception variable catch (Object obj) { } } throw jsongenerator; jsongenerator; } protected final void _configAndWriteValue(JsonGenerator jsongenerator, Object obj) throws IOException { _configureGenerator(jsongenerator); if (!_config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) || !(obj instanceof Closeable)) goto _L2; else goto _L1 _L1: _writeCloseable(jsongenerator, obj); _L4: return; _L2: boolean flag = false; _prefetch.serialize(jsongenerator, obj, _serializerProvider()); flag = true; jsongenerator.close(); if (true) goto _L4; else goto _L3 _L3: jsongenerator.disable(com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); try { jsongenerator.close(); return; } // Misplaced declaration of an exception variable catch (JsonGenerator jsongenerator) { return; } obj; if (!flag) { jsongenerator.disable(com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT); try { jsongenerator.close(); } // Misplaced declaration of an exception variable catch (JsonGenerator jsongenerator) { } } throw obj; } protected final void _configureGenerator(JsonGenerator jsongenerator) { _config.initialize(jsongenerator); _generatorSettings.initialize(jsongenerator); } protected ObjectWriter _new(GeneratorSettings generatorsettings, Prefetch prefetch) { return new ObjectWriter(this, _config, generatorsettings, prefetch); } protected ObjectWriter _new(ObjectWriter objectwriter, JsonFactory jsonfactory) { return new ObjectWriter(objectwriter, jsonfactory); } protected ObjectWriter _new(ObjectWriter objectwriter, SerializationConfig serializationconfig) { return new ObjectWriter(objectwriter, serializationconfig); } protected SequenceWriter _newSequenceWriter(boolean flag, JsonGenerator jsongenerator, boolean flag1) throws IOException { _configureGenerator(jsongenerator); return (new SequenceWriter(_serializerProvider(), jsongenerator, flag1, _prefetch)).init(flag); } protected DefaultSerializerProvider _serializerProvider() { return _serializerProvider.createInstance(_config, _serializerFactory); } protected void _verifySchemaType(FormatSchema formatschema) { if (formatschema != null && !_generatorFactory.canUseSchema(formatschema)) { throw new IllegalArgumentException((new StringBuilder()).append("Can not use FormatSchema of type ").append(formatschema.getClass().getName()).append(" for format ").append(_generatorFactory.getFormatName()).toString()); } else { return; } } public void acceptJsonFormatVisitor(JavaType javatype, JsonFormatVisitorWrapper jsonformatvisitorwrapper) throws JsonMappingException { if (javatype == null) { throw new IllegalArgumentException("type must be provided"); } else { _serializerProvider().acceptJsonFormatVisitor(javatype, jsonformatvisitorwrapper); return; } } public void acceptJsonFormatVisitor(Class class1, JsonFormatVisitorWrapper jsonformatvisitorwrapper) throws JsonMappingException { acceptJsonFormatVisitor(_config.constructType(class1), jsonformatvisitorwrapper); } public boolean canSerialize(Class class1) { return _serializerProvider().hasSerializerFor(class1, null); } public boolean canSerialize(Class class1, AtomicReference atomicreference) { return _serializerProvider().hasSerializerFor(class1, atomicreference); } public ObjectWriter forType(TypeReference typereference) { return forType(_config.getTypeFactory().constructType(typereference.getType())); } public ObjectWriter forType(JavaType javatype) { javatype = _prefetch.forRootType(this, javatype); if (javatype == _prefetch) { return this; } else { return _new(_generatorSettings, javatype); } } public ObjectWriter forType(Class class1) { if (class1 == java/lang/Object) { return forType((JavaType)null); } else { return forType(_config.constructType(class1)); } } public ContextAttributes getAttributes() { return _config.getAttributes(); } public SerializationConfig getConfig() { return _config; } public JsonFactory getFactory() { return _generatorFactory; } public TypeFactory getTypeFactory() { return _config.getTypeFactory(); } public boolean hasPrefetchedSerializer() { return _prefetch.hasSerializer(); } public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature feature) { return _generatorFactory.isEnabled(feature); } public boolean isEnabled(MapperFeature mapperfeature) { return _config.isEnabled(mapperfeature); } public boolean isEnabled(SerializationFeature serializationfeature) { return _config.isEnabled(serializationfeature); } public Version version() { return PackageVersion.VERSION; } public ObjectWriter with(Base64Variant base64variant) { base64variant = _config.with(base64variant); if (base64variant == _config) { return this; } else { return _new(this, base64variant); } } public ObjectWriter with(FormatSchema formatschema) { GeneratorSettings generatorsettings = _generatorSettings.with(formatschema); if (generatorsettings == _generatorSettings) { return this; } else { _verifySchemaType(formatschema); return _new(generatorsettings, _prefetch); } } public ObjectWriter with(JsonFactory jsonfactory) { if (jsonfactory == _generatorFactory) { return this; } else { return _new(this, jsonfactory); } } public ObjectWriter with(com.fasterxml.jackson.core.JsonGenerator.Feature feature) { feature = _config.with(feature); if (feature == _config) { return this; } else { return _new(this, feature); } } public ObjectWriter with(PrettyPrinter prettyprinter) { prettyprinter = _generatorSettings.with(prettyprinter); if (prettyprinter == _generatorSettings) { return this; } else { return _new(prettyprinter, _prefetch); } } public ObjectWriter with(CharacterEscapes characterescapes) { characterescapes = _generatorSettings.with(characterescapes); if (characterescapes == _generatorSettings) { return this; } else { return _new(characterescapes, _prefetch); } } public ObjectWriter with(SerializationFeature serializationfeature) { serializationfeature = _config.with(serializationfeature); if (serializationfeature == _config) { return this; } else { return _new(this, serializationfeature); } } public transient ObjectWriter with(SerializationFeature serializationfeature, SerializationFeature aserializationfeature[]) { serializationfeature = _config.with(serializationfeature, aserializationfeature); if (serializationfeature == _config) { return this; } else { return _new(this, serializationfeature); } } public ObjectWriter with(ContextAttributes contextattributes) { contextattributes = _config.with(contextattributes); if (contextattributes == _config) { return this; } else { return _new(this, contextattributes); } } public ObjectWriter with(FilterProvider filterprovider) { if (filterprovider == _config.getFilterProvider()) { return this; } else { return _new(this, _config.withFilters(filterprovider)); } } public ObjectWriter with(DateFormat dateformat) { dateformat = _config.with(dateformat); if (dateformat == _config) { return this; } else { return _new(this, dateformat); } } public ObjectWriter with(Locale locale) { locale = _config.with(locale); if (locale == _config) { return this; } else { return _new(this, locale); } } public ObjectWriter with(TimeZone timezone) { timezone = _config.with(timezone); if (timezone == _config) { return this; } else { return _new(this, timezone); } } public ObjectWriter withAttribute(Object obj, Object obj1) { obj = (SerializationConfig)_config.withAttribute(obj, obj1); if (obj == _config) { return this; } else { return _new(this, ((SerializationConfig) (obj))); } } public ObjectWriter withAttributes(Map map) { map = (SerializationConfig)_config.withAttributes(map); if (map == _config) { return this; } else { return _new(this, map); } } public ObjectWriter withDefaultPrettyPrinter() { return with(_config.getDefaultPrettyPrinter()); } public transient ObjectWriter withFeatures(com.fasterxml.jackson.core.JsonGenerator.Feature afeature[]) { afeature = _config.withFeatures(afeature); if (afeature == _config) { return this; } else { return _new(this, afeature); } } public transient ObjectWriter withFeatures(SerializationFeature aserializationfeature[]) { aserializationfeature = _config.withFeatures(aserializationfeature); if (aserializationfeature == _config) { return this; } else { return _new(this, aserializationfeature); } } public ObjectWriter withRootName(PropertyName propertyname) { propertyname = _config.withRootName(propertyname); if (propertyname == _config) { return this; } else { return _new(this, propertyname); } } public ObjectWriter withRootName(String s) { s = (SerializationConfig)_config.withRootName(s); if (s == _config) { return this; } else { return _new(this, s); } } public ObjectWriter withRootValueSeparator(SerializableString serializablestring) { serializablestring = _generatorSettings.withRootValueSeparator(serializablestring); if (serializablestring == _generatorSettings) { return this; } else { return _new(serializablestring, _prefetch); } } public ObjectWriter withRootValueSeparator(String s) { s = _generatorSettings.withRootValueSeparator(s); if (s == _generatorSettings) { return this; } else { return _new(s, _prefetch); } } public ObjectWriter withSchema(FormatSchema formatschema) { return with(formatschema); } public ObjectWriter withType(TypeReference typereference) { return forType(typereference); } public ObjectWriter withType(JavaType javatype) { return forType(javatype); } public ObjectWriter withType(Class class1) { return forType(class1); } public ObjectWriter withView(Class class1) { class1 = _config.withView(class1); if (class1 == _config) { return this; } else { return _new(this, class1); } } public ObjectWriter without(com.fasterxml.jackson.core.JsonGenerator.Feature feature) { feature = _config.without(feature); if (feature == _config) { return this; } else { return _new(this, feature); } } public ObjectWriter without(SerializationFeature serializationfeature) { serializationfeature = _config.without(serializationfeature); if (serializationfeature == _config) { return this; } else { return _new(this, serializationfeature); } } public transient ObjectWriter without(SerializationFeature serializationfeature, SerializationFeature aserializationfeature[]) { serializationfeature = _config.without(serializationfeature, aserializationfeature); if (serializationfeature == _config) { return this; } else { return _new(this, serializationfeature); } } public ObjectWriter withoutAttribute(Object obj) { obj = (SerializationConfig)_config.withoutAttribute(obj); if (obj == _config) { return this; } else { return _new(this, ((SerializationConfig) (obj))); } } public transient ObjectWriter withoutFeatures(com.fasterxml.jackson.core.JsonGenerator.Feature afeature[]) { afeature = _config.withoutFeatures(afeature); if (afeature == _config) { return this; } else { return _new(this, afeature); } } public transient ObjectWriter withoutFeatures(SerializationFeature aserializationfeature[]) { aserializationfeature = _config.withoutFeatures(aserializationfeature); if (aserializationfeature == _config) { return this; } else { return _new(this, aserializationfeature); } } public ObjectWriter withoutRootName() { SerializationConfig serializationconfig = _config.withRootName(PropertyName.NO_NAME); if (serializationconfig == _config) { return this; } else { return _new(this, serializationconfig); } } public void writeValue(JsonGenerator jsongenerator, Object obj) throws IOException, JsonGenerationException, JsonMappingException { Closeable closeable; Closeable closeable1; _configureGenerator(jsongenerator); if (!_config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) || !(obj instanceof Closeable)) { break MISSING_BLOCK_LABEL_105; } closeable1 = (Closeable)obj; closeable = closeable1; _prefetch.serialize(jsongenerator, obj, _serializerProvider()); closeable = closeable1; if (!_config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) { break MISSING_BLOCK_LABEL_70; } closeable = closeable1; jsongenerator.flush(); closeable = null; closeable1.close(); if (true) { break MISSING_BLOCK_LABEL_91; } throw new NullPointerException(); _L1: return; jsongenerator; if (closeable != null) { try { closeable.close(); } // Misplaced declaration of an exception variable catch (Object obj) { } } throw jsongenerator; _prefetch.serialize(jsongenerator, obj, _serializerProvider()); if (_config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) { jsongenerator.flush(); return; } goto _L1 jsongenerator; } public void writeValue(File file, Object obj) throws IOException, JsonGenerationException, JsonMappingException { _configAndWriteValue(_generatorFactory.createGenerator(file, JsonEncoding.UTF8), obj); } public void writeValue(OutputStream outputstream, Object obj) throws IOException, JsonGenerationException, JsonMappingException { _configAndWriteValue(_generatorFactory.createGenerator(outputstream, JsonEncoding.UTF8), obj); } public void writeValue(Writer writer, Object obj) throws IOException, JsonGenerationException, JsonMappingException { _configAndWriteValue(_generatorFactory.createGenerator(writer), obj); } public byte[] writeValueAsBytes(Object obj) throws JsonProcessingException { ByteArrayBuilder bytearraybuilder = new ByteArrayBuilder(_generatorFactory._getBufferRecycler()); try { _configAndWriteValue(_generatorFactory.createGenerator(bytearraybuilder, JsonEncoding.UTF8), obj); } // Misplaced declaration of an exception variable catch (Object obj) { throw obj; } // Misplaced declaration of an exception variable catch (Object obj) { throw JsonMappingException.fromUnexpectedIOE(((IOException) (obj))); } obj = bytearraybuilder.toByteArray(); bytearraybuilder.release(); return ((byte []) (obj)); } public String writeValueAsString(Object obj) throws JsonProcessingException { SegmentedStringWriter segmentedstringwriter = new SegmentedStringWriter(_generatorFactory._getBufferRecycler()); try { _configAndWriteValue(_generatorFactory.createGenerator(segmentedstringwriter), obj); } // Misplaced declaration of an exception variable catch (Object obj) { throw obj; } // Misplaced declaration of an exception variable catch (Object obj) { throw JsonMappingException.fromUnexpectedIOE(((IOException) (obj))); } return segmentedstringwriter.getAndClear(); } public SequenceWriter writeValues(JsonGenerator jsongenerator) throws IOException { _configureGenerator(jsongenerator); return _newSequenceWriter(false, jsongenerator, false); } public SequenceWriter writeValues(File file) throws IOException { return _newSequenceWriter(false, _generatorFactory.createGenerator(file, JsonEncoding.UTF8), true); } public SequenceWriter writeValues(OutputStream outputstream) throws IOException { return _newSequenceWriter(false, _generatorFactory.createGenerator(outputstream, JsonEncoding.UTF8), true); } public SequenceWriter writeValues(Writer writer) throws IOException { return _newSequenceWriter(false, _generatorFactory.createGenerator(writer), true); } public SequenceWriter writeValuesAsArray(JsonGenerator jsongenerator) throws IOException { return _newSequenceWriter(true, jsongenerator, false); } public SequenceWriter writeValuesAsArray(File file) throws IOException { return _newSequenceWriter(true, _generatorFactory.createGenerator(file, JsonEncoding.UTF8), true); } public SequenceWriter writeValuesAsArray(OutputStream outputstream) throws IOException { return _newSequenceWriter(true, _generatorFactory.createGenerator(outputstream, JsonEncoding.UTF8), true); } public SequenceWriter writeValuesAsArray(Writer writer) throws IOException { return _newSequenceWriter(true, _generatorFactory.createGenerator(writer), true); } }