this code:
import java.security.*;
class Builder {}
class StaticError {
static Builder newInstance(Object provider) {
return new Builder() {
private final PrivilegedExceptionAction<KeyStore> action = new PrivilegedExceptionAction<KeyStore>() {
public KeyStore run() throws Exception {
if (provider == null) {}
return null;
}
};
};
}
}
is failing with:
StaticVarBeingAccessed.java:10: error: non-static variable provider cannot be referenced from a static context
if (provider == null) {}
^
1 error
the recent checks added to fixJDK-8247790 are the cause of this issue
import java.security.*;
class Builder {}
class StaticError {
static Builder newInstance(Object provider) {
return new Builder() {
private final PrivilegedExceptionAction<KeyStore> action = new PrivilegedExceptionAction<KeyStore>() {
public KeyStore run() throws Exception {
if (provider == null) {}
return null;
}
};
};
}
}
is failing with:
StaticVarBeingAccessed.java:10: error: non-static variable provider cannot be referenced from a static context
if (provider == null) {}
^
1 error
the recent checks added to fix