diff options
author | Stephan Herrmann | 2011-02-15 08:26:54 +0000 |
---|---|---|
committer | Stephan Herrmann | 2011-02-15 08:26:54 +0000 |
commit | 05604ed06bc98028ff83a1a26b781f506b56cc71 (patch) | |
tree | 7fc7ed7dd5f962b2fcca77d8c27df70babf18c16 | |
parent | 88cbb6a45551c3c16e74d334d3d5bb3dba366d3a (diff) | |
download | org.eclipse.objectteams-05604ed06bc98028ff83a1a26b781f506b56cc71.tar.gz org.eclipse.objectteams-05604ed06bc98028ff83a1a26b781f506b56cc71.tar.xz org.eclipse.objectteams-05604ed06bc98028ff83a1a26b781f506b56cc71.zip |
Backported fix for Bug 330304 - [compiler] AIOOBE in Scanner.internalScanIdentifierOrKeyword()
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java | 18 | ||||
-rw-r--r-- | org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java | 15 |
2 files changed, 20 insertions, 13 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java index ad9789bd6..4a62a5ffd 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.compiler.util.Util; * Added keywords: base tsuper callin within playedBy precedence readonly with team as when * * Contextual keywords: replace after before get set - * These are recoknized as keywords only after the corresponding symbol <- or ->. + * These are recognized as keywords only after the corresponding symbol <- or ->. * * IMPORTANT NOTE: Internal Scanner implementation. It is mirrored in * org.eclipse.jdt.core.compiler public package where it is API. @@ -3442,7 +3442,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) switch (data[index]) { case 'a' : switch(length) { -//{ObjectTeams +//{ObjectTeams: keyword 'as': case 2: //as if ( this._isOTSource && (data[++index] == 's')) { @@ -4082,18 +4082,22 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) else return TokenNameIdentifier; case 6 : +//{ObjectTeams: check for tsuper keyword +/* orig: if ((data[++index] == 'h') && (data[++index] == 'r') + :giro */ + if ((data[++index] == 'h')) { + if ((data[++index] == 'r') +// orig: && (data[++index] == 'o') && (data[++index] == 'w') && (data[++index] == 's')) return TokenNamethrows; else -//{ObjectTeams: check for tsuper keyword -/* @original return TokenNameIdentifier; - */ - { +// :giro + } else { if ( this._isOTSource && (data[index] == 's') && (data[++index] == 'u') @@ -4103,7 +4107,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) return TokenNametsuper; else return TokenNameIdentifier; - } + } //Markus Witte} case 9 : if ((data[++index] == 'r') diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java index 4b0f939a6..c75f888ec 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java @@ -3407,7 +3407,6 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) default : return TokenNameIdentifier; } - case 'l' : //long if (length == 4) { if ((data[++index] == 'o') @@ -3668,18 +3667,22 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) else return TokenNameIdentifier; case 6 : +//{ObjectTeams: check for tsuper keyword +/* orig: if ((data[++index] == 'h') && (data[++index] == 'r') + :giro */ + if ((data[++index] == 'h')) { + if ((data[++index] == 'r') +// orig: && (data[++index] == 'o') && (data[++index] == 'w') && (data[++index] == 's')) return TokenNamethrows; else -//{ObjectTeams: check for tsuper keyword -/* @original return TokenNameIdentifier; - */ - { +// :giro + } else { if ( this._isOTSource && (data[index] == 's') && (data[++index] == 'u') @@ -3689,7 +3692,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data) return TokenNametsuper; else return TokenNameIdentifier; - } + } //Markus Witte} case 9 : if ((data[++index] == 'r') |