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 39285 Details for
Bug 133491
Missing code assist in annotation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better fix
patch004.txt (text/plain), 6.97 KB, created by
David Audel
on 2006-04-24 11:14:08 EDT
(
hide
)
Description:
Better fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-24 11:14:08 EDT
Size:
6.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.java,v >retrieving revision 1.3 >diff -u -r1.3 SourceAnnotationMethodInfo.java >--- model/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.java 29 Mar 2006 03:08:48 -0000 1.3 >+++ model/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.java 24 Apr 2006 14:56:14 -0000 >@@ -10,8 +10,6 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core; > >-import org.eclipse.jdt.core.compiler.CharOperation; >- > /* > * Element info for annotation method from source. > */ >@@ -22,16 +20,11 @@ > * These are {-1, -1} if the method is an annotation method with no default value. > * Otherwise these are the start and end (inclusive) of the expression representing the default value. > */ >- protected int defaultValueStart; >- protected int defaultValueEnd; >+ public int defaultValueStart; >+ public int defaultValueEnd; > > public boolean isAnnotationMethod() { > return true; > } > >- public char[] getDefaultValueSource(char[] cuSource) { >- if (this.defaultValueStart == -1 && this.defaultValueEnd == -1) >- return null; >- return CharOperation.subarray(cuSource, this.defaultValueStart, this.defaultValueEnd+1); >- } > } >Index: codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java,v >retrieving revision 1.127 >diff -u -r1.127 SelectionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 19 Apr 2006 13:33:37 -0000 1.127 >+++ codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 24 Apr 2006 14:56:13 -0000 >@@ -532,11 +532,6 @@ > public AssistParser getParser() { > return this.parser; > } >- >- protected int getSourceTypeConverterFlag() { >- return SourceTypeConverter.FIELD_AND_METHOD // need field and methods >- | SourceTypeConverter.MEMBER_TYPE; // need member types >- } > > /* > * Returns whether the given binding is a local/anonymous reference binding, or if its declaring class is >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.287 >diff -u -r1.287 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 21 Apr 2006 15:48:11 -0000 1.287 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 24 Apr 2006 14:56:12 -0000 >@@ -254,7 +254,6 @@ > Map settings, > IJavaProject javaProject) { > super(settings); >- this.compilerOptions.storeAnnotations = true; > this.javaProject = javaProject; > this.requestor = requestor; > this.nameEnvironment = nameEnvironment; >@@ -5873,12 +5872,6 @@ > > return this.parser; > } >- >- protected int getSourceTypeConverterFlag() { >- return SourceTypeConverter.FIELD_AND_METHOD // need field and methods >- | SourceTypeConverter.MEMBER_TYPE // need member types >- | SourceTypeConverter.FIELD_INITIALIZATION; // need field initializer for annotations default value >- } > > protected void reset() { > >@@ -6104,7 +6097,7 @@ > CharOperation.equals(methodBindings[0].selector, VALUE)) { > boolean canBeSingleMemberAnnotation = true; > done : for (int i = 1; i < methodBindings.length; i++) { >- if(methodBindings[i].getDefaultValue() == null) { >+ if((methodBindings[i].modifiers & ClassFileConstants.AccAnnotationDefault) == 0) { > canBeSingleMemberAnnotation = false; > break done; > } >Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java,v >retrieving revision 1.52 >diff -u -r1.52 Engine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 19 Apr 2006 13:33:37 -0000 1.52 >+++ codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 24 Apr 2006 14:56:13 -0000 >@@ -82,7 +82,9 @@ > CompilationUnitDeclaration unit = > SourceTypeConverter.buildCompilationUnit( > sourceTypes,//sourceTypes[0] is always toplevel here >- getSourceTypeConverterFlag(), >+ SourceTypeConverter.FIELD_AND_METHOD // need field and methods >+ | SourceTypeConverter.MEMBER_TYPE, // need member types >+ // no need for field initialization > lookupEnvironment.problemReporter, > result); > >@@ -94,8 +96,6 @@ > > public abstract AssistParser getParser(); > >- protected abstract int getSourceTypeConverterFlag(); >- > public void initializeImportCaches() { > ImportBinding[] importBindings = this.unitScope.imports; > int length = importBindings == null ? 0 : importBindings.length; >Index: model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java,v >retrieving revision 1.46 >diff -u -r1.46 SourceTypeConverter.java >--- model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java 11 Apr 2006 13:32:02 -0000 1.46 >+++ model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java 24 Apr 2006 14:56:14 -0000 >@@ -308,16 +308,19 @@ > AnnotationMethodDeclaration annotationMethodDeclaration = new AnnotationMethodDeclaration(compilationResult); > > /* conversion of default value */ >+ SourceAnnotationMethodInfo annotationMethodInfo = (SourceAnnotationMethodInfo) methodInfo; >+ boolean hasDefaultValue = annotationMethodInfo.defaultValueStart != -1 || annotationMethodInfo.defaultValueEnd != -1; > if ((this.flags & FIELD_INITIALIZATION) != 0) { >- char[] defaultValueSource = ((SourceAnnotationMethodInfo) methodInfo).getDefaultValueSource(getSource()); >- if (defaultValueSource != null) { >+ if (hasDefaultValue) { >+ char[] defaultValueSource = CharOperation.subarray(getSource(), annotationMethodInfo.defaultValueStart, annotationMethodInfo.defaultValueEnd+1); > Expression expression = parseMemberValue(defaultValueSource); > if (expression != null) { > annotationMethodDeclaration.defaultValue = expression; >- modifiers |= ClassFileConstants.AccAnnotationDefault; > } > } > } >+ if (hasDefaultValue) >+ modifiers |= ClassFileConstants.AccAnnotationDefault; > decl = annotationMethodDeclaration; > } else { > decl = new MethodDeclaration(compilationResult);
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 133491
:
38919
| 39285