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 225788 Details for
Bug 397888
Unused type parameter problem should also depend on option to consider @param tag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for JDT Core
Fix-for-Bug-397888---Unused-type-parameter-problem-s.patch (text/plain), 5.88 KB, created by
Manoj N Palat
on 2013-01-17 14:20:19 EST
(
hide
)
Description:
Patch for JDT Core
Filename:
MIME Type:
Creator:
Manoj N Palat
Created:
2013-01-17 14:20:19 EST
Size:
5.88 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java >index 18f29ba..f1eb1cd 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2012 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 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 >@@ -2749,5 +2749,71 @@ > "}\n" > }); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888 >+public void test397888a() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); >+ customOptions.put(CompilerOptions.OPTION_ReportUnusedTypeParameter, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference, >+ CompilerOptions.ENABLED); > >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "/***\n" + >+ " * @param <T>\n" + >+ " */\n" + >+ "public class X <T> {\n"+ >+ "/***\n" + >+ " * @param <S>\n" + >+ " */\n" + >+ " public <S> void ph(int i) {\n"+ >+ " }\n"+ >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 8)\n" + >+ " public <S> void ph(int i) {\n" + >+ " ^\n" + >+ "The value of the parameter i is not used\n" + >+ "----------\n", >+ null, true, customOptions); >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888 >+public void test397888b() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); >+ customOptions.put(CompilerOptions.OPTION_ReportUnusedTypeParameter, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference, >+ CompilerOptions.DISABLED); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "/***\n" + >+ " * @param <T>\n" + >+ " */\n" + >+ "public class X <T> {\n"+ >+ "/***\n" + >+ " * @param <S>\n" + >+ " */\n" + >+ "public <S> void ph() {\n"+ >+ "}\n"+ >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " public class X <T> {\n" + >+ " ^\n" + >+ "Unused type parameter T\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " public <S> void ph() {\n" + >+ " ^\n" + >+ "Unused type parameter S\n" + >+ "----------\n", >+ null, true, customOptions); >+} > } >\ No newline at end of file >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >index cb5d6ff..1b20d97 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2012 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 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 >@@ -493,8 +493,9 @@ > return false; > > ReferenceBinding refType = (ReferenceBinding) type; >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888 > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=385780 >- if (refType instanceof TypeVariableBinding) { >+ if ((this.bits & ASTNode.InsideJavadoc) == 0 && refType instanceof TypeVariableBinding) { > refType.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; > } > // ignore references insing Javadoc comments >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java >index ba88a60..9e05d89 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 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 >@@ -604,6 +604,11 @@ > TypeBinding paramBindind = param.internalResolveType(scope); > if (paramBindind != null && paramBindind.isValidBinding()) { > if (paramBindind.isTypeVariable()) { >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888 >+ if (scope.compilerOptions().reportUnusedParameterIncludeDocCommentReference) { >+ TypeVariableBinding typeVariableBinding = (TypeVariableBinding) paramBindind; >+ typeVariableBinding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >+ } > // Verify duplicated tags > boolean duplicate = false; > for (int j = 0; j < i && !duplicate; j++) {
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 397888
:
225460
|
225599
|
225665
| 225788