Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 122006 Details for
Bug 214948
Incorrect deprecation warning on annotation instances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 5.44 KB, created by
Kent Johnson
on 2009-01-08 15:33:41 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-01-08 15:33:41 EST
Size:
5.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java,v >retrieving revision 1.84 >diff -u -r1.84 CompilationUnitDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 7 Jan 2009 17:34:23 -0000 1.84 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 8 Jan 2009 20:31:35 -0000 >@@ -493,10 +493,6 @@ > syntheticTypeDeclaration.javadoc = new Javadoc(syntheticTypeDeclaration.declarationSourceStart, syntheticTypeDeclaration.declarationSourceStart); > } > syntheticTypeDeclaration.resolve(this.scope); >- // resolve annotations if any, skip this step if we don't have a valid scope due to an earlier error. (bug 252555) >- if (this.currentPackage!= null && this.currentPackage.annotations != null && syntheticTypeDeclaration.staticInitializerScope != null) { >- resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.fPackage); >- } > /* > * resolve javadoc package if any, skip this step if we don't have a valid scope due to an earlier error (bug 252555) > * we do it now as the javadoc in the fake type won't be resolved. The peculiar usage of MethodScope to resolve the >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java,v >retrieving revision 1.48 >diff -u -r1.48 PackageBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 14 Nov 2008 20:28:34 -0000 1.48 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 8 Jan 2009 20:31:35 -0000 >@@ -205,6 +205,25 @@ > return null; > } > >+/** >+ * Compute the tagbits for standard annotations. For source types, these could require >+ * lazily resolving corresponding annotation nodes, in case of forward references. >+ * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits() >+ */ >+public long getAnnotationTagBits() { >+ if ((this.tagBits & TagBits.AnnotationResolved) != 0) >+ return this.tagBits; >+ >+ this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (this.compoundName == CharOperation.NO_CHAR_CHAR) >+ return this.tagBits; >+ >+ ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME); >+ if (packageInfo != null) >+ this.tagBits |= (packageInfo.getAnnotationTagBits() & TagBits.AllStandardAnnotationsMask); >+ return this.tagBits; >+} >+ > /* API > * Answer the receiver's binding type from Binding.BindingID. > */ >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java,v >retrieving revision 1.128 >diff -u -r1.128 ReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 5 Dec 2008 16:49:14 -0000 1.128 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 8 Jan 2009 20:31:36 -0000 >@@ -1175,7 +1175,7 @@ > */ > public final boolean isViewedAsDeprecated() { > return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0 >- || (getPackage().tagBits & TagBits.AnnotationDeprecated) != 0; >+ || (getPackage().getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0; > } > > public ReferenceBinding[] memberTypes() { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.346 >diff -u -r1.346 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 5 Dec 2008 12:41:29 -0000 1.346 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 8 Jan 2009 20:31:36 -0000 >@@ -2809,16 +2809,15 @@ > MethodBinding context = ((AbstractMethodDeclaration)methodScope.referenceContext).binding; > if (context != null && context.isViewedAsDeprecated()) > return true; >- } else { >- SourceTypeBinding type = ((BlockScope)this).referenceType().binding; >+ } else if (methodScope.initializedField != null && methodScope.initializedField.isViewedAsDeprecated()) { > // inside field declaration ? check field modifier to see if deprecated >- if (methodScope.initializedField != null && methodScope.initializedField.isViewedAsDeprecated()) >+ return true; >+ } >+ SourceTypeBinding declaringType = ((BlockScope)this).referenceType().binding; >+ if (declaringType != null) { >+ declaringType.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then >+ if (declaringType.isViewedAsDeprecated()) > return true; >- if (type != null) { >- type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then >- if (type.isViewedAsDeprecated()) >- return true; >- } > } > break; > case Scope.CLASS_SCOPE :
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 214948
:
86597
|
121836
|
121875
|
121950
|
122006
|
122065
|
122138
|
122149
|
122306