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 202994 Details for
Bug 356746
ECJ accepts illegal unicode escape sequences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_356746.txt (text/plain), 22.32 KB, created by
Olivier Thomann
on 2011-09-08 10:19:44 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-09-08 10:19:44 EDT
Size:
22.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.160 >diff -u -r1.160 SelectionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 1 Sep 2011 18:42:40 -0000 1.160 >+++ codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 8 Sep 2011 13:41:26 -0000 >@@ -531,13 +531,13 @@ > } > } > >- if ((c1 = ScannerHelper.getNumericValue(source[pos++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(source[pos++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(source[pos++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(source[pos++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(source[pos++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(source[pos++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(source[pos++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(source[pos++])) > 15 > || c4 < 0) { > return false; > } else { >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.73 >diff -u -r1.73 CompletionScanner.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 28 Jul 2011 17:07:25 -0000 1.73 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 8 Sep 2011 13:41:26 -0000 >@@ -552,13 +552,13 @@ > while (this.source[this.currentPosition] == 'u') { > this.currentPosition++; > } >- if ((c1 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c4 < 0) { > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } else { >@@ -585,13 +585,13 @@ > while (this.source[this.currentPosition] == 'u') { > this.currentPosition++; > } >- if ((c1 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c4 < 0) { > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } else { >@@ -623,13 +623,13 @@ > } > //-------------unicode traitement ------------ > int c1 = 0, c2 = 0, c3 = 0, c4 = 0; >- if ((c1 = ScannerHelper.getNumericValue(this.source[index++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(this.source[index++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(this.source[index++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(this.source[index++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(this.source[index++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(this.source[index++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(this.source[index++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(this.source[index++])) > 15 > || c4 < 0) { > this.currentPosition = index; > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); >Index: compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java,v >retrieving revision 1.96 >diff -u -r1.96 AbstractCommentParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 14 Apr 2011 17:44:27 -0000 1.96 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 8 Sep 2011 13:41:26 -0000 >@@ -1354,9 +1354,10 @@ > idx++; > while (this.source[idx] == 'u') > idx++; >- if (!(((c1 = ScannerHelper.getNumericValue(this.source[idx++])) > 15 || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(this.source[idx++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(this.source[idx++])) > 15 || c3 < 0) || ((c4 = ScannerHelper.getNumericValue(this.source[idx++])) > 15 || c4 < 0))) { >+ if (!(((c1 = ScannerHelper.getHexadecimalValue(this.source[idx++])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(this.source[idx++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(this.source[idx++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(this.source[idx++])) > 15 || c4 < 0))) { > c = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); > } > } >@@ -1473,9 +1474,10 @@ > this.index++; > while (this.source[this.index] == 'u') > this.index++; >- if (!(((c1 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c3 < 0) || ((c4 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c4 < 0))) { >+ if (!(((c1 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c4 < 0))) { > c = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); > } else { > // TODO (frederic) currently reset to previous position, perhaps signal a syntax error would be more appropriate >Index: compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java,v >retrieving revision 1.81 >diff -u -r1.81 JavadocParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 28 Feb 2011 08:55:13 -0000 1.81 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 8 Sep 2011 13:41:26 -0000 >@@ -385,9 +385,10 @@ > this.index++; > while (this.source[this.index] == 'u') > this.index++; >- if (!(((c1 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c3 < 0) || ((c4 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c4 < 0))) { >+ if (!(((c1 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c4 < 0))) { > first = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); > } else { > this.index = pos; >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.429 >diff -u -r1.429 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 2 Aug 2011 11:09:52 -0000 1.429 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 8 Sep 2011 13:41:27 -0000 >@@ -2993,13 +2993,13 @@ > pos--; > } > if (source[pos] == '\\' && >- !((c1 = ScannerHelper.getNumericValue(source[this.endStatementPosition - 3])) > 15 >+ !((c1 = ScannerHelper.getHexadecimalValue(source[this.endStatementPosition - 3])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(source[this.endStatementPosition - 2])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(source[this.endStatementPosition - 2])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(source[this.endStatementPosition - 1])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(source[this.endStatementPosition - 1])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(source[this.endStatementPosition])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(source[this.endStatementPosition])) > 15 > || c4 < 0) && > ((char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4)) == ';'){ > // we have a Unicode for the ';' (/u003B) >@@ -8852,11 +8852,11 @@ > int c1, c2, c3, c4; > index[0]++; > while (comment[index[0]] == 'u') index[0]++; >- if (!(((c1 = ScannerHelper.getNumericValue(comment[index[0]++])) > 15 >+ if (!(((c1 = ScannerHelper.getHexadecimalValue(comment[index[0]++])) > 15 > || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(comment[index[0]++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(comment[index[0]++])) > 15 || c3 < 0) >- || ((c4 = ScannerHelper.getNumericValue(comment[index[0]++])) > 15 || c4 < 0))) { >+ || ((c2 = ScannerHelper.getHexadecimalValue(comment[index[0]++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(comment[index[0]++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(comment[index[0]++])) > 15 || c4 < 0))) { > nextCharacter = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); > } > break; >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java,v >retrieving revision 1.205 >diff -u -r1.205 Scanner.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 28 Jul 2011 17:07:15 -0000 1.205 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 8 Sep 2011 13:41:27 -0000 >@@ -1819,13 +1819,13 @@ > this.currentPosition += (this.eofPosition - this.currentPosition); > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } >- if ((c1 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c4 < 0){ > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } >@@ -2725,18 +2725,18 @@ > // OctalDigit OctalDigit > // ZeroToThree OctalDigit OctalDigit > >- int number = ScannerHelper.getNumericValue(this.currentCharacter); >+ int number = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (number >= 0 && number <= 7) { > boolean zeroToThreeNot = number > 3; > if (ScannerHelper.isDigit(this.currentCharacter = this.source[this.currentPosition++])) { >- int digit = ScannerHelper.getNumericValue(this.currentCharacter); >+ int digit = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (digit >= 0 && digit <= 7) { > number = (number * 8) + digit; > if (ScannerHelper.isDigit(this.currentCharacter = this.source[this.currentPosition++])) { > if (zeroToThreeNot) {// has read \NotZeroToThree OctalDigit Digit --> ignore last character > this.currentPosition--; > } else { >- digit = ScannerHelper.getNumericValue(this.currentCharacter); >+ digit = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (digit >= 0 && digit <= 7){ // has read \ZeroToThree OctalDigit OctalDigit > number = (number * 8) + digit; > } else {// has read \ZeroToThree OctalDigit NonOctalDigit --> ignore last character >Index: compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java,v >retrieving revision 1.23 >diff -u -r1.23 ScannerHelper.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java 28 Jul 2011 17:07:17 -0000 1.23 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java 8 Sep 2011 13:41:27 -0000 >@@ -475,6 +475,50 @@ > } > return Character.getNumericValue(c); > } >+public static int getHexadecimalValue(char c) { >+ switch(c) { >+ case '0' : >+ return 0; >+ case '1' : >+ return 1; >+ case '2' : >+ return 2; >+ case '3' : >+ return 3; >+ case '4' : >+ return 4; >+ case '5' : >+ return 5; >+ case '6' : >+ return 6; >+ case '7' : >+ return 7; >+ case '8' : >+ return 8; >+ case '9' : >+ return 9; >+ case 'A' : >+ case 'a' : >+ return 10; >+ case 'B' : >+ case 'b' : >+ return 11; >+ case 'C' : >+ case 'c' : >+ return 12; >+ case 'D' : >+ case 'd' : >+ return 13; >+ case 'E' : >+ case 'e' : >+ return 14; >+ case 'F' : >+ case 'f' : >+ return 15; >+ default: >+ return -1; >+ } >+} > public static char toUpperCase(char c) { > if (c < MAX_OBVIOUS) { > if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_UPPER_LETTER) != 0) { >Index: model/org/eclipse/jdt/internal/compiler/SourceJavadocParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceJavadocParser.java,v >retrieving revision 1.14 >diff -u -r1.14 SourceJavadocParser.java >--- model/org/eclipse/jdt/internal/compiler/SourceJavadocParser.java 7 Mar 2009 01:08:11 -0000 1.14 >+++ model/org/eclipse/jdt/internal/compiler/SourceJavadocParser.java 8 Sep 2011 13:41:27 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 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 >@@ -93,10 +93,10 @@ > this.index++; > while (this.source[this.index] == 'u') > this.index++; >- if (!(((c1 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c3 < 0) >- || ((c4 = ScannerHelper.getNumericValue(this.source[this.index++])) > 15 || c4 < 0))) { >+ if (!(((c1 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(this.source[this.index++])) > 15 || c4 < 0))) { > first = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); > } else { > this.index = pos; >Index: model/org/eclipse/jdt/internal/core/util/PublicScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java,v >retrieving revision 1.115 >diff -u -r1.115 PublicScanner.java >--- model/org/eclipse/jdt/internal/core/util/PublicScanner.java 28 Jul 2011 17:07:08 -0000 1.115 >+++ model/org/eclipse/jdt/internal/core/util/PublicScanner.java 8 Sep 2011 13:41:27 -0000 >@@ -1817,13 +1817,13 @@ > this.currentPosition += (this.eofPosition - this.currentPosition); > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } >- if ((c1 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ if ((c1 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c1 < 0 >- || (c2 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c2 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c2 < 0 >- || (c3 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c3 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c3 < 0 >- || (c4 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15 >+ || (c4 = ScannerHelper.getHexadecimalValue(this.source[this.currentPosition++])) > 15 > || c4 < 0){ > throw new InvalidInputException(INVALID_UNICODE_ESCAPE); > } >@@ -2723,18 +2723,18 @@ > // OctalDigit OctalDigit > // ZeroToThree OctalDigit OctalDigit > >- int number = ScannerHelper.getNumericValue(this.currentCharacter); >+ int number = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (number >= 0 && number <= 7) { > boolean zeroToThreeNot = number > 3; > if (ScannerHelper.isDigit(this.currentCharacter = this.source[this.currentPosition++])) { >- int digit = ScannerHelper.getNumericValue(this.currentCharacter); >+ int digit = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (digit >= 0 && digit <= 7) { > number = (number * 8) + digit; > if (ScannerHelper.isDigit(this.currentCharacter = this.source[this.currentPosition++])) { > if (zeroToThreeNot) {// has read \NotZeroToThree OctalDigit Digit --> ignore last character > this.currentPosition--; > } else { >- digit = ScannerHelper.getNumericValue(this.currentCharacter); >+ digit = ScannerHelper.getHexadecimalValue(this.currentCharacter); > if (digit >= 0 && digit <= 7){ // has read \ZeroToThree OctalDigit OctalDigit > number = (number * 8) + digit; > } else {// has read \ZeroToThree OctalDigit NonOctalDigit --> ignore last character >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.89 >diff -u -r1.89 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 11 Feb 2011 14:55:06 -0000 1.89 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 8 Sep 2011 13:41:27 -0000 >@@ -275,11 +275,10 @@ > int c1, c2, c3, c4; > charLength++; > while (source[idx+charLength] == 'u') charLength++; >- if (((c1 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 >- || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c3 < 0) >- || ((c4 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c4 < 0)) { >+ if (((c1 = ScannerHelper.getHexadecimalValue(source[idx+charLength++])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(source[idx+charLength++])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(source[idx+charLength++])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(source[idx+charLength++])) > 15 || c4 < 0)) { > return ch; > } > ch = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4); >@@ -474,11 +473,10 @@ > int c1, c2, c3, c4; > unicodeSource[u++] = source[i]; > unicodeSource[u++] = source[++i]; >- if (((c1 = ScannerHelper.getNumericValue(source[i+1])) > 15 >- || c1 < 0) >- || ((c2 = ScannerHelper.getNumericValue(source[i+2])) > 15 || c2 < 0) >- || ((c3 = ScannerHelper.getNumericValue(source[i+3])) > 15 || c3 < 0) >- || ((c4 = ScannerHelper.getNumericValue(source[i+4])) > 15 || c4 < 0)) { >+ if (((c1 = ScannerHelper.getHexadecimalValue(source[i+1])) > 15 || c1 < 0) >+ || ((c2 = ScannerHelper.getHexadecimalValue(source[i+2])) > 15 || c2 < 0) >+ || ((c3 = ScannerHelper.getHexadecimalValue(source[i+3])) > 15 || c3 < 0) >+ || ((c4 = ScannerHelper.getHexadecimalValue(source[i+4])) > 15 || c4 < 0)) { > throw new RuntimeException("Invalid unicode in source at "+i); > } > for (int j=0; j<4; j++) unicodeSource[u++] = source[++i];
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 356746
:
202771
|
202780
| 202994