### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core 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.50 diff -u -r1.50 AbstractCommentParser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 25 Nov 2005 15:54:04 -0000 1.50 +++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 27 Nov 2005 15:32:19 -0000 @@ -942,11 +942,17 @@ default : if (iToken == 0) { + if (this.identifierPtr>=0) { + this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr]; + } return null; } if ((iToken % 2) == 0) { // cannot leave on a dot switch (parserKind) { case COMPLETION_PARSER: + if (this.identifierPtr>=0) { + this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr]; + } return syntaxRecoverQualifiedName(primitiveToken); case DOM_PARSER: if (this.currentTokenType != -1) { @@ -968,7 +974,9 @@ this.scanner.currentPosition = this.tokenPreviousPosition; this.currentTokenType = -1; } - this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr]; + if (this.identifierPtr>=0) { + this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr]; + } return createTypeReference(primitiveToken); } #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java,v retrieving revision 1.6 diff -u -r1.6 JavadocBugsCompletionModelTest.java --- src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 25 Nov 2005 15:54:07 -0000 1.6 +++ src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 27 Nov 2005 15:32:24 -0000 @@ -528,7 +528,7 @@ } /** - * Bug 115662: [javadoc][assist] range of the qualified type completion in javadoc text isn't corect + * Bug 115662: [javadoc][assist] link completion in types * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=115662" */ public void testBug115662a() throws JavaModelException { @@ -569,7 +569,7 @@ "/**\n" + " * {@link #toString()\n" + " */\n" + - "public class Tests {\n" + + "public class Test {\n" + " int toto;\n" + "}\n"; completeInJavadoc("/Completion/src/bugs/b115662/Test.java", source, true, "toString"); @@ -579,7 +579,7 @@ } /** - * Bug 117183: [javadoc][assist] range of the qualified type completion in javadoc text isn't corect + * Bug 117183: [javadoc][assist] No completion in text when cursor location is followed by a '.' * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=117183" */ public void testBug117183a() throws JavaModelException { @@ -658,4 +658,22 @@ "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}" ); } + +/** + * Bug 118105: [javadoc][assist] Hang with 100% CPU during code assist on comment + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=118105" + */ +public void testBug118105() throws JavaModelException { + String source = + "package bugs.b118105;\n" + + "/**\n" + + " * Some words here {@link Str.\n" + + " */\n" + + "public class Test {\n" + + "}\n"; + completeInJavadoc("/Completion/src/bugs/b118105/BasicTestBugs.java", source, true, "Str"); + assertSortedResults( + "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}" + ); +} }