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 38919 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]
Proposed fix
patch001.txt (text/plain), 4.97 KB, created by
David Audel
on 2006-04-19 07:23:36 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-19 07:23:36 EDT
Size:
4.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java,v >retrieving revision 1.51 >diff -u -r1.51 Engine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 28 Mar 2006 20:30:02 -0000 1.51 >+++ codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 18 Apr 2006 15:38:52 -0000 >@@ -47,6 +47,7 @@ > public Engine(Map settings){ > this.options = new AssistOptions(settings); > this.compilerOptions = new CompilerOptions(settings); >+ this.compilerOptions.storeAnnotations = true; > this.forbiddenReferenceIsError = > (this.compilerOptions.getSeverity(CompilerOptions.ForbiddenReference) & ProblemSeverities.Error) != 0; > this.discouragedReferenceIsError = >@@ -82,8 +83,9 @@ > CompilationUnitDeclaration unit = > SourceTypeConverter.buildCompilationUnit( > sourceTypes,//sourceTypes[0] is always toplevel here >- SourceTypeConverter.FIELD_AND_METHOD // need field and methods >- | SourceTypeConverter.MEMBER_TYPE, // need member types >+ SourceTypeConverter.FIELD_AND_METHOD// need field and methods >+ | SourceTypeConverter.MEMBER_TYPE // need member types >+ | SourceTypeConverter.FIELD_INITIALIZATION, > // no need for field initialization > lookupEnvironment.problemReporter, > result); >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.285 >diff -u -r1.285 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 14 Apr 2006 08:34:05 -0000 1.285 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 18 Apr 2006 15:38:52 -0000 >@@ -111,6 +111,7 @@ > boolean assistNodeIsAnnotation; > boolean assistNodeIsConstructor; > int assistNodeInJavadoc = 0; >+ boolean assistNodeCanBeSingleMemberAnnotation = false; > > IJavaProject javaProject; > CompletionParser parser; >@@ -1203,31 +1204,22 @@ > findAnnotationReference(annotation.type, scope); > } > } else { >- MemberValuePair[] memberValuePairs = annotation.memberValuePairs(); > if (!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) { > this.findAnnotationAttributes(this.completionToken, annotation.memberValuePairs(), (ReferenceBinding)annotation.resolvedType); > } >- if (memberValuePairs == null || memberValuePairs.length == 0) { >- if (annotation.resolvedType instanceof ReferenceBinding) { >- MethodBinding[] methodBindings = >- ((ReferenceBinding)annotation.resolvedType).availableMethods(); >- if (methodBindings != null && >- methodBindings.length == 1 && >- CharOperation.equals(methodBindings[0].selector, VALUE)) { >- if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) { >- findTypesAndPackages(this.completionToken, scope); >- } else { >- findVariablesAndMethods( >- this.completionToken, >- scope, >- FakeInvocationSite, >- scope, >- insideTypeAnnotation, >- true); >- // can be the start of a qualified type name >- findTypesAndPackages(this.completionToken, scope); >- } >- } >+ if (this.assistNodeCanBeSingleMemberAnnotation) { >+ if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) { >+ findTypesAndPackages(this.completionToken, scope); >+ } else { >+ findVariablesAndMethods( >+ this.completionToken, >+ scope, >+ FakeInvocationSite, >+ scope, >+ insideTypeAnnotation, >+ true); >+ // can be the start of a qualified type name >+ findTypesAndPackages(this.completionToken, scope); > } > } > } >@@ -6100,10 +6092,20 @@ > if(annotation.resolvedType instanceof ReferenceBinding) { > MethodBinding[] methodBindings = > ((ReferenceBinding)annotation.resolvedType).availableMethods(); >- if(methodBindings != null && >- methodBindings.length == 1 && >+ if (methodBindings != null && >+ methodBindings.length > 0 && > CharOperation.equals(methodBindings[0].selector, VALUE)) { >- addExpectedType(methodBindings[0].returnType, scope); >+ boolean canBeSingleMemberAnnotation = true; >+ done : for (int i = 1; i < methodBindings.length; i++) { >+ if(methodBindings[i].getDefaultValue() == null) { >+ canBeSingleMemberAnnotation = false; >+ break done; >+ } >+ } >+ if (canBeSingleMemberAnnotation) { >+ this.assistNodeCanBeSingleMemberAnnotation = canBeSingleMemberAnnotation; >+ addExpectedType(methodBindings[0].returnType, 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 133491
:
38919
|
39285