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 85370 Details for
Bug 204749
[1.5][javadoc] NPE in JavadocQualifiedTypeReference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
[proposed patch + test cases] on top v829 - all jdt.core tests OK
patch_bug204749_top_HEAD(v829)_v01.txt (text/plain), 8.83 KB, created by
Eric Jodet
on 2007-12-17 03:18:30 EST
(
hide
)
Description:
[proposed patch + test cases] on top v829 - all jdt.core tests OK
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-12-17 03:18:30 EST
Size:
8.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java,v >retrieving revision 1.12 >diff -u -r1.12 CompilerInvocationTests.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 21 Nov 2007 17:54:29 -0000 1.12 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 17 Dec 2007 08:15:51 -0000 >@@ -700,6 +700,7 @@ > expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); > expectedProblemAttributes.put("JavadocUnexpectedText", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); > expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); >+ expectedProblemAttributes.put("JavadocIllegalAccessFromTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); > expectedProblemAttributes.put("DuplicateTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("NonStaticTypeFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); >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 08:15:59 -0000 >@@ -3191,4 +3191,44 @@ > "----------\n" > ); > } >+ >+ /** >+ * Bug 204749 [1.5][javadoc] NPE in JavadocQualifiedTypeReference >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=204749" >+ */ >+ public void testBug204749a() { >+ reportMissingJavadocTags = CompilerOptions.IGNORE; >+ reportMissingJavadocComments = CompilerOptions.IGNORE; >+ reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING; >+ runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X<T> {\n" + >+ " /** @see T.R */\n" + >+ " void foo() {}\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " /** @see T.R */\n" + >+ " ^^^\n" + >+ "Javadoc: Illegal qualified access from the type parameter T\n" + >+ "----------\n" >+ ); >+ } >+ >+ public void testBug204749b() { >+ reportMissingJavadocTags = CompilerOptions.IGNORE; >+ reportMissingJavadocComments = CompilerOptions.IGNORE; >+ reportInvalidJavadoc = CompilerOptions.IGNORE; >+ runConformTest( >+ new String[] { >+ "X.java", >+ "public class X<T> {\n" + >+ " /** @see T.R */\n" + >+ " void foo() {}\n" + >+ "}" >+ } >+ ); >+ } > } >#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 08:16:40 -0000 >@@ -289,6 +289,7 @@ > case IProblem.JavadocHiddenReference: > case IProblem.JavadocMissingTagDescription: > case IProblem.JavadocInvalidSeeUrlReference: >+ case IProblem.JavadocIllegalAccessFromTypeVariable: > return CompilerOptions.InvalidJavadoc; > > case IProblem.JavadocMissingParamTag: >@@ -3886,8 +3887,16 @@ > String[] arguments = new String[] { this.options.getVisibilityString(this.options.reportInvalidJavadocTagsVisibility), this.options.getVisibilityString(modifiers) }; > this.handle(IProblem.JavadocHiddenReference, arguments, arguments, sourceStart, sourceEnd); > } >+public void javadocIllegalAccessFromTypeVariable(TypeVariableBinding variable, ASTNode location) { >+ String[] arguments = new String[] { new String(variable.sourceName) }; >+ this.handle( >+ IProblem.JavadocIllegalAccessFromTypeVariable, >+ arguments, >+ arguments, >+ location.sourceStart, >+ location.sourceEnd); >+} > public void javadocInvalidConstructor(Statement statement, MethodBinding targetConstructor, int modifiers) { >- > if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return; > int sourceStart = statement.sourceStart; > int sourceEnd = statement.sourceEnd; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java,v >retrieving revision 1.42 >diff -u -r1.42 QualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 9 May 2007 17:18:18 -0000 1.42 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 17 Dec 2007 08:16:09 -0000 >@@ -78,7 +78,7 @@ > if (!this.resolvedType.isValidBinding()) > return this.resolvedType; > if (i == 0 && this.resolvedType.isTypeVariable() && ((TypeVariableBinding) this.resolvedType).firstBound == null) { // cannot select from a type variable >- scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this); >+ this.illegalAccessFromTypeVariable(scope); > return this.resolvedType = null; > } > if (i < last && isTypeUseDeprecated(this.resolvedType, scope)) { >@@ -112,6 +112,9 @@ > return tokens; > } > >+ public void illegalAccessFromTypeVariable(Scope scope) { >+ scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this); >+ } > public StringBuffer printExpression(int indent, StringBuffer output) { > > for (int i = 0; i < tokens.length; i++) { >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 08:16:09 -0000 >@@ -19,6 +19,7 @@ > 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.compiler.lookup.TypeVariableBinding; > > > public class JavadocQualifiedTypeReference extends QualifiedTypeReference { >@@ -52,7 +53,10 @@ > visitor.visit(this, scope); > visitor.endVisit(this, scope); > } >- >+ >+ public void illegalAccessFromTypeVariable(Scope scope) { >+ scope.problemReporter().javadocIllegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this); >+ } > /* > * We need to modify resolving behavior to handle package references > */ >@@ -63,6 +67,8 @@ > return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error > > this.resolvedType = getTypeBinding(scope); >+ if (this.resolvedType == null) return null; >+ > if (!this.resolvedType.isValidBinding()) { > Binding binding = scope.getTypeOrPackage(this.tokens); > if (binding instanceof PackageBinding) { >Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.196 >diff -u -r1.196 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 8 Nov 2007 16:27:58 -0000 1.196 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 17 Dec 2007 08:16:09 -0000 >@@ -967,6 +967,8 @@ > int JavadocUnexpectedText = Javadoc + Internal + 518; > /** @since 3.1 */ > int JavadocInvalidParamTagName = Javadoc + Internal + 519; >+ /** @since 3.4 */ >+ int JavadocIllegalAccessFromTypeVariable = Javadoc + TypeRelated + 575; > > /** > * Generics
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 204749
:
79253
|
79254
|
85370
|
85385
|
85440