< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
Print this page
*** 294,304 ****
(owner.kind == VAR ||
owner.kind == MTH && (owner.flags() & BLOCK) != 0) &&
(owner.flags() & STATIC) == 0;
}
! /** Is class accessible in given evironment?
* @param env The current environment.
* @param c The class whose accessibility is checked.
*/
public boolean isAccessible(Env<AttrContext> env, TypeSymbol c) {
return isAccessible(env, c, false);
--- 294,304 ----
(owner.kind == VAR ||
owner.kind == MTH && (owner.flags() & BLOCK) != 0) &&
(owner.flags() & STATIC) == 0;
}
! /** Is class accessible in given environment?
* @param env The current environment.
* @param c The class whose accessibility is checked.
*/
public boolean isAccessible(Env<AttrContext> env, TypeSymbol c) {
return isAccessible(env, c, false);
*** 3222,3232 ****
}
@Override
ReferenceLookupResult unboundResult(ReferenceLookupResult boundRes, ReferenceLookupResult unboundRes) {
if (boundRes.isSuccess() && !boundRes.hasKind(StaticKind.NON_STATIC)) {
! //the first serach has at least one applicable static method
return boundRes;
} else if (unboundRes.isSuccess() && !unboundRes.hasKind(StaticKind.STATIC)) {
//the second search has at least one applicable non-static method
return unboundRes;
} else if (boundRes.isSuccess() || unboundRes.isSuccess()) {
--- 3222,3232 ----
}
@Override
ReferenceLookupResult unboundResult(ReferenceLookupResult boundRes, ReferenceLookupResult unboundRes) {
if (boundRes.isSuccess() && !boundRes.hasKind(StaticKind.NON_STATIC)) {
! //the first search has at least one applicable static method
return boundRes;
} else if (unboundRes.isSuccess() && !unboundRes.hasKind(StaticKind.STATIC)) {
//the second search has at least one applicable non-static method
return unboundRes;
} else if (boundRes.isSuccess() || unboundRes.isSuccess()) {
*** 4585,4595 ****
* A diagnostic rewriter transforms a method resolution diagnostic
* into a simpler one
*/
interface DiagnosticRewriter {
JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
! DiagnosticPosition preferedPos, DiagnosticSource preferredSource,
DiagnosticType preferredKind, JCDiagnostic d);
}
/**
* A diagnostic template is made up of two ingredients: (i) a regular
--- 4585,4595 ----
* A diagnostic rewriter transforms a method resolution diagnostic
* into a simpler one
*/
interface DiagnosticRewriter {
JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
! DiagnosticPosition preferredPos, DiagnosticSource preferredSource,
DiagnosticType preferredKind, JCDiagnostic d);
}
/**
* A diagnostic template is made up of two ingredients: (i) a regular
*** 4641,4656 ****
this.causeIndex = causeIndex;
}
@Override
public JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
! DiagnosticPosition preferedPos, DiagnosticSource preferredSource,
DiagnosticType preferredKind, JCDiagnostic d) {
JCDiagnostic cause = (JCDiagnostic)d.getArgs()[causeIndex];
DiagnosticPosition pos = d.getDiagnosticPosition();
if (pos == null) {
! pos = preferedPos;
}
return diags.create(preferredKind, preferredSource, pos,
"prob.found.req", cause);
}
}
--- 4641,4656 ----
this.causeIndex = causeIndex;
}
@Override
public JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
! DiagnosticPosition preferredPos, DiagnosticSource preferredSource,
DiagnosticType preferredKind, JCDiagnostic d) {
JCDiagnostic cause = (JCDiagnostic)d.getArgs()[causeIndex];
DiagnosticPosition pos = d.getDiagnosticPosition();
if (pos == null) {
! pos = preferredPos;
}
return diags.create(preferredKind, preferredSource, pos,
"prob.found.req", cause);
}
}
< prev index next >