@@ -76,7 +76,7 @@ private static class InteropInfo {
76
76
77
77
private int getInheritanceDepth (Class <?> klass ) {
78
78
if (klass .getName ().equals ("java.lang.Object" )) {
79
- return 1
79
+ return 1 ;
80
80
} else {
81
81
return 1 + getInheritanceDepth (klass .getSuperclass ());
82
82
}
@@ -333,7 +333,7 @@ protected ClassContext createAdaptor(Class<?> target) {
333
333
cc .className = className ;
334
334
cc .target = target ;
335
335
336
- for (method m : target .getMethods ()) analyzeMethodHiding (cc , m );
336
+ for (Method m : target .getMethods ()) analyzeMethodHiding (cc , m );
337
337
338
338
for (Method m : target .getMethods ()) createAdaptorMethod (cc , m );
339
339
for (Field f : target .getFields ()) createAdaptorField (cc , f );
@@ -347,22 +347,22 @@ protected ClassContext createAdaptor(Class<?> target) {
347
347
}
348
348
349
349
protected void analyzeMethodHiding (ClassContext cc , Method m ) {
350
- String desc = type .getMethodDescriptor (m );
350
+ String desc = Type .getMethodDescriptor (m );
351
351
352
352
int s2 = desc .indexOf (')' );
353
353
String fragment = desc .substring (s2 );
354
354
355
- Integer derivationDepth = getInheritanceDepth (m );
355
+ Integer derivationDepth = getInheritanceDepth (m . getDeclaringClass () );
356
356
357
357
if (cc .inheritanceHiding .containsKey (fragment )) {
358
- ClassContext . HidingInformation info = cc .inheritanceHiding .get (fragment );
358
+ HidingInformation info = cc .inheritanceHiding .get (fragment );
359
359
360
360
if (derivationDepth > info .inheritanceDepth ) {
361
361
info .inheritanceDepth = derivationDepth ;
362
362
info .mostSpecificSignature = desc ;
363
363
}
364
364
} else {
365
- ClassContext . HidingInformation info = new ClassContext . HidingInformation ;
365
+ HidingInformation info = new HidingInformation () ;
366
366
367
367
info .inheritanceDepth = derivationDepth ;
368
368
info .mostSpecificSignature = desc ;
@@ -538,6 +538,7 @@ protected void createAdaptorMethod(ClassContext c, Method tobind) {
538
538
boolean isStatic = Modifier .isStatic (tobind .getModifiers ());
539
539
540
540
String desc = Type .getMethodDescriptor (tobind );
541
+ String name = tobind .getName ();
541
542
Integer arity = ptype .length ;
542
543
543
544
int returnPos = desc .indexOf (')' );
@@ -859,14 +860,15 @@ else if (what == ThreadContext.class) {
859
860
/** Type name of {@link ThreadContext}. */
860
861
protected static final Type TYPE_TC = Type .getType (ThreadContext .class );
861
862
863
+ /** Store information needed to figure out which methods are hidden */
864
+ protected class HidingInformation {
865
+ /** How far away from java.lang.object are we? */
866
+ public Integer inheritanceDepth ;
867
+ /** Which signature has been the most derived version so far? */
868
+ public String mostSpecificSignature ;
869
+ }
862
870
/** Stores working information while building a class. */
863
871
protected static class ClassContext {
864
- protected class HidingInformation {
865
- /** How far away from java.lang.object are we? */
866
- public Integer inheritanceDepth ;
867
- /** Which signature has been the most derived version so far? */
868
- public String mostSpecificSignature ;
869
- }
870
872
/** The ASM class writer. */
871
873
public ClassWriter cv ;
872
874
/** The new class' internal name. */
0 commit comments