### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java,v retrieving revision 1.3 diff -u -r1.3 SelectionJavadocParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java 4 Nov 2005 15:59:32 -0000 1.3 +++ codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java 26 Apr 2006 16:40:21 -0000 @@ -101,8 +101,9 @@ * Otherwise return null as we do not need this reference. */ protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException { - int start = (int) (this.identifierPositionStack[0] >>> 32); - int end = (int) this.identifierPositionStack[0]; + int memberPtr = this.identifierLengthStack[0] - 1; + int start = (int) (this.identifierPositionStack[memberPtr] >>> 32); + int end = (int) this.identifierPositionStack[memberPtr]; if (start <= this.selectionStart && this.selectionEnd <= end) { selectedNode = (ASTNode) super.createMethodReference(receiver, arguments); this.abort = true; 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.54 diff -u -r1.54 JavadocParser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 29 Mar 2006 02:47:34 -0000 1.54 +++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 26 Apr 2006 16:40:23 -0000 @@ -180,36 +180,56 @@ TypeReference typeRef = (TypeReference) receiver; // Decide whether we have a constructor or not boolean isConstructor = false; + int length = this.identifierLengthStack[0]; if (typeRef == null) { char[] name = this.sourceParser.compilationUnit.getMainTypeName(); TypeDeclaration typeDecl = getParsedTypeDeclaration(); if (typeDecl != null) { name = typeDecl.name; } - isConstructor = CharOperation.equals(this.identifierStack[0], name); + isConstructor = CharOperation.equals(this.identifierStack[length-1], name); typeRef = new JavadocImplicitTypeReference(name, this.memberStart); } else { - char[] name = null; if (typeRef instanceof JavadocSingleTypeReference) { - name = ((JavadocSingleTypeReference)typeRef).token; + char[] name = ((JavadocSingleTypeReference)typeRef).token; + isConstructor = CharOperation.equals(this.identifierStack[length-1], name); } else if (typeRef instanceof JavadocQualifiedTypeReference) { char[][] tokens = ((JavadocQualifiedTypeReference)typeRef).tokens; - name = tokens[tokens.length-1]; + int last = tokens.length-1; + isConstructor = CharOperation.equals(this.identifierStack[length-1], tokens[last]); + if (isConstructor) { + boolean valid = true; + if (valid) { + for (int i=0; i>> 32); - int end = (int) this.identifierPositionStack[0]; + int start = (int) (this.identifierPositionStack[memberPtr] >>> 32); + int end = (int) this.identifierPositionStack[memberPtr]; methodName.setSourceRange(start, end - start + 1); // Set qualifier -// int end = methodName.getStartPosition()+methodName.getLength()-1; if (receiver == null) { start = this.memberStart; methodRef.setSourceRange(start, end - start + 1); @@ -188,10 +188,8 @@ while (parameters.hasNext()) { MethodRefParameter param = (MethodRefParameter) parameters.next(); methodRef.parameters().add(param); -// end = param.getStartPosition()+param.getLength()-1; } } -// methodRef.setSourceRange(start, end-start+1); methodRef.setSourceRange(start, this.scanner.getCurrentTokenEndPosition()-start+1); return methodRef; } @@ -239,7 +237,7 @@ * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createTypeReference() */ protected Object createTypeReference(int primitiveToken) { - int size = this.identifierLengthStack[this.identifierLengthPtr--]; + int size = this.identifierLengthStack[this.identifierLengthPtr]; String[] identifiers = new String[size]; int pos = this.identifierPtr - size + 1; for (int i = 0; i < size; i++) { @@ -307,15 +305,15 @@ int end = (int) this.identifierPositionStack[pos]; typeRef.setSourceRange(start, end-start+1); } - this.identifierPtr -= size; return typeRef; } - /* - * Parse @return tag declaration + /** + * @param receiver + * @param start + * @throws InvalidInputException */ - protected boolean parseReturn() { - createTag(); + protected boolean parseQualifiedMember(Object receiver, int start) throws InvalidInputException { return true; } @@ -332,6 +330,14 @@ return false; } + /* + * Parse @return tag declaration + */ + protected boolean parseReturn() { + createTag(); + return true; + } + /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int) */ Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java,v retrieving revision 1.27 diff -u -r1.27 JavadocAllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 28 Mar 2006 20:28:15 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 26 Apr 2006 16:40:21 -0000 @@ -10,15 +10,17 @@ *******************************************************************************/ package org.eclipse.jdt.internal.compiler.ast; +import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.impl.Constant; import org.eclipse.jdt.internal.compiler.lookup.*; public class JavadocAllocationExpression extends AllocationExpression { public int tagSourceStart, tagSourceEnd; - public int tagValue; + public int tagValue, memberStart; public boolean superAccess = false; - + public char[][] qualification; + public JavadocAllocationExpression(int start, int end) { this.sourceStart = start; this.sourceEnd = end; @@ -28,7 +30,7 @@ this((int) (pos >>> 32), (int) pos); } - private TypeBinding internalResolveType(Scope scope) { + TypeBinding internalResolveType(Scope scope) { // Propagate the type checking to the arguments, and check if the constructor is defined. this.constant = Constant.NotAConstant; @@ -120,6 +122,22 @@ } } } + } else if (this.resolvedType.isMemberType()) { + boolean valid = qualification != null; + int length = qualification.length; + int idx = length; + ReferenceBinding enclosingTypeBinding = allocationType; + if (valid) { + while (idx>0 && enclosingTypeBinding != null) { + valid = CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName); + if (!valid) break; + enclosingTypeBinding = enclosingTypeBinding.enclosingType(); + } + } + if (!valid || idx > 0 || enclosingTypeBinding != null) { + // TODO (frederic) need a specific message after 3.2 ship delivery + scope.problemReporter().javadocInvalidReference(this.memberStart+1, this.sourceEnd); + } } if (isMethodUseDeprecated(this.binding, scope, true)) { scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers()); Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java,v retrieving revision 1.22 diff -u -r1.22 CompletionJavadocParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 28 Mar 2006 20:29:57 -0000 1.22 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 26 Apr 2006 16:40:21 -0000 @@ -149,8 +149,9 @@ * Otherwise return null as we do not need this reference. */ protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException { - int refStart = (int) (this.identifierPositionStack[0] >>> 32); - int refEnd = (int) this.identifierPositionStack[0]; + int memberPtr = this.identifierLengthStack[0] - 1; + int refStart = (int) (this.identifierPositionStack[memberPtr] >>> 32); + int refEnd = (int) this.identifierPositionStack[memberPtr]; boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers || ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token || (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor @@ -226,7 +227,6 @@ this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, this.identifierStack[this.identifierPtr], positions, this.tagSourceStart, this.tagSourceEnd); } } - this.identifierPtr -= nbIdentifiers; if (CompletionEngine.DEBUG) { System.out.println(" completion partial qualified type="+completionNode); //$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedAllocationExpression.java =================================================================== RCS file: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedAllocationExpression.java diff -N compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedAllocationExpression.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedAllocationExpression.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2000, 2006 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.compiler.ast; + +import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.lookup.*; + +public class JavadocQualifiedAllocationExpression extends JavadocAllocationExpression { + +public char[][] qualification; + +public JavadocQualifiedAllocationExpression(int start, int end) { + super(start, end); +} +public JavadocQualifiedAllocationExpression(long pos) { + super(pos); +} + +TypeBinding internalResolveType(Scope scope) { + ReferenceBinding allocationType = (ReferenceBinding) super.internalResolveType(scope); + if (this.binding.isValidBinding() && allocationType.isMemberType()) { + boolean valid = qualification != null; + if (valid) { + ReferenceBinding enclosingTypeBinding = allocationType; + int idx = qualification.length; + while (idx>0 && enclosingTypeBinding.isMemberType()) { + valid = CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName); + if (!valid) break; + enclosingTypeBinding = enclosingTypeBinding.enclosingType(); + } + } + if (!valid) { + // TODO (frederic) need a specific message after 3.2 ship delivery + scope.problemReporter().javadocInvalidReference(this.memberStart+1, this.sourceEnd); + } + } + if (isMethodUseDeprecated(this.binding, scope, true)) { + scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers()); + } + return allocationType; +} +} #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java,v retrieving revision 1.22 diff -u -r1.22 JavadocBugsTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 29 Mar 2006 03:50:22 -0000 1.22 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 26 Apr 2006 16:40:26 -0000 @@ -36,7 +36,7 @@ // Use this static initializer to specify subset for tests // All specified tests which does not belong to the class are skipped... static { -// TESTS_PREFIX = "testBug83127"; +// TESTS_PREFIX = "testBug96237"; // TESTS_NAMES = new String[] { "testBug68017javadocWarning2" }; // TESTS_NUMBERS = new int[] { 129241 }; // TESTS_RANGE = new int[] { 21, 50 }; @@ -690,12 +690,7 @@ "}\n" }, "----------\n" + - "1. WARNING in X.java (at line 2)\n" + - " public class X extends RuntimeException {\n" + - " ^\n" + - "The serializable class X does not declare a static final serialVersionUID field of type long\n" + - "----------\n" + - "2. ERROR in X.java (at line 5)\n" + + "1. ERROR in X.java (at line 5)\n" + " public X(String message) {\n" + " ^^^^^^^\n" + "Javadoc: Missing tag for parameter message\n" + @@ -2420,6 +2415,196 @@ } /** + * Bug 68726: [Javadoc] Target attribute in @see link triggers warning + * @see 68726 + */ + public void testBug68726conform1() { + runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " /**\n" + + " * @see Object Eclipse\n" + + " */\n" + + " void foo1() {}\n" + + " /**@see Object Eclipse*/\n" + + " void foo2() {}\n" + + "}\n" + } + ); + } + public void testBug68726conform2() { + runConformTest( + new String[] { + "X.java", + "/**\n" + + " * @see IBM Home Page\n" + + " * @see \n" + + " * IBM Home Page\n" + + " * @see \n" + + " * IBM Home Page\n" + + " * \n" + + " * @see \n" + + " *\n" + + " * IBM\n" + + " *\n" + + " * Home Page\n" + + " *\n" + + " *\n" + + " * \n" + + " * @see Object\n" + + " */\n" + + "public class X {\n" + + "}\n" + } + ); + } + public void testBug68726negative1() { + runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " /**\n" + + " * Invalid URL link references\n" + + " *\n" + + " * @see \n" + + " * @see \n" + + " * @see invalid\n" + + " * @see invalid<\n" + + " * @see invalidinvalidinvalid no text allowed after the href\n" + + " */\n" + + " void foo() {}\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 5)\n" + + " * @see \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "7. ERROR in X.java (at line 11)\n" + + " * @see \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "8. ERROR in X.java (at line 12)\n" + + " * @see invalid\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "9. ERROR in X.java (at line 13)\n" + + " * @see invalid<\n" + + " ^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "10. ERROR in X.java (at line 14)\n" + + " * @see invalidinvalidinvalid no text allowed after the href\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Unexpected text\n" + + "----------\n" + ); + } + public void testBug68726negative2() { + runNegativeTest( + new String[] { + "X.java", + "/**\n" + + " * @see IBM Home Page\n" + + " * @see \n" + + " * IBM Home Page\n" + + " * @see \n" + + " * IBM Home Page<\n" + + " * /a>\n" + + " * @see \n" + + " *\n" + + " * IBM\n" + + " *\n" + + " * Home Page\n" + + " *\n" + + " *\n" + + " * \n" + + " * @see Unknown\n" + + " */\n" + + "public class X {\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 2)\n" + + " * @see IBM Home Page\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "2. ERROR in X.java (at line 3)\n" + + " * @see \n" + + " * IBM Home Page\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "3. ERROR in X.java (at line 6)\n" + + " * IBM Home Page<\n" + + " ^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "4. ERROR in X.java (at line 8)\n" + + " * @see \n" + + " *\n" + + " * IBM\n" + + " *\n" + + " * Home Page\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Malformed link reference\n" + + "----------\n" + + "5. ERROR in X.java (at line 16)\n" + + " * @see Unknown\n" + + " ^^^^^^^\n" + + "Javadoc: Unknown cannot be resolved to a type\n" + + "----------\n" + ); + } + + /** * Bug 69272: [Javadoc] Invalid malformed reference (missing separator) * @see 69272 */ @@ -2709,196 +2894,6 @@ } /** - * Bug 68726: [Javadoc] Target attribute in @see link triggers warning - * @see 68726 - */ - public void testBug68726conform1() { - runConformTest( - new String[] { - "X.java", - "public class X {\n" + - " /**\n" + - " * @see Object Eclipse\n" + - " */\n" + - " void foo1() {}\n" + - " /**@see Object Eclipse*/\n" + - " void foo2() {}\n" + - "}\n" - } - ); - } - public void testBug68726conform2() { - runConformTest( - new String[] { - "X.java", - "/**\n" + - " * @see IBM Home Page\n" + - " * @see \n" + - " * IBM Home Page\n" + - " * @see \n" + - " * IBM Home Page\n" + - " * \n" + - " * @see \n" + - " *\n" + - " * IBM\n" + - " *\n" + - " * Home Page\n" + - " *\n" + - " *\n" + - " * \n" + - " * @see Object\n" + - " */\n" + - "public class X {\n" + - "}\n" - } - ); - } - public void testBug68726negative1() { - runNegativeTest( - new String[] { - "X.java", - "public class X {\n" + - " /**\n" + - " * Invalid URL link references\n" + - " *\n" + - " * @see \n" + - " * @see \n" + - " * @see invalid\n" + - " * @see invalid<\n" + - " * @see invalidinvalidinvalid no text allowed after the href\n" + - " */\n" + - " void foo() {}\n" + - "}\n" - }, - "----------\n" + - "1. ERROR in X.java (at line 5)\n" + - " * @see \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "7. ERROR in X.java (at line 11)\n" + - " * @see \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "8. ERROR in X.java (at line 12)\n" + - " * @see invalid\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "9. ERROR in X.java (at line 13)\n" + - " * @see invalid<\n" + - " ^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "10. ERROR in X.java (at line 14)\n" + - " * @see invalidinvalidinvalid no text allowed after the href\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Unexpected text\n" + - "----------\n" - ); - } - public void testBug68726negative2() { - runNegativeTest( - new String[] { - "X.java", - "/**\n" + - " * @see IBM Home Page\n" + - " * @see \n" + - " * IBM Home Page\n" + - " * @see \n" + - " * IBM Home Page<\n" + - " * /a>\n" + - " * @see \n" + - " *\n" + - " * IBM\n" + - " *\n" + - " * Home Page\n" + - " *\n" + - " *\n" + - " * \n" + - " * @see Unknown\n" + - " */\n" + - "public class X {\n" + - "}\n" - }, - "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " * @see IBM Home Page\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + - " * @see \n" + - " * IBM Home Page\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "3. ERROR in X.java (at line 6)\n" + - " * IBM Home Page<\n" + - " ^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "4. ERROR in X.java (at line 8)\n" + - " * @see \n" + - " *\n" + - " * IBM\n" + - " *\n" + - " * Home Page\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Javadoc: Malformed link reference\n" + - "----------\n" + - "5. ERROR in X.java (at line 16)\n" + - " * @see Unknown\n" + - " ^^^^^^^\n" + - "Javadoc: Unknown cannot be resolved to a type\n" + - "----------\n" - ); - } - - /** * Bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value * @see 70892 * These two tests should pass whatever the source level... @@ -3751,7 +3746,7 @@ " class C { \n" + " /**\n" + " * Link {@link #B(Exception)} OK\n" + - " * Link {@link #C(String)} OK\n" + + " * Link {@link #B.C(String)} OK\n" + " * Link {@link #foo()} OK\n" + " * Link {@link #bar()} OK\n" + " */\n" + @@ -3950,6 +3945,306 @@ } /** + * Bug 96237: [javadoc] Inner types must be qualified + * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237" + */ + public void testBug96237() { + runConformTest( + new String[] { + "boden/IAFAState.java", + "package boden;\n" + + "public interface IAFAState {\n" + + " public class ValidationException extends Exception {\n" + + " public ValidationException(String variableName, IAFAState subformula) {\n" + + " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + + " }\n" + + " public void method() {}\n" + + " }\n" + + " /**\n" + + " * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" + + " * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" + + " * @throws ValidationException Thrown if a variable is unbound. \n" + + " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + + " * @see IAFAState.ValidationException#method()\n" + + " * @see ValidationException\n" + + " * {@link ValidationException}\n" + + " */\n" + + " public void validate() throws ValidationException;\n" + + "}\n", + "boden/TestValid.java", + "package boden;\n" + + "import boden.IAFAState.ValidationException;\n" + + "/**\n" + + " * @see ValidationException\n" + + " * @see IAFAState.ValidationException\n" + + " */\n" + + "public class TestValid {\n" + + " /** \n" + + " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + + " */\n" + + " IAFAState.ValidationException valid1;\n" + + " /**\n" + + " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + + " */\n" + + " IAFAState.ValidationException valid2;\n" + + "}\n" + } + ); + } + public void testBug96237b() { + runNegativeTest( + new String[] { + "boden/IAFAState.java", + "package boden;\n" + + "public interface IAFAState {\n" + + " public class ValidationException extends Exception {\n" + + " public ValidationException(String variableName, IAFAState subformula) {\n" + + " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + + " }\n" + + " public void method() {}\n" + + " }\n" + + "}\n", + "boden/TestInvalid.java", + "package boden;\n" + + "import boden.IAFAState.ValidationException;\n" + + "public class TestInvalid {\n" + + " /** \n" + + " * @see ValidationException#ValidationException(String, IAFAState)\n" + + " */ \n" + + " IAFAState.ValidationException invalid;\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in boden\\TestInvalid.java (at line 5)\n" + + " * @see ValidationException#ValidationException(String, IAFAState)\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + ); + } + public void testBug96237c() { + runNegativeTest( + new String[] { + "boden/IAFAState.java", + "package boden;\n" + + "public interface IAFAState {\n" + + " public class ValidationException extends Exception {\n" + + " public ValidationException(String variableName, IAFAState subformula) {\n" + + " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + + " }\n" + + " public void method() {}\n" + + " }\n" + + "}\n", + "boden/TestInvalid.java", + "package boden;\n" + + "import boden.IAFAState.ValidationException;\n" + + "public class TestInvalid {\n" + + " /**\n" + + " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + + " */\n" + + " IAFAState.ValidationException invalid;\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in boden\\TestInvalid.java (at line 5)\n" + + " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + ); + } + public void testBug96237d() { + runNegativeTest( + new String[] { + "test/Test.java", + "package test;\n" + + "public interface Test {\n" + + " public class Level0 {\n" + + " public Level0() {}\n" + + " }\n" + + " public interface Member {\n" + + " public class Level1 {\n" + + " public Level1() {}\n" + + " }\n" + + " }\n" + + "}\n", + "test/C.java", + "package test;\n" + + "public class C {\n" + + " /**\n" + + " * @see Test.Level0#Test.Level0()\n" + + " */\n" + + " Test.Level0 valid = new Test.Level0();\n" + + " /**\n" + + " * @see Test.Level0#Level0()\n" + + " */\n" + + " Test.Level0 invalid = new Test.Level0();\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in test\\C.java (at line 8)\n" + + " * @see Test.Level0#Level0()\n" + + " ^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + ); + } + public void testBug96237e() { + runNegativeTest( + new String[] { + "test/Test.java", + "package test;\n" + + "public interface Test {\n" + + " public class Level0 {\n" + + " public Level0() {}\n" + + " }\n" + + " public interface Member {\n" + + " public class Level1 {\n" + + " public Level1() {}\n" + + " }\n" + + " }\n" + + "}\n", + "test/C2.java", + "package test;\n" + + "public class C2 {\n" + + " /**\n" + + " * @see Test.Member.Level1#Test.Member.Level1()\n" + + " */\n" + + " Test.Member.Level1 valid = new Test.Member.Level1();\n" + + " /**\n" + + " * @see Test.Member.Level1#Level1()\n" + + " */\n" + + " Test.Member.Level1 invalid = new Test.Member.Level1();\n" + + " /**\n" + + " * @see Test.Member.Level1#Test.Level1()\n" + + " */\n" + + " Test.Member.Level1 wrong = new Test.Member.Level1();\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in test\\C2.java (at line 8)\n" + + " * @see Test.Member.Level1#Level1()\n" + + " ^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "2. ERROR in test\\C2.java (at line 12)\n" + + " * @see Test.Member.Level1#Test.Level1()\n" + + " ^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + ); + } + public void testBug96237f() { + runConformTest( + new String[] { + "implicit/Valid.java", + "package implicit;\n" + + "public interface Valid {\n" + + " public class Level0 {\n" + + " /**\n" + + " * @see #Valid.Level0() Valid\n" + + " */\n" + + " public Level0() {}\n" + + " /**\n" + + " * @see #Valid.Level0(String) Valid\n" + + " */\n" + + " public Level0(String str) {}\n" + + " }\n" + + " public interface Member {\n" + + " public class Level1 {\n" + + " /**\n" + + " * @see #Valid.Member.Level1() Valid\n" + + " */\n" + + " public Level1() {}\n" + + " /**\n" + + " * @see #Valid.Member.Level1(int) Valid\n" + + " */\n" + + " public Level1(int x) {}\n" + + " }\n" + + " }\n" + + "}\n" + } + ); + } + public void testBug96237g() { + runNegativeTest( + new String[] { + "implicit/Invalid.java", + "package implicit;\n" + + "public interface Invalid {\n" + + " public class Level0 {\n" + + " /**\n" + + " * @see #Level0() Invalid\n" + + " */\n" + + " public Level0() {}\n" + + " /**\n" + + " * @see #Level0(String) Invalid\n" + + " */\n" + + " public Level0(String str) {}\n" + + " }\n" + + " public interface Member {\n" + + " public class Level1 {\n" + + " /**\n" + + " * @see #Level1() Invalid\n" + + " * @see #Member.Level1() Invalid\n" + + " * @see #Invalid.Level1() Invalid\n" + + " */\n" + + " public Level1() {}\n" + + " /**\n" + + " * @see #Level1(int) Invalid\n" + + " * @see #Invalid.Level1(int) Invalid\n" + + " * @see #Member.Level1(int) Invalid\n" + + " */\n" + + " public Level1(int x) {}\n" + + " }\n" + + " }\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in implicit\\Invalid.java (at line 5)\n" + + " * @see #Level0() Invalid\n" + + " ^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "2. ERROR in implicit\\Invalid.java (at line 9)\n" + + " * @see #Level0(String) Invalid\n" + + " ^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "3. ERROR in implicit\\Invalid.java (at line 16)\n" + + " * @see #Level1() Invalid\n" + + " ^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "4. ERROR in implicit\\Invalid.java (at line 17)\n" + + " * @see #Member.Level1() Invalid\n" + + " ^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "5. ERROR in implicit\\Invalid.java (at line 18)\n" + + " * @see #Invalid.Level1() Invalid\n" + + " ^^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "6. ERROR in implicit\\Invalid.java (at line 22)\n" + + " * @see #Level1(int) Invalid\n" + + " ^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "7. ERROR in implicit\\Invalid.java (at line 23)\n" + + " * @see #Invalid.Level1(int) Invalid\n" + + " ^^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + + "8. ERROR in implicit\\Invalid.java (at line 24)\n" + + " * @see #Member.Level1(int) Invalid\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "Javadoc: Invalid reference\n" + + "----------\n" + ); + } + + /** * Bug 116464: [javadoc] Unicode tag name are not correctly parsed * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464" */ Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java,v retrieving revision 1.37 diff -u -r1.37 JavadocTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 30 Mar 2006 15:26:50 -0000 1.37 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 26 Apr 2006 16:40:26 -0000 @@ -100,6 +100,7 @@ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ENABLED); options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ENABLED); options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); + options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE); return options; }