Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 85366 Details for
Bug 209936
[javadoc] Missing code implementation in the compiler on inner classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
[proposed patch + test case] on top v829 - all jdt.core tests OK
patch_bug_209936_top_HEAD(v829)v09.txt (text/plain), 34.56 KB, created by
Eric Jodet
on 2007-12-17 00:56:26 EST
(
hide
)
Description:
[proposed patch + test case] on top v829 - all jdt.core tests OK
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-12-17 00:56:26 EST
Size:
34.56 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.364 >diff -u -r1.364 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 30 Nov 2007 17:02:40 -0000 1.364 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 17 Dec 2007 05:49:48 -0000 >@@ -4139,7 +4139,6 @@ > return; > } > break; >- case ProblemReasons.ReceiverTypeNotVisible: > case ProblemReasons.NotVisible : > id = IProblem.JavadocNotVisibleMethod; > break; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java,v >retrieving revision 1.33 >diff -u -r1.33 JavadocMessageSend.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 27 Apr 2007 15:51:38 -0000 1.33 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 17 Dec 2007 05:49:22 -0000 >@@ -41,7 +41,7 @@ > // Base type promotion > this.constant = Constant.NotAConstant; > if (this.receiver == null) { >- this.actualReceiverType = scope.enclosingSourceType(); >+ this.actualReceiverType = scope.enclosingReceiverType(); > } else if (scope.kind == Scope.CLASS_SCOPE) { > this.actualReceiverType = this.receiver.resolveType((ClassScope) scope); > } else { >@@ -79,7 +79,7 @@ > return null; > } > this.actualReceiverType = scope.environment().convertToRawType(this.receiver.resolvedType); >- SourceTypeBinding enclosingType = scope.enclosingSourceType(); >+ ReferenceBinding enclosingType = scope.enclosingReceiverType(); > if (enclosingType==null ? false : enclosingType.isCompatibleWith(this.actualReceiverType)) { > this.bits |= ASTNode.SuperAccess; > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java,v >retrieving revision 1.21 >diff -u -r1.21 JavadocSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 10 Apr 2007 19:03:10 -0000 1.21 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 17 Dec 2007 05:49:22 -0000 >@@ -16,12 +16,12 @@ > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.PackageBinding; >-import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.Scope; > import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; >+import org.eclipse.jdt.internal.core.util.Util; > > > public class JavadocSingleTypeReference extends SingleTypeReference { >@@ -86,10 +86,8 @@ > } > if (isTypeUseDeprecated(this.resolvedType, scope)) > reportDeprecatedType(this.resolvedType, scope); >- if (this.resolvedType instanceof ParameterizedTypeBinding) { >- this.resolvedType = ((ParameterizedTypeBinding)this.resolvedType).genericType(); >- } >- return this.resolvedType; >+ >+ return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope); > } > > /* (non-Javadoc) >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java,v >retrieving revision 1.18 >diff -u -r1.18 JavadocQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 10 Apr 2007 19:03:10 -0000 1.18 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 17 Dec 2007 05:49:22 -0000 >@@ -16,9 +16,9 @@ > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.PackageBinding; >-import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.Scope; > import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; >+import org.eclipse.jdt.internal.core.util.Util; > > > public class JavadocQualifiedTypeReference extends QualifiedTypeReference { >@@ -74,10 +74,8 @@ > } > if (isTypeUseDeprecated(this.resolvedType, scope)) > reportDeprecatedType(this.resolvedType, scope); >- if (this.resolvedType instanceof ParameterizedTypeBinding) { >- this.resolvedType = ((ParameterizedTypeBinding)this.resolvedType).genericType(); >- } >- return this.resolvedType; >+ >+ return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope); > } > > public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) { >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java,v >retrieving revision 1.11 >diff -u -r1.11 JavadocImplicitTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 6 Mar 2007 02:38:48 -0000 1.11 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 17 Dec 2007 05:49:22 -0000 >@@ -13,6 +13,7 @@ > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.*; >+import org.eclipse.jdt.internal.core.util.Util; > > public class JavadocImplicitTypeReference extends TypeReference { > >@@ -36,7 +37,7 @@ > */ > protected TypeBinding getTypeBinding(Scope scope) { > this.constant = Constant.NotAConstant; >- return this.resolvedType = scope.enclosingSourceType(); >+ return this.resolvedType = scope.enclosingReceiverType(); > } > > public char[] getLastToken() { >@@ -67,7 +68,7 @@ > if (this.resolvedType != null) // is a shared type reference which was already resolved > return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error > >- this.resolvedType = scope.enclosingSourceType(); >+ this.resolvedType = scope.enclosingReceiverType(); > if (this.resolvedType == null) > return null; // detected cycle while resolving hierarchy > if (!this.resolvedType.isValidBinding()) { >@@ -76,7 +77,8 @@ > } > if (isTypeUseDeprecated(this.resolvedType, scope)) > reportDeprecatedType(this.resolvedType, scope); >- return this.resolvedType; >+ >+ return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope); > } > > protected void reportInvalidType(Scope scope) { >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.113 >diff -u -r1.113 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 4 Dec 2007 11:10:12 -0000 1.113 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 17 Dec 2007 05:49:53 -0000 >@@ -44,6 +44,10 @@ > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; > import org.eclipse.jdt.internal.compiler.impl.Constant; >+import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment; >+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; >+import org.eclipse.jdt.internal.compiler.lookup.Scope; >+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.TypeIds; > import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; > import org.eclipse.jdt.internal.compiler.util.SuffixConstants; >@@ -392,7 +396,37 @@ > public static String convertTypeSignature(char[] sig, int start, int length) { > return new String(sig, start, length).replace('/', '.'); > } >- >+ /** >+ * Specific to references used in Javadocs (@see, @link) >+ * Returns the given binding's raw type binding. >+ * May retrieve and convert to raw types all parameterized enclosing types of the given TypeBinding. >+ * @param type the TypeBinding to raw convert >+ * @param scope the scope within which the conversion occurs >+ * @return TypeBinding the raw converted TypeBinding >+ */ >+ public static TypeBinding deepConvertToRawType(TypeBinding type, Scope scope) { >+ LookupEnvironment environment = scope.environment(); >+ TypeBinding rawTypeBinding = environment.convertToRawType(type); >+ if (!rawTypeBinding.isParameterizedType()) { >+ return rawTypeBinding; >+ } >+ char[][] memberTypesNames = new char[5][]; >+ int idx = -1; // member types level >+ while (rawTypeBinding.isParameterizedType()) { >+ TypeBinding enclosing = rawTypeBinding.enclosingType(); >+ if (enclosing == null) break; >+ if (++idx == memberTypesNames.length) { >+ System.arraycopy(memberTypesNames, 0, memberTypesNames = new char[memberTypesNames.length*2][], 0, idx); >+ } >+ memberTypesNames[idx] = rawTypeBinding.sourceName(); >+ rawTypeBinding = enclosing; >+ } >+ // raw convert all member types >+ for (int i=idx; i>=0; i--) { >+ rawTypeBinding = environment.convertToRawType(((ReferenceBinding) rawTypeBinding).getMemberType(memberTypesNames[i])); >+ } >+ return rawTypeBinding; >+ } > /* > * Returns the default java extension (".java"). > * To be used when the extension is not known. >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.75 >diff -u -r1.75 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 24 Nov 2006 13:33:37 -0000 1.75 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 17 Dec 2007 05:50:12 -0000 >@@ -2418,9 +2418,11 @@ > IBinding binding = seeRef.resolveBinding(); > assertTrue("Wrong kind of binding", binding instanceof ITypeBinding); > ITypeBinding typeBinding = (ITypeBinding)binding; >- assertTrue(seeRef.toString()+" should have a generic type binding", typeBinding.isGenericType()); >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936 >+ // only have RawTypeBinding in Javadocs >+ assertFalse(seeRef.toString()+" should NOT have a generic type binding", typeBinding.isGenericType()); > assertFalse(seeRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType()); >- assertFalse(seeRef.toString()+" should NOT have a raw type binding", typeBinding.isRawType()); >+ assertTrue(seeRef.toString()+" should have a raw type binding", typeBinding.isRawType()); > // Get inline tag simple name reference in second tag > assertEquals("Invalid number of fragments for inline tag element: "+inlineTag, 1, inlineTag.fragments().size()); > node = (ASTNode) inlineTag.fragments().get(0); >@@ -2430,9 +2432,11 @@ > binding = linkRef.resolveBinding(); > assertTrue("Wrong kind of binding", binding instanceof ITypeBinding); > typeBinding = (ITypeBinding)binding; >- assertTrue(linkRef.toString()+" should have a generic type binding", typeBinding.isGenericType()); >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936 >+ // only have RawTypeBinding in Javadocs >+ assertFalse(linkRef.toString()+" should NOT have a generic type binding", typeBinding.isGenericType()); > assertFalse(linkRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType()); >- assertFalse(linkRef.toString()+" should NOT have a raw type binding", typeBinding.isRawType()); >+ assertTrue(linkRef.toString()+" should have a raw type binding", typeBinding.isRawType()); > } > } > >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.22 >diff -u -r1.22 JavadocBugsCompletionModelTest.java >--- src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 14 May 2007 17:04:05 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 17 Dec 2007 05:50:14 -0000 >@@ -340,7 +340,7 @@ > "}"; > completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.java", source, true, "meth"); > assertSortedResults( >- "method[METHOD_REF]{method(Object), Ljavadoc.bugs.BasicTestBugs<TS;>;, (TS;)V, method, (s), "+this.positions+R_DRICNRNS+"}" >+ "method[METHOD_REF]{method(Object), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.Object;)V, method, (s), "+this.positions+R_DRICNRNS+"}" > ); > } > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java,v >retrieving revision 1.35 >diff -u -r1.35 JavadocTest_1_5.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 30 Nov 2007 17:01:57 -0000 1.35 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 17 Dec 2007 05:50:23 -0000 >@@ -3098,13 +3098,11 @@ > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936" > */ > public void testBug209936a() { >- reportMissingJavadocComments = CompilerOptions.IGNORE; >- reportMissingJavadocCommentsVisibility = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; > runNegativeTest( > new String[] { > "p/X.java", > "package p;\n" + >- "\n" + > "public abstract class X extends Y {\n" + > " protected class A extends Member {\n" + > " /**\n" + >@@ -3115,14 +3113,11 @@ > "}", > "p/Y.java", > "package p;\n" + >- "\n" + > "import p1.Z;\n" + >- "\n" + > "public abstract class Y extends Z<Object> {\n" + > "}", > "p1/Z.java", > "package p1;\n" + >- "\n" + > "public abstract class Z<T> {\n" + > " protected class Member {\n" + > " protected void foo(Object source, Object data) {\n" + >@@ -3131,33 +3126,20 @@ > "}" > }, > "----------\n" + >- "1. ERROR in p\\X.java (at line 6)\n" + >+ "1. ERROR in p\\X.java (at line 5)\n" + > " * @see Member#foo(Object, Object)\n" + >- " ^^^\n" + >- "Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible\n" + >- "----------\n" + >- "2. ERROR in p\\X.java (at line 8)\n" + >- " public void foo(Object source, Object data) {}\n" + >- " ^^^^^^\n" + >- "Javadoc: Missing tag for parameter source\n" + >- "----------\n" + >- "3. ERROR in p\\X.java (at line 8)\n" + >- " public void foo(Object source, Object data) {}\n" + >- " ^^^^\n" + >- "Javadoc: Missing tag for parameter data\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Invalid member type qualification\n" + > "----------\n" > ); > } > > public void testBug209936b() { >- reportMissingJavadocTags = CompilerOptions.IGNORE; >- reportMissingJavadocComments = CompilerOptions.IGNORE; >- reportMissingJavadocCommentsVisibility = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; > runNegativeTest( > new String[] { > "p/X.java", > "package p;\n" + >- "\n" + > "public abstract class X extends Y {\n" + > " protected class A extends Member {\n" + > " /**\n" + >@@ -3170,24 +3152,600 @@ > "package p;\n" + > "\n" + > "import p1.Z;\n" + >- "\n" + >- "public abstract class Y extends Z<Object> {\n" + >- "}", >+ "public abstract class Y extends Z<Object> {}", > "p1/Z.java", > "package p1;\n" + >- "\n" + > "public abstract class Z<T> {\n" + > " protected class Member {\n" + >- " protected void foo(Object source, Object data) {\n" + >- " }\n" + >+ " protected void foo(Object source, Object data) {}\n" + > " }\n" + > "}" > }, > "----------\n" + >- "1. ERROR in p\\X.java (at line 6)\n" + >+ "1. ERROR in p\\X.java (at line 5)\n" + > " * @see Member#foo(Object, Object)\n" + >- " ^^^\n" + >- "Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_GenericMemberImplicitReference() { >+ reportMissingJavadocTags = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3<U> {\n" + >+ " public class A4<V> {\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3<U> extends A3<U> {\n" + >+ " public class X4<V> extends A4<V> {\n" + >+ " /**\n" + >+ // implicit type reference >+ " * @see #foo(Object)\n" + >+ " * @see #foo(V)\n" + >+ " */\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see #foo(V)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type X.X1.X2.X3.X4 is not applicable for the arguments (V)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_GenericMemberSingleReference() { >+ reportMissingJavadocTags = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3<U> {\n" + >+ " public class A4<V> {\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3<U> extends A3<U> {\n" + >+ " public class X4<V> extends A4<V> {\n" + >+ " /**\n" + >+ // single type reference >+ " * @see A4#foo(V)\n" + >+ " * @see A4#foo(Object)\n" + >+ " */\n" + >+ " public void myFoo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A4#foo(V)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + >+ "----------\n" + >+ "2. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see A4#foo(Object)\n" + >+ " ^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_GenericMemberQualifiedSingleReference() { >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3<U> {\n" + >+ " public class A4<V> {\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3<U> extends A3<U> {\n" + >+ " public class X4<V> extends A4<V> {\n" + >+ " /**\n" + >+ // qualified single type reference >+ " * @see A3.A4#foo(V)\n" + >+ " * @see A3.A4#foo(Object)\n" + >+ " */\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A3.A4#foo(V)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_GenericMemberFullyQualifiedSingleReference() { >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3<U> {\n" + >+ " public class A4<V> {\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3<U> extends A3<U> {\n" + >+ " public class X4<V> extends A4<V> {\n" + >+ " /**\n" + >+ // fully qualified type reference >+ " * @see A.A1.A2.A3.A4#foo(V)\n" + >+ " * @see A.A1.A2.A3.A4#foo(Object)\n" + >+ " */\n" + >+ " public void foo(V v) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A.A1.A2.A3.A4#foo(V)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberImplicitReference() { >+ reportMissingJavadocTags = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3<U> {\n" + >+ " public class A4 {\n" + >+ " public void foo(U u) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3<U> extends A3<U> {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // implicit reference >+ " * @see #foo(Object)\n" + >+ " * @see #foo(U u)\n" + >+ " */\n" + >+ " public void foo(U u) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 10)\r\n" + >+ " * @see #foo(U u)\r\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type X.X1.X2.X3.X4 is not applicable for the arguments (U)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberSingleReference1(){ >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2<T> {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // single type reference >+ " * @see A4#foo(Object)\n" + >+ " * @see A4#foo(T)\n" + >+ " */\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A4#foo(Object)\n" + >+ " ^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" + >+ "2. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see A4#foo(T)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberSingleReference2(){ >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2 {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2 extends A2 {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // single type reference >+ " * @see A4#foo(Object)\n" + >+ " * @see A4#foo(S)\n" + >+ " */\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A4#foo(Object)\n" + >+ " ^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" + >+ "2. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see A4#foo(S)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (S)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberSingleReference3(){ >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A {\n" + >+ " public class A1 {\n" + >+ " public class A2<T> {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X extends A {\n" + >+ " public class X1 extends A1 {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // single type reference >+ " * @see A4#foo(Object)\n" + >+ " * @see A4#foo(T)\n" + >+ " */\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A4#foo(Object)\n" + >+ " ^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" + >+ "2. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see A4#foo(T)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberSingleReference4(){ >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "public class A {\n" + >+ " public class A1 {\n" + >+ " public class A2<T> {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X extends A {\n" + >+ " public class X1 extends A1 {\n" + >+ " public class X2<T> extends A2<T> {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // single type reference >+ " * @see A4#foo(Object)\n" + >+ " * @see A4#foo(T)\n" + >+ " */\n" + >+ " public void foo(T t) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 9)\n" + >+ " * @see A4#foo(Object)\n" + >+ " ^^\n" + >+ "Javadoc: Invalid member type qualification\n" + >+ "----------\n" + >+ "2. ERROR in p2\\X.java (at line 10)\n" + >+ " * @see A4#foo(T)\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug209936_MemberQualifiedSingleReference1() { >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runConformTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2 {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2 extends A2 {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // qualified single type reference >+ " * @see A3.A4#foo(Object)\n" + >+ " * @see A2.A3.A4#foo(Object)\n" + >+ " * @see A1.A2.A3.A4#foo(Object)\n" + >+ " */\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ } >+ ); >+ } >+ >+ public void testBug209936_MemberQualifiedSingleReference2() { >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runConformTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "\n" + >+ "public class A<R> {\n" + >+ " public class A1<S> {\n" + >+ " public class A2 {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public class A5 {\n" + >+ " public class A6 {\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1<S> extends A1<S> {\n" + >+ " public class X2 extends A2 {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " public class X5 extends A5 {\n" + >+ " public class X6 extends A6 {\n" + >+ " /**\n" + >+ // qualified single type reference >+ " * @see A5.A6#foo(Object)\n" + >+ " * @see A4.A5.A6#foo(Object)\n" + >+ " */\n" + >+ " public void foo(S s) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ } >+ ); >+ } >+ >+ public void testBug209936_MemberFullyQualifiedSingleReference() { >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "p1/A.java", >+ "package p1;\n" + >+ "\n" + >+ "public class A<R> {\n" + >+ " public class A1 {\n" + >+ " public class A2 {\n" + >+ " public class A3 {\n" + >+ " public class A4 {\n" + >+ " public void foo(R r) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "p2/X.java", >+ "package p2;\n" + >+ "import p1.A;\n" + >+ "public class X<R> extends A<R> {\n" + >+ " public class X1 extends A1 {\n" + >+ " public class X2 extends A2 {\n" + >+ " public class X3 extends A3 {\n" + >+ " public class X4 extends A4 {\n" + >+ " /**\n" + >+ // fully qualified type reference >+ " * @see A.A1.A2.A3.A4#foo(Object)\n" + >+ " * @see A.A1.A2.A3.A4#foo(R)\n" + >+ " */\n" + >+ " public void foo(R r) {}\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in p2\\X.java (at line 10)\r\n" + >+ " * @see A.A1.A2.A3.A4#foo(R)\r\n" + >+ " ^^^\n" + >+ "Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (R)\n" + > "----------\n" > ); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209936
:
82960
|
84203
|
84710
|
85267
|
85366
|
86312
|
88878