Skip to content

Commit 1020101

Browse files
datho7561mickaelistria
authored andcommitted
Fix source range for array types when the [ is unicode escape
eg. `MyType\u005b] myTypeArray = null;` Fixes 4 tests: `ASTConverterTest.test0266` and the versions for other Java compliances Signed-off-by: David Thompson <[email protected]>
1 parent 809c91d commit 1020101

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,6 +3040,9 @@ Type convertToType(JCTree javac) {
30403040
String raw = this.rawText.substring(startPos, endPos);
30413041
int ordinalEnd = ordinalIndexOf(raw, "]", dims);
30423042
int ordinalStart = ordinalIndexOf(raw, "[", dims);
3043+
if (ordinalStart == -1) {
3044+
ordinalStart = ordinalIndexOf(raw, "\\u005b", dims);
3045+
}
30433046
if( ordinalEnd != -1 ) {
30443047
commonSettings(res, jcArrayType, ordinalEnd + 1, true);
30453048
if( this.ast.apiLevel >= AST.JLS8_INTERNAL ) {

0 commit comments

Comments
 (0)