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 68541 Details for
Bug 188247
[content assist] Code Completion for static importing fields not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix for 1 + update of regression tests
bug188247_002.txt (text/plain), 8.79 KB, created by
David Audel
on 2007-05-24 06:58:24 EDT
(
hide
)
Description:
Fix for 1 + update of regression tests
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-05-24 06:58:24 EDT
Size:
8.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v >retrieving revision 1.84 >diff -u -r1.84 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 26 Apr 2007 11:27:42 -0000 1.84 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 24 May 2007 10:55:35 -0000 >@@ -1997,7 +1997,7 @@ > " public static void ZZZ2(int i) {}\n"+ > "}"); > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true); > ICompilationUnit cu= getCompilationUnit("Completion", "src3", "test0072", "Test.java"); > > String str = cu.getSource(); >@@ -2005,10 +2005,16 @@ > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); > cu.codeComplete(cursorLocation, requestor, this.wcOwner); > >+ int end1 = cursorLocation; >+ int start1 = end1 - "ZZ".length(); >+ >+ int end2 = cursorLocation; >+ int start2 = end2 - "test0072.p.ImportedClass.ZZ".length(); >+ > assertResults( >- "ZZZ1[FIELD_REF]{test0072.p.ImportedClass.ZZZ1;, Ltest0072.p.ImportedClass;, I, ZZZ1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0072.p.ImportedClass.ZZZ2;, Ltest0072.p.ImportedClass;, ()V, ZZZ2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0072.p.ImportedClass.ZZZ2;, Ltest0072.p.ImportedClass;, (I)V, ZZZ2, (i), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ "ZZZ1[FIELD_REF]{ZZZ1;, Ltest0072.p.ImportedClass;, I, ZZZ1, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0072.p.ImportedClass.ZZZ2;, Ltest0072.p.ImportedClass;, ()V, ZZZ2, null, ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0072.p.ImportedClass.ZZZ2;, Ltest0072.p.ImportedClass;, (I)V, ZZZ2, (i), ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } finally { > if(importedClass != null) { >@@ -2034,7 +2040,7 @@ > " }\n"+ > "}"); > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true); > ICompilationUnit cu= getCompilationUnit("Completion", "src3", "test0073", "Test.java"); > > String str = cu.getSource(); >@@ -2042,10 +2048,16 @@ > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); > cu.codeComplete(cursorLocation, requestor, this.wcOwner); > >+ int end1 = cursorLocation; >+ int start1 = end1 - "ZZ".length(); >+ >+ int end2 = cursorLocation; >+ int start2 = end2 - "test0073.p.ImportedClass.Inner.ZZ".length(); >+ > assertResults( >- "ZZZ1[FIELD_REF]{test0073.p.ImportedClass.Inner.ZZZ1;, Ltest0073.p.ImportedClass$Inner;, I, ZZZ1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0073.p.ImportedClass.Inner.ZZZ2;, Ltest0073.p.ImportedClass$Inner;, ()V, ZZZ2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0073.p.ImportedClass.Inner.ZZZ2;, Ltest0073.p.ImportedClass$Inner;, (I)V, ZZZ2, (i), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ "ZZZ1[FIELD_REF]{ZZZ1;, Ltest0073.p.ImportedClass$Inner;, I, ZZZ1, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0073.p.ImportedClass.Inner.ZZZ2;, Ltest0073.p.ImportedClass$Inner;, ()V, ZZZ2, null, ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0073.p.ImportedClass.Inner.ZZZ2;, Ltest0073.p.ImportedClass$Inner;, (I)V, ZZZ2, (i), ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } finally { > if(importedClass != null) { >@@ -2071,7 +2083,7 @@ > " }\n"+ > "}"); > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true); > ICompilationUnit cu= getCompilationUnit("Completion", "src3", "test0074", "Test.java"); > > String str = cu.getSource(); >@@ -2079,10 +2091,16 @@ > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); > cu.codeComplete(cursorLocation, requestor, this.wcOwner); > >+ int end1 = cursorLocation; >+ int start1 = end1 - "ZZ".length(); >+ >+ int end2 = cursorLocation; >+ int start2 = end2 - "test0074.p.ImportedClass.Inner.ZZ".length(); >+ > assertResults( >- "ZZZ1[FIELD_REF]{test0074.p.ImportedClass.Inner.ZZZ1;, Ltest0074.p.ImportedClass$Inner;, I, ZZZ1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0074.p.ImportedClass.Inner.ZZZ2;, Ltest0074.p.ImportedClass$Inner;, ()V, ZZZ2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >- "ZZZ2[METHOD_IMPORT]{test0074.p.ImportedClass.Inner.ZZZ2;, Ltest0074.p.ImportedClass$Inner;, (I)V, ZZZ2, (i), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ "ZZZ1[FIELD_REF]{ZZZ1;, Ltest0074.p.ImportedClass$Inner;, I, ZZZ1, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0074.p.ImportedClass.Inner.ZZZ2;, Ltest0074.p.ImportedClass$Inner;, ()V, ZZZ2, null, ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "ZZZ2[METHOD_IMPORT]{test0074.p.ImportedClass.Inner.ZZZ2;, Ltest0074.p.ImportedClass$Inner;, (I)V, ZZZ2, (i), ["+start2+", "+end2+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } finally { > if(importedClass != null) { >@@ -7373,10 +7391,10 @@ > result.context); > > int end = result.cursorLocation; >- int start = end - "test0223.AType.va".length(); >+ int start = end - "va".length(); > > assertResults( >- "VAR[FIELD_REF]{test0223.AType.VAR;, Ltest0223.AType;, I, VAR, null, ["+start+", "+end+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}", >+ "VAR[FIELD_REF]{VAR;, Ltest0223.AType;, I, VAR, null, ["+start+", "+end+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}", > result.proposals); > } finally { > if(paramClass1 != null) { >#P org.eclipse.jdt.core >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.328 >diff -u -r1.328 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 14 May 2007 17:04:00 -0000 1.328 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 24 May 2007 10:55:39 -0000 >@@ -2028,9 +2028,16 @@ > } > if(importReference.isStatic()) { > if(!this.requestor.isIgnored(CompletionProposal.FIELD_REF)) { >+ long positions = importReference.sourcePositions[importReference.sourcePositions.length - 1]; >+ setSourceRange((int) (positions >>> 32), (int) positions); >+ > this.findImportsOfStaticFields(lastToken, ref); > } > if(!this.requestor.isIgnored(CompletionProposal.METHOD_NAME_REFERENCE)) { >+ setSourceRange( >+ importReference.sourceStart, >+ importReference.declarationSourceEnd); >+ > this.findImportsOfStaticMethods(lastToken, ref); > } > } >@@ -3939,12 +3946,8 @@ > && !field.canBeSeenBy(this.unitScope.fPackage)) > continue next; > >- char[] completionName = CharOperation.concat( >- field.declaringClass.qualifiedPackageName(), >- '.', >- field.declaringClass.qualifiedSourceName(), >- '.', >- field.name); >+ char[] completionName = field.name; >+ > > completionName = CharOperation.concat(completionName, SEMICOLON); >
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 188247
:
68526
|
68527
|
68541
|
68565