Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Automatic merge of jdk:master into master
- Loading branch information
|
@@ -2289,13 +2289,11 @@ Symbol findTypeVar(Env<AttrContext> currentEnv, Env<AttrContext> originalEnv, Na |
|
|
} |
|
|
|
|
|
boolean isInnerClassOfMethod(Symbol msym, Symbol csym) { |
|
|
if (csym.owner == msym && !csym.isStatic()) { |
|
|
return true; |
|
|
} else if (csym.owner.kind == TYP) { |
|
|
return isInnerClassOfMethod(msym, csym.owner); |
|
|
} else { |
|
|
return false; |
|
|
while (csym.owner != msym) { |
|
|
if (csym.isStatic()) return false; |
|
|
csym = csym.owner.enclClass(); |
|
|
} |
|
|
return (csym.owner == msym && !csym.isStatic()); |
|
|
} |
|
|
|
|
|
/** Find an unqualified type symbol. |
|
|
|
@@ -800,6 +800,48 @@ void m() { |
|
|
} |
|
|
""" |
|
|
); |
|
|
|
|
|
// positive cases |
|
|
assertOK( |
|
|
""" |
|
|
import java.security.*; |
|
|
class Test { |
|
|
static Test newInstance(Object provider) { |
|
|
return new Test() { |
|
|
private final PrivilegedExceptionAction<KeyStore> action = new PrivilegedExceptionAction<KeyStore>() { |
|
|
public KeyStore run() throws Exception { |
|
|
if (provider == null) {} |
|
|
return null; |
|
|
} |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
""" |
|
|
); |
|
|
|
|
|
assertOK( |
|
|
""" |
|
|
import java.security.*; |
|
|
class Test { |
|
|
static Test newInstance(Object provider) { |
|
|
return new Test() { |
|
|
int m(PrivilegedExceptionAction<KeyStore> a) { return 0; } |
|
|
{ |
|
|
m( |
|
|
new PrivilegedExceptionAction<KeyStore>() { |
|
|
public KeyStore run() throws Exception { |
|
|
if (provider == null) {} |
|
|
return null; |
|
|
} |
|
|
} |
|
|
); |
|
|
} |
|
|
}; |
|
|
} |
|
|
} |
|
|
""" |
|
|
); |
|
|
} |
|
|
|
|
|
public void testReturnInCanonical_Compact() { |
|
|