Skip to content

Commit efc6b98

Browse files
committed
minor test cleanup
1 parent 639ed6c commit efc6b98

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

src/main/java/com/fasterxml/jackson/databind/jsontype/TypeSerializer.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public abstract class TypeSerializer
7373
*
7474
* @param value Value that will be serialized, for which type information is
7575
* to be written
76-
* @param jgen Generator to use for writing type information
76+
* @param gen Generator to use for writing type information
7777
*/
78-
public abstract void writeTypePrefixForScalar(Object value, JsonGenerator jgen) throws IOException;
78+
public abstract void writeTypePrefixForScalar(Object value, JsonGenerator gen) throws IOException;
7979

8080
/**
8181
* Method called to write initial part of type information for given
@@ -86,9 +86,9 @@ public abstract class TypeSerializer
8686
*
8787
* @param value Value that will be serialized, for which type information is
8888
* to be written
89-
* @param jgen Generator to use for writing type information
89+
* @param gen Generator to use for writing type information
9090
*/
91-
public abstract void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException;
91+
public abstract void writeTypePrefixForObject(Object value, JsonGenerator gen) throws IOException;
9292

9393
/**
9494
* Method called to write initial part of type information for given
@@ -99,59 +99,59 @@ public abstract class TypeSerializer
9999
*
100100
* @param value Value that will be serialized, for which type information is
101101
* to be written
102-
* @param jgen Generator to use for writing type information
102+
* @param gen Generator to use for writing type information
103103
*/
104-
public abstract void writeTypePrefixForArray(Object value, JsonGenerator jgen) throws IOException;
104+
public abstract void writeTypePrefixForArray(Object value, JsonGenerator gen) throws IOException;
105105

106106
/**
107107
* Method called after value has been serialized, to close any scopes opened
108108
* by earlier matching call to {@link #writeTypePrefixForScalar}.
109109
* Actual action to take may depend on various factors, but has to match with
110110
* action {@link #writeTypePrefixForScalar} did (close array or object; or do nothing).
111111
*/
112-
public abstract void writeTypeSuffixForScalar(Object value, JsonGenerator jgen) throws IOException;
112+
public abstract void writeTypeSuffixForScalar(Object value, JsonGenerator gen) throws IOException;
113113

114114
/**
115115
* Method called after value has been serialized, to close any scopes opened
116116
* by earlier matching call to {@link #writeTypePrefixForObject}.
117117
* It needs to write closing END_OBJECT marker, and any other decoration
118118
* that needs to be matched.
119119
*/
120-
public abstract void writeTypeSuffixForObject(Object value, JsonGenerator jgen) throws IOException;
120+
public abstract void writeTypeSuffixForObject(Object value, JsonGenerator gen) throws IOException;
121121

122122
/**
123123
* Method called after value has been serialized, to close any scopes opened
124124
* by earlier matching call to {@link #writeTypeSuffixForScalar}.
125125
* It needs to write closing END_ARRAY marker, and any other decoration
126126
* that needs to be matched.
127127
*/
128-
public abstract void writeTypeSuffixForArray(Object value, JsonGenerator jgen) throws IOException;
128+
public abstract void writeTypeSuffixForArray(Object value, JsonGenerator gen) throws IOException;
129129

130130
/**
131131
* Alternative version of the prefix-for-scalar method, which is given
132132
* actual type to use (instead of using exact type of the value); typically
133133
* a super type of actual value type
134134
*/
135-
public void writeTypePrefixForScalar(Object value, JsonGenerator jgen, Class<?> type) throws IOException {
136-
writeTypePrefixForScalar(value, jgen);
135+
public void writeTypePrefixForScalar(Object value, JsonGenerator gen, Class<?> type) throws IOException {
136+
writeTypePrefixForScalar(value, gen);
137137
}
138138

139139
/**
140140
* Alternative version of the prefix-for-object method, which is given
141141
* actual type to use (instead of using exact type of the value); typically
142142
* a super type of actual value type
143143
*/
144-
public void writeTypePrefixForObject(Object value, JsonGenerator jgen, Class<?> type) throws IOException {
145-
writeTypePrefixForObject(value, jgen);
144+
public void writeTypePrefixForObject(Object value, JsonGenerator gen, Class<?> type) throws IOException {
145+
writeTypePrefixForObject(value, gen);
146146
}
147147

148148
/**
149149
* Alternative version of the prefix-for-array method, which is given
150150
* actual type to use (instead of using exact type of the value); typically
151151
* a super type of actual value type
152152
*/
153-
public void writeTypePrefixForArray(Object value, JsonGenerator jgen, Class<?> type) throws IOException {
154-
writeTypePrefixForArray(value, jgen);
153+
public void writeTypePrefixForArray(Object value, JsonGenerator gen, Class<?> type) throws IOException {
154+
writeTypePrefixForArray(value, gen);
155155
}
156156

157157
/*
@@ -170,10 +170,10 @@ public void writeTypePrefixForArray(Object value, JsonGenerator jgen, Class<?> t
170170
*
171171
* @param value Value that will be serialized, for which type information is
172172
* to be written
173-
* @param jgen Generator to use for writing type information
173+
* @param gen Generator to use for writing type information
174174
* @param typeId Exact type id to use
175175
*/
176-
public abstract void writeCustomTypePrefixForScalar(Object value, JsonGenerator jgen, String typeId) throws IOException, JsonProcessingException;
176+
public abstract void writeCustomTypePrefixForScalar(Object value, JsonGenerator gen, String typeId) throws IOException;
177177

178178
/**
179179
* Method called to write initial part of type information for given
@@ -185,16 +185,16 @@ public void writeTypePrefixForArray(Object value, JsonGenerator jgen, Class<?> t
185185
*
186186
* @param value Value that will be serialized, for which type information is
187187
* to be written
188-
* @param jgen Generator to use for writing type information
188+
* @param gen Generator to use for writing type information
189189
* @param typeId Exact type id to use
190190
*/
191-
public abstract void writeCustomTypePrefixForObject(Object value, JsonGenerator jgen, String typeId) throws IOException;
191+
public abstract void writeCustomTypePrefixForObject(Object value, JsonGenerator gen, String typeId) throws IOException;
192192

193-
public abstract void writeCustomTypePrefixForArray(Object value, JsonGenerator jgen, String typeId) throws IOException;
193+
public abstract void writeCustomTypePrefixForArray(Object value, JsonGenerator gen, String typeId) throws IOException;
194194

195-
public abstract void writeCustomTypeSuffixForScalar(Object value, JsonGenerator jgen, String typeId) throws IOException;
195+
public abstract void writeCustomTypeSuffixForScalar(Object value, JsonGenerator gen, String typeId) throws IOException;
196196

197-
public abstract void writeCustomTypeSuffixForObject(Object value, JsonGenerator jgen, String typeId) throws IOException;
197+
public abstract void writeCustomTypeSuffixForObject(Object value, JsonGenerator gen, String typeId) throws IOException;
198198

199-
public abstract void writeCustomTypeSuffixForArray(Object value, JsonGenerator jgen, String typeId) throws IOException;
199+
public abstract void writeCustomTypeSuffixForArray(Object value, JsonGenerator gen, String typeId) throws IOException;
200200
}

src/test/java/com/fasterxml/jackson/databind/jsontype/TestDefaultForObject.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
public class TestDefaultForObject
1212
extends BaseMapTest
1313
{
14-
/*
15-
/**********************************************************
16-
/* Helper types
17-
/**********************************************************
18-
*/
19-
2014
static abstract class AbstractBean { }
2115

2216
static class StringBean extends AbstractBean { // ha, punny!
@@ -42,7 +36,6 @@ enum ComplexChoice {
4236
public String toString() { return String.valueOf(state); }
4337
}
4438

45-
// [JACKSON-311]
4639
static class PolymorphicType {
4740
public String foo;
4841
public Object bar;
@@ -70,7 +63,6 @@ public ObjectHolder() { }
7063
public ObjectHolder(Object v) { value = v; }
7164
}
7265

73-
// [JACKSON-352]
7466
static class DomainBean {
7567
public int weight;
7668
}

src/test/java/com/fasterxml/jackson/databind/ser/TestJsonValue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void testInList() throws Exception {
249249
assertEquals(json, "{\"values\":[{\"i\":1},{\"i\":2}]}");
250250
}
251251

252-
// [Issue#167]
252+
// [databind#167]
253253
public void testPolymorphicSerdeWithDelegate() throws Exception
254254
{
255255
AdditionInterface adder = new AdditionInterfaceImpl(1);
@@ -262,7 +262,7 @@ public void testPolymorphicSerdeWithDelegate() throws Exception
262262
adder = new NegatingAdditionInterface(adder);
263263
assertEquals(0, adder.add(1));
264264
json = MAPPER.writeValueAsString(adder);
265-
265+
266266
assertEquals("{\"boingo\":\"boopsy\",\"toAdd\":1}", json);
267267
assertEquals(2, MAPPER.readValue(json, AdditionInterface.class).add(1));
268268
}

0 commit comments

Comments
 (0)