991 |
991 |
992 public boolean isExceptionParameter() { |
992 public boolean isExceptionParameter() { |
993 return data == ElementKind.EXCEPTION_PARAMETER; |
993 return data == ElementKind.EXCEPTION_PARAMETER; |
994 } |
994 } |
995 |
995 |
|
996 public boolean isResourceVariable() { |
|
997 return data == ElementKind.RESOURCE_VARIABLE; |
|
998 } |
|
999 |
996 public Object getConstValue() { |
1000 public Object getConstValue() { |
997 // TODO: Consider if getConstValue and getConstantValue can be collapsed |
1001 // TODO: Consider if getConstValue and getConstantValue can be collapsed |
998 if (data == ElementKind.EXCEPTION_PARAMETER) { |
1002 if (data == ElementKind.EXCEPTION_PARAMETER || |
|
1003 data == ElementKind.RESOURCE_VARIABLE) { |
999 return null; |
1004 return null; |
1000 } else if (data instanceof Callable<?>) { |
1005 } else if (data instanceof Callable<?>) { |
1001 // In this case, this is final a variable, with an as |
1006 // In this case, this is a final variable, with an as |
1002 // yet unevaluated initializer. |
1007 // yet unevaluated initializer. |
1003 Callable<?> eval = (Callable<?>)data; |
1008 Callable<?> eval = (Callable<?>)data; |
1004 data = null; // to make sure we don't evaluate this twice. |
1009 data = null; // to make sure we don't evaluate this twice. |
1005 try { |
1010 try { |
1006 data = eval.call(); |
1011 data = eval.call(); |