private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private int consumeInvalidToken(int end) { this.scanner.resetTo(this.scanner.startPosition, end); // In case of invalid unicode character, consume the current backslash character before continuing // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=233228 if (this.scanner.currentCharacter == '\\') { this.scanner.currentPosition = this.scanner.startPosition+1; } int previousPosition = this.scanner.currentPosition; char ch = (char) this.scanner.getNextChar(); if (this.scanner.atEnd()) { // avoid infinite loop return INVALID_TOKEN; } while (!this.scanner.atEnd() && ch != '*' && !ScannerHelper.isWhitespace(ch)) { previousPosition = this.scanner.currentPosition; ch = (char) this.scanner.getNextChar(); } // restore last whitespace this.scanner.currentPosition = previousPosition; return INVALID_TOKEN; }
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private int consumeInvalidToken(int end) { this.scanner.resetTo(this.scanner.startPosition, end); // In case of invalid unicode character, consume the current backslash character before continuing // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=233228 if (this.scanner.currentCharacter == '\\') { this.scanner.currentPosition = this.scanner.startPosition+1; } int previousPosition = this.scanner.currentPosition; char ch = (char) this.scanner.getNextChar(); if (this.scanner.atEnd()) { // avoid infinite loop return INVALID_TOKEN; } while (!this.scanner.atEnd() && ch != '*' && !ScannerHelper.isWhitespace(ch)) { previousPosition = this.scanner.currentPosition; ch = (char) this.scanner.getNextChar(); } // restore last whitespace this.scanner.currentPosition = previousPosition; return INVALID_TOKEN; }
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
protected boolean isValidPackageNameForClassOrisModule(String className) { if (className.substring(0, className.length() - (SuffixConstants.SUFFIX_CLASS.length)).equals(new String(IIndexConstants.MODULE_INFO))) return true; char[] classNameArray = className.toCharArray(); // use 1.7 as the source level as there are more valid identifiers in 1.7 mode // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673 if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (isIdentifier()) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (!isIdentifier()) return false; } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } }
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private int consumeInvalidToken(int end) { this.scanner.resetTo(this.scanner.startPosition, end); // In case of invalid unicode character, consume the current backslash character before continuing // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=233228 if (this.scanner.currentCharacter == '\\') { this.scanner.currentPosition = this.scanner.startPosition+1; } int previousPosition = this.scanner.currentPosition; char ch = (char) this.scanner.getNextChar(); if (this.scanner.atEnd()) { // avoid infinite loop return INVALID_TOKEN; } while (!this.scanner.atEnd() && ch != '*' && !ScannerHelper.isWhitespace(ch)) { previousPosition = this.scanner.currentPosition; ch = (char) this.scanner.getNextChar(); } // restore last whitespace this.scanner.currentPosition = previousPosition; return INVALID_TOKEN; }
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
protected boolean isValidPackageNameForClassOrisModule(String className) { if (className.substring(0, className.length() - (SuffixConstants.SUFFIX_CLASS.length)).equals(new String(IIndexConstants.MODULE_INFO))) return true; char[] classNameArray = className.toCharArray(); // use 1.7 as the source level as there are more valid identifiers in 1.7 mode // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673 if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (isIdentifier()) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (!isIdentifier()) return false; } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } }
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private boolean isValidPackageNameForClass(String className) { char[] classNameArray = className.toCharArray(); // use 1.7 as the source level as there are more valid identifiers in 1.7 mode // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673 if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (isIdentifier()) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (!isIdentifier()) return false; } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } protected Integer updatedIndexState() {
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private boolean isValidPackageNameForClass(String className) { char[] classNameArray = className.toCharArray(); if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_3/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (this.scanner.scanIdentifier() == TerminalTokens.TokenNameIdentifier) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (this.scanner.scanIdentifier() != TerminalTokens.TokenNameIdentifier) { return false; } } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } protected Integer updatedIndexState() {
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private boolean isValidPackageNameForClass(String className) { char[] classNameArray = className.toCharArray(); // use 1.7 as the source level as there are more valid identifiers in 1.7 mode // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673 if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (isIdentifier()) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (!isIdentifier()) return false; } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } protected Integer updatedIndexState() {
private final int consumeDigits0(int radix, int usingUnderscore, int invalidPosition, boolean expectingDigitFirst) throws InvalidInputException { int kind = 0; if (getNextChar('_')) { if (expectingDigitFirst) { return invalidPosition; } kind = usingUnderscore; while (getNextChar('_')) {/*empty */} } if (getNextCharAsDigit(radix)) { // continue to read digits or underscore while (getNextCharAsDigit(radix)) {/*empty */} int kind2 = consumeDigits0(radix, usingUnderscore, invalidPosition, false); if (kind2 == 0) { return kind; } return kind2; } if (kind == usingUnderscore) return invalidPosition; return kind; } public final boolean getNextCharAsDigit() throws InvalidInputException {
private boolean isValidPackageNameForClass(String className) { char[] classNameArray = className.toCharArray(); // use 1.7 as the source level as there are more valid identifiers in 1.7 mode // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376673 if (this.scanner == null) this.scanner = new Scanner(false /* comment */, true /* whitespace */, false /* nls */, ClassFileConstants.JDK1_7/* sourceLevel */, null/* taskTag */, null/* taskPriorities */, true /* taskCaseSensitive */); this.scanner.setSource(classNameArray); this.scanner.eofPosition = classNameArray.length - SuffixConstants.SUFFIX_CLASS.length; try { if (isIdentifier()) { while (this.scanner.eofPosition > this.scanner.currentPosition) { if (this.scanner.getNextChar() != '/' || this.scanner.eofPosition <= this.scanner.currentPosition) { return false; } if (!isIdentifier()) return false; } return true; } } catch (InvalidInputException e) { // invalid class name } return false; } protected Integer updatedIndexState() {
StringBuffer tagName = new StringBuffer(); int start = this.tagSourceStart; this.scanner.getNextChar(); while (this.scanner.currentPosition <= (this.tagSourceEnd+1)) { tagName.append(this.scanner.currentCharacter); this.scanner.getNextChar();
StringBuffer tagName = new StringBuffer(); int start = this.tagSourceStart; this.scanner.getNextChar(); while (this.scanner.currentPosition <= (this.tagSourceEnd+1)) { tagName.append(this.scanner.currentCharacter); this.scanner.getNextChar();