### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core 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.73 diff -u -r1.73 MethodBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 25 Jan 2006 15:29:58 -0000 1.73 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 26 Jan 2006 18:33:12 -0000 @@ -433,6 +433,21 @@ */ public Object getDefaultValue() { MethodBinding originalMethod = this.original(); + if ((originalMethod.tagBits & TagBits.DefaultValueResolved) == 0) { + //The method has not been yet type checked. + //It also means that the method is not coming from a class that + //has already been compiled. It can only be from a class within + //compilation units to process. Thus the method is NOT from a BinaryTypeBinbing + if (originalMethod.declaringClass instanceof SourceTypeBinding) { + SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; + if (sourceType.scope != null) { + TypeDeclaration typeDecl = sourceType.scope.referenceContext; + AbstractMethodDeclaration methodDeclaration = typeDecl.declarationOf(originalMethod); + methodDeclaration.resolve(typeDecl.scope); + } + } + originalMethod.tagBits |= TagBits.DefaultValueResolved; + } AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); return holder == null ? null : holder.getDefaultValue(); } @@ -631,6 +646,10 @@ this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue)); } public void setDefaultValue(Object defaultValue) { + MethodBinding originalMethod = this.original(); + if ((originalMethod.tagBits & TagBits.DefaultValueResolved) != 0) { + return; + } AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, null, defaultValue); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java,v retrieving revision 1.18 diff -u -r1.18 TagBits.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 26 May 2005 16:19:32 -0000 1.18 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 26 Jan 2006 18:33:12 -0000 @@ -95,4 +95,6 @@ long AnnotationInherited = ASTNode.Bit48L; long AnnotationOverride = ASTNode.Bit49L; long AnnotationSuppressWarnings = ASTNode.Bit50L; + + long DefaultValueResolved = ASTNode.Bit51L; }