### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v retrieving revision 1.116 diff -u -r1.116 BinaryTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 3 Mar 2009 20:10:25 -0000 1.116 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 12 Mar 2009 18:02:55 -0000 @@ -50,13 +50,8 @@ if (binaryValue == null) return null; if (binaryValue instanceof Constant) return binaryValue; - if (binaryValue instanceof ClassSignature) { - TypeBinding typeFromSignature = env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null, missingTypeNames); - if (typeFromSignature.isBaseType()) { - return typeFromSignature; - } - return resolveType(typeFromSignature, env, false /* no raw conversion */); - } + if (binaryValue instanceof ClassSignature) + return env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null, missingTypeNames); if (binaryValue instanceof IBinaryAnnotation) return createAnnotation((IBinaryAnnotation) binaryValue, env, missingTypeNames); if (binaryValue instanceof EnumConstantSignature) { @@ -518,7 +513,8 @@ result.setAnnotations( createAnnotations(method.getAnnotations(), this.environment, missingTypeNames), paramAnnotations, - isAnnotationType() ? convertMemberValue(method.getDefaultValue(), this.environment, missingTypeNames) : null); + isAnnotationType() ? convertMemberValue(method.getDefaultValue(), this.environment, missingTypeNames) : null, + this.environment); if (use15specifics) result.tagBits |= method.getTagBits(); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.java,v retrieving revision 1.4 diff -u -r1.4 AnnotationHolder.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.java 27 Apr 2007 15:51:39 -0000 1.4 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.java 12 Mar 2009 18:02:49 -0000 @@ -13,7 +13,7 @@ public class AnnotationHolder { AnnotationBinding[] annotations; -static AnnotationHolder storeAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue) { +static AnnotationHolder storeAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { if (parameterAnnotations != null) { boolean isEmpty = true; for (int i = parameterAnnotations.length; isEmpty && --i >= 0;) @@ -24,7 +24,7 @@ } if (defaultValue != null) - return new AnnotationMethodHolder(annotations, parameterAnnotations, defaultValue); + return new AnnotationMethodHolder(annotations, parameterAnnotations, defaultValue, optionalEnv); if (parameterAnnotations != null) return new MethodHolder(annotations, parameterAnnotations); return new AnnotationHolder().setAnnotations(annotations); @@ -73,12 +73,19 @@ static class AnnotationMethodHolder extends MethodHolder { Object defaultValue; + LookupEnvironment env; -AnnotationMethodHolder(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue) { +AnnotationMethodHolder(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { super(annotations, parameterAnnotations); this.defaultValue = defaultValue; + this.env = optionalEnv; } Object getDefaultValue() { + if (this.defaultValue instanceof UnresolvedReferenceBinding) { + if (this.env == null) + throw new IllegalStateException(); + this.defaultValue = ((UnresolvedReferenceBinding) this.defaultValue).resolve(this.env, false); + } return this.defaultValue; } } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java,v retrieving revision 1.116 diff -u -r1.116 MethodBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 7 Mar 2009 00:59:02 -0000 1.116 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 12 Mar 2009 18:02:56 -0000 @@ -846,8 +846,8 @@ public void setAnnotations(AnnotationBinding[] annotations) { this.declaringClass.storeAnnotations(this, annotations); } -public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue) { - this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue)); +public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { + this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue, optionalEnv)); } public void setDefaultValue(Object defaultValue) { MethodBinding originalMethod = original(); @@ -855,16 +855,16 @@ AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) - setAnnotations(null, null, defaultValue); + setAnnotations(null, null, defaultValue, null); else - setAnnotations(holder.getAnnotations(), holder.getParameterAnnotations(), defaultValue); + setAnnotations(holder.getAnnotations(), holder.getParameterAnnotations(), defaultValue, null); } public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) { AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) - setAnnotations(null, parameterAnnotations, null); + setAnnotations(null, parameterAnnotations, null, null); else - setAnnotations(holder.getAnnotations(), parameterAnnotations, holder.getDefaultValue()); + setAnnotations(holder.getAnnotations(), parameterAnnotations, holder.getDefaultValue(), null); } protected final void setSelector(char[] selector) { this.selector = selector;