Skip to content

Commit 549d8e6

Browse files
committed
Minor tweaking to make jar size stay below 200k
1 parent 68f831b commit 549d8e6

File tree

2 files changed

+24
-48
lines changed

2 files changed

+24
-48
lines changed

src/main/java/com/fasterxml/jackson/core/JsonFactory.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
*/
4040
@SuppressWarnings("resource")
4141
public class JsonFactory
42-
implements Versioned,
43-
java.io.Serializable // since 2.1 (for Android, mostly)
42+
implements Versioned, java.io.Serializable // since 2.1 (for Android, mostly)
4443
{
4544
/**
4645
* Computed for Jackson 2.3.0 release
@@ -110,8 +109,7 @@ public static int collectDefaults()
110109
return flags;
111110
}
112111

113-
private Feature(boolean defaultState)
114-
{
112+
private Feature(boolean defaultState) {
115113
_defaultState = defaultState;
116114
}
117115

@@ -152,7 +150,7 @@ private Feature(boolean defaultState)
152150
protected final static int DEFAULT_GENERATOR_FEATURE_FLAGS = JsonGenerator.Feature.collectDefaults();
153151

154152
private final static SerializableString DEFAULT_ROOT_VALUE_SEPARATOR = DefaultPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR;
155-
153+
156154
/*
157155
/**********************************************************
158156
/* Buffer, symbol table management

src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ public JsonGenerator setCodec(ObjectCodec oc) {
167167
/**********************************************************
168168
*/
169169

170-
//public void writeStartArray() throws IOException, JsonGenerationException
171-
//public void writeEndArray() throws IOException, JsonGenerationException
172-
//public void writeStartObject() throws IOException, JsonGenerationException
173-
//public void writeEndObject() throws IOException, JsonGenerationException
170+
//public void writeStartArray() throws IOException
171+
//public void writeEndArray() throws IOException
172+
//public void writeStartObject() throws IOException
173+
//public void writeEndObject() throws IOException
174174

175175
/*
176176
/**********************************************************
@@ -179,49 +179,43 @@ public JsonGenerator setCodec(ObjectCodec oc) {
179179
*/
180180

181181
@Override
182-
public void writeFieldName(SerializableString name) throws IOException, JsonGenerationException {
182+
public void writeFieldName(SerializableString name) throws IOException {
183183
writeFieldName(name.getValue());
184184
}
185185

186-
//public abstract void writeString(String text) throws IOException, JsonGenerationException;
186+
//public abstract void writeString(String text) throws IOException;
187187

188-
//public abstract void writeString(char[] text, int offset, int len) throws IOException, JsonGenerationException;
188+
//public abstract void writeString(char[] text, int offset, int len) throws IOException;
189189

190-
//public abstract void writeRaw(String text) throws IOException, JsonGenerationException;
190+
//public abstract void writeRaw(String text) throws IOException;
191191

192-
//public abstract void writeRaw(char[] text, int offset, int len) throws IOException, JsonGenerationException;
192+
//public abstract void writeRaw(char[] text, int offset, int len) throws IOException;
193193

194194
@Override
195-
public void writeString(SerializableString text) throws IOException, JsonGenerationException {
195+
public void writeString(SerializableString text) throws IOException {
196196
writeString(text.getValue());
197197
}
198198

199199
@Override
200-
public void writeRawValue(String text) throws IOException, JsonGenerationException
201-
{
200+
public void writeRawValue(String text) throws IOException {
202201
_verifyValueWrite("write raw value");
203202
writeRaw(text);
204203
}
205204

206205
@Override
207-
public void writeRawValue(String text, int offset, int len)
208-
throws IOException, JsonGenerationException
209-
{
206+
public void writeRawValue(String text, int offset, int len) throws IOException {
210207
_verifyValueWrite("write raw value");
211208
writeRaw(text, offset, len);
212209
}
213210

214211
@Override
215-
public void writeRawValue(char[] text, int offset, int len)
216-
throws IOException, JsonGenerationException
217-
{
212+
public void writeRawValue(char[] text, int offset, int len) throws IOException {
218213
_verifyValueWrite("write raw value");
219214
writeRaw(text, offset, len);
220215
}
221216

222217
@Override
223-
public int writeBinary(Base64Variant b64variant, InputStream data, int dataLength)
224-
throws IOException, JsonGenerationException {
218+
public int writeBinary(Base64Variant b64variant, InputStream data, int dataLength) throws IOException {
225219
// Let's implement this as "unsupported" to make it easier to add new parser impls
226220
_reportUnsupportedOperation();
227221
return 0;
@@ -252,8 +246,7 @@ public abstract void writeNull()
252246
*/
253247

254248
@Override
255-
public void writeObject(Object value)
256-
throws IOException, JsonProcessingException
249+
public void writeObject(Object value) throws IOException
257250
{
258251
if (value == null) {
259252
// important: call method that does check value write:
@@ -273,8 +266,7 @@ public void writeObject(Object value)
273266
}
274267

275268
@Override
276-
public void writeTree(TreeNode rootNode)
277-
throws IOException, JsonProcessingException
269+
public void writeTree(TreeNode rootNode) throws IOException
278270
{
279271
// As with 'writeObject()', we are not check if write would work
280272
if (rootNode == null) {
@@ -293,17 +285,9 @@ public void writeTree(TreeNode rootNode)
293285
/**********************************************************
294286
*/
295287

296-
@Override
297-
public abstract void flush() throws IOException;
298-
299-
@Override
300-
public void close() throws IOException
301-
{
302-
_closed = true;
303-
}
304-
305-
@Override
306-
public boolean isClosed() { return _closed; }
288+
@Override public abstract void flush() throws IOException;
289+
@Override public void close() throws IOException { _closed = true; }
290+
@Override public boolean isClosed() { return _closed; }
307291

308292
/*
309293
/**********************************************************
@@ -325,15 +309,9 @@ public void close() throws IOException
325309
* @param typeMsg Additional message used for generating exception message
326310
* if value output is NOT legal in current generator output state.
327311
*/
328-
protected abstract void _verifyValueWrite(String typeMsg)
329-
throws IOException, JsonGenerationException;
312+
protected abstract void _verifyValueWrite(String typeMsg) throws IOException;
330313

331314
// @Deprecated in 2.3 -- now defined in super-class; remove in 2.4
332315
@Override
333-
protected void _writeSimpleObject(Object value)
334-
throws IOException, JsonGenerationException
335-
{
336-
// TODO:
337-
super._writeSimpleObject(value);
338-
}
316+
protected void _writeSimpleObject(Object value) throws IOException { super._writeSimpleObject(value); }
339317
}

0 commit comments

Comments
 (0)