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 33661 Details for
Bug 124388
[DOM AST] Method defaults not resolved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch_for_124388.txt (text/plain), 2.86 KB, created by
Olivier Thomann
on 2006-01-26 13:36:27 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-01-26 13:36:27 EST
Size:
2.86 KB
patch
obsolete
>### 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; > }
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 124388
:
33235
| 33661 |
33662