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 164120 Details for
Bug 307486
DBCS3.6: Fail to propose Ext-B labels with content assist in Java Editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_307486.txt (text/plain), 4.79 KB, created by
Olivier Thomann
on 2010-04-07 15:43:00 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-04-07 15:43:00 EDT
Size:
4.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java,v >retrieving revision 1.70 >diff -u -r1.70 CompletionScanner.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 6 Oct 2009 01:00:37 -0000 1.70 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 7 Apr 2010 19:40:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -21,6 +21,7 @@ > * n means completion behind the n-th character > */ > import org.eclipse.jdt.core.compiler.*; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.parser.Scanner; > import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; > >@@ -791,7 +792,39 @@ > throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$ > > default : >- if (ScannerHelper.isJavaIdentifierStart(this.currentCharacter)) >+ char c = this.currentCharacter; >+ if (c < ScannerHelper.MAX_OBVIOUS) { >+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_IDENT_START) != 0) { >+ return scanIdentifierOrKeyword(); >+ } else if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_DIGIT) != 0) { >+ return scanNumber(false); >+ } else { >+ return TokenNameERROR; >+ } >+ } >+ boolean isJavaIdStart; >+ if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) { >+ if (this.complianceLevel < ClassFileConstants.JDK1_5) { >+ throw new InvalidInputException(INVALID_UNICODE_ESCAPE); >+ } >+ // Unicode 4 detection >+ char low = (char) getNextChar(); >+ if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) { >+ // illegal low surrogate >+ throw new InvalidInputException(INVALID_LOW_SURROGATE); >+ } >+ isJavaIdStart = ScannerHelper.isJavaIdentifierStart(c, low); >+ } >+ else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) { >+ if (this.complianceLevel < ClassFileConstants.JDK1_5) { >+ throw new InvalidInputException(INVALID_UNICODE_ESCAPE); >+ } >+ throw new InvalidInputException(INVALID_HIGH_SURROGATE); >+ } else { >+ // optimized case already checked >+ isJavaIdStart = Character.isJavaIdentifierStart(c); >+ } >+ if (isJavaIdStart) > return scanIdentifierOrKeyword(); > if (ScannerHelper.isDigit(this.currentCharacter)) { > return scanNumber(false); >#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.118 >diff -u -r1.118 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 9 Jul 2009 10:47:24 -0000 1.118 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 7 Apr 2010 19:40:16 -0000 >@@ -13790,5 +13790,29 @@ > (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=307486 >+public void testLabel7() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/label/Test.java", >+ "package label;"+ >+ "public class Test {\n" + >+ " void foo() {\n" + >+ " \ud842\udf9fabc :\n" + >+ " while (true) {\n" + >+ " break \ud842\udf9fabc;\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"); > >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "break"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() + 1; >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "\ud842\udf9fabc[LABEL_REF]{\ud842\udf9fabc, null, null, \ud842\udf9fabc, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > }
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 307486
:
163374
| 164120