test/hotspot/jtreg/runtime/InvocationTests/invokevirtual/Checker.java
changeset 55552 9bd13d6dea77
parent 55497 d3a33953b936
child 58679 9c3209ff7550
equal deleted inserted replaced
55551:f1216302bdef 55552:9bd13d6dea77
    86         // TODO: ? need to find out the right behavior
    86         // TODO: ? need to find out the right behavior
    87         if (staticTargetMethod == null) {
    87         if (staticTargetMethod == null) {
    88             return null;
    88             return null;
    89         }
    89         }
    90 
    90 
    91         // Dynamic target doesn't have desired method, so check it's superclass
    91         // Dynamic target doesn't have desired method, so check its superclass
    92         if (dynamicTargetMethod == null) {
    92         if (dynamicTargetMethod == null) {
    93             return getOverriddenMethod(staticTarget, dynamicTarget.getSuperclass());
    93             return getOverriddenMethod(staticTarget, dynamicTarget.getSuperclass());
    94         } else {
    94         } else {
    95             // Private method can't override anything
    95             // Private method can't override anything
    96             if (Modifier.isPrivate(dynamicTargetMethod.getModifiers())) {
    96             if (Modifier.isPrivate(dynamicTargetMethod.getModifiers())) {
   107             boolean isProtected = Modifier.isProtected(staticTargetModifiers);
   107             boolean isProtected = Modifier.isProtected(staticTargetModifiers);
   108             boolean isPrivate = Modifier.isPrivate(staticTargetModifiers) ;
   108             boolean isPrivate = Modifier.isPrivate(staticTargetModifiers) ;
   109             String staticTargetPkg = getClassPackageName(staticTarget);
   109             String staticTargetPkg = getClassPackageName(staticTarget);
   110             String dynamicTargetPkg = getClassPackageName(dynamicTarget);
   110             String dynamicTargetPkg = getClassPackageName(dynamicTarget);
   111 
   111 
   112             if ( isPublic || isProtected
   112             if (isPublic || isProtected
   113                  || ( !isPublic && !isProtected && !isPrivate
   113                 || (!isPublic && !isProtected && !isPrivate
   114                       && staticTargetPkg.equals(dynamicTargetPkg)
   114                     && staticTargetPkg.equals(dynamicTargetPkg))) {
   115                     ))
       
   116             {
       
   117                 return dynamicTargetMethod;
   115                 return dynamicTargetMethod;
   118             }
   116             }
   119         }
   117         }
   120         // OR
   118         // OR
   121         //Assertion #3.b: exists m3: C.m1 != B.m3, A.m2 != B.m3, B.m3 overrides A.m2, C.m1 overrides B.m3
   119         //Assertion #3.b: exists m3: C.m1 != B.m3, A.m2 != B.m3, B.m3 overrides A.m2, C.m1 overrides B.m3