src/share/classes/com/sun/tools/javac/code/Symbol.java
Print this page
*** 991,1006 ****
public boolean isExceptionParameter() {
return data == ElementKind.EXCEPTION_PARAMETER;
}
public Object getConstValue() {
// TODO: Consider if getConstValue and getConstantValue can be collapsed
! if (data == ElementKind.EXCEPTION_PARAMETER) {
return null;
} else if (data instanceof Callable<?>) {
! // In this case, this is final a variable, with an as
// yet unevaluated initializer.
Callable<?> eval = (Callable<?>)data;
data = null; // to make sure we don't evaluate this twice.
try {
data = eval.call();
--- 991,1011 ----
public boolean isExceptionParameter() {
return data == ElementKind.EXCEPTION_PARAMETER;
}
+ public boolean isResourceVariable() {
+ return data == ElementKind.RESOURCE_VARIABLE;
+ }
+
public Object getConstValue() {
// TODO: Consider if getConstValue and getConstantValue can be collapsed
! if (data == ElementKind.EXCEPTION_PARAMETER ||
! data == ElementKind.RESOURCE_VARIABLE) {
return null;
} else if (data instanceof Callable<?>) {
! // In this case, this is a final variable, with an as
// yet unevaluated initializer.
Callable<?> eval = (Callable<?>)data;
data = null; // to make sure we don't evaluate this twice.
try {
data = eval.call();