@@ -18,24 +18,8 @@ public final class ClassUtil
18
18
19
19
private final static Annotation [] NO_ANNOTATIONS = new Annotation [0 ];
20
20
private final static Ctor [] NO_CTORS = new Ctor [0 ];
21
-
22
- /*
23
- /**********************************************************
24
- /* Helper classes
25
- /**********************************************************
26
- */
27
21
28
- /* 21-Feb-2016, tatu: Unfortunately `Collections.emptyIterator()` only
29
- * comes with JDK7, so we'll still have to include our bogus implementation
30
- * for as long as we want JDK6 runtime compatibility
31
- */
32
- private final static class EmptyIterator <T > implements Iterator <T > {
33
- @ Override public boolean hasNext () { return false ; }
34
- @ Override public T next () { throw new NoSuchElementException (); }
35
- @ Override public void remove () { throw new UnsupportedOperationException (); }
36
- }
37
-
38
- private final static EmptyIterator <?> EMPTY_ITERATOR = new EmptyIterator <Object >();
22
+ private final static Iterator <?> EMPTY_ITERATOR = Collections .emptyIterator ();
39
23
40
24
/*
41
25
/**********************************************************
@@ -48,8 +32,6 @@ private final static class EmptyIterator<T> implements Iterator<T> {
48
32
*/
49
33
@ SuppressWarnings ("unchecked" )
50
34
public static <T > Iterator <T > emptyIterator () {
51
- // 21-Feb-2016, tatu: As per above, use a locally defined empty iterator
52
- // return Collections.emptyIterator();
53
35
return (Iterator <T >) EMPTY_ITERATOR ;
54
36
}
55
37
@@ -328,52 +310,6 @@ public static void verifyMustOverride(Class<?> expType, Object instance,
328
310
instance .getClass ().getName (), expType .getName (), method ));
329
311
}
330
312
}
331
-
332
- /*
333
- /**********************************************************
334
- /* Class loading
335
- /**********************************************************
336
- */
337
-
338
- /**
339
- * @deprecated Since 2.6, use method in {@link com.fasterxml.jackson.databind.type.TypeFactory}.
340
- */
341
- @ Deprecated
342
- public static Class <?> findClass (String className ) throws ClassNotFoundException
343
- {
344
- // [JACKSON-597]: support primitive types (and void)
345
- if (className .indexOf ('.' ) < 0 ) {
346
- if ("int" .equals (className )) return Integer .TYPE ;
347
- if ("long" .equals (className )) return Long .TYPE ;
348
- if ("float" .equals (className )) return Float .TYPE ;
349
- if ("double" .equals (className )) return Double .TYPE ;
350
- if ("boolean" .equals (className )) return Boolean .TYPE ;
351
- if ("byte" .equals (className )) return Byte .TYPE ;
352
- if ("char" .equals (className )) return Character .TYPE ;
353
- if ("short" .equals (className )) return Short .TYPE ;
354
- if ("void" .equals (className )) return Void .TYPE ;
355
- }
356
- // Two-phase lookup: first using context ClassLoader; then default
357
- Throwable prob = null ;
358
- ClassLoader loader = Thread .currentThread ().getContextClassLoader ();
359
-
360
- if (loader != null ) {
361
- try {
362
- return Class .forName (className , true , loader );
363
- } catch (Exception e ) {
364
- prob = getRootCause (e );
365
- }
366
- }
367
- try {
368
- return Class .forName (className );
369
- } catch (Exception e ) {
370
- if (prob == null ) {
371
- prob = getRootCause (e );
372
- }
373
- }
374
- throwIfRTE (prob );
375
- throw new ClassNotFoundException (prob .getMessage (), prob );
376
- }
377
313
378
314
/*
379
315
/**********************************************************
0 commit comments