@@ -86,20 +86,6 @@ public void serializeWithType(JsonGenerator g, SerializerProvider provider,
86
86
{
87
87
g .writeNull ();
88
88
}
89
-
90
- @ Override
91
- public boolean equals (Object o )
92
- {
93
- /* Hmmh. Since there's just a singleton instance, this
94
- * fails in all cases but with identity comparison.
95
- * However: if this placeholder value was to be considered
96
- * similar to SQL NULL, it shouldn't even equal itself?
97
- * That might cause problems when dealing with collections
98
- * like Sets... so for now, let's let identity comparison
99
- * return true.
100
- */
101
- return (o == this );
102
- }
103
89
104
90
@ SuppressWarnings ("unchecked" )
105
91
@ Override
@@ -113,11 +99,6 @@ public JsonNode requireNonNull() {
113
99
return _reportRequiredViolation ("requireNonNull() called on `MissingNode`" );
114
100
}
115
101
116
- @ Override
117
- public int hashCode () {
118
- return JsonNodeType .MISSING .ordinal ();
119
- }
120
-
121
102
@ Override
122
103
public JsonNode get (int index ) {
123
104
return null ;
@@ -158,4 +139,39 @@ public List<String> findValuesAsText(String fieldName, List<String> foundSoFar)
158
139
public List <JsonNode > findParents (String fieldName , List <JsonNode > foundSoFar ) {
159
140
return foundSoFar ;
160
141
}
142
+
143
+ /*
144
+ /**********************************************************
145
+ /* Standard method overrides
146
+ /**********************************************************
147
+ */
148
+
149
+ @ Override
150
+ public boolean equals (Object o )
151
+ {
152
+ // Hmmh. Since there's just a singleton instance, this fails in all cases
153
+ // but with identity comparison.
154
+ // However: if this placeholder value was to be considered similar to SQL NULL,
155
+ // it shouldn't even equal itself?
156
+ // That might cause problems when dealing with collections like Sets...
157
+ // so for now, let's let identity comparison return true.
158
+ return (o == this );
159
+ }
160
+
161
+ @ Override
162
+ public int hashCode () {
163
+ return JsonNodeType .MISSING .ordinal ();
164
+ }
165
+
166
+ // 10-Dec-2019, tatu: Bit tricky case, see [databind#2566], but seems
167
+ // best NOT to produce legit JSON.
168
+ @ Override
169
+ public String toString () {
170
+ return "" ;
171
+ }
172
+
173
+ @ Override
174
+ public String toPrettyString () {
175
+ return "" ;
176
+ }
161
177
}
0 commit comments