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 225599 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]
Fix for JDT Core - Work In Progess.
Bug-397888---Unused-type-parameter-problem-should-al.patch.WIP (text/plain), 4.83 KB, created by
Manoj N Palat
on 2013-01-14 23:25:34 EST
(
hide
)
Description:
Fix for JDT Core - Work In Progess.
Filename:
MIME Type:
Creator:
Manoj N Palat
Created:
2013-01-14 23:25:34 EST
Size:
4.83 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..26b2679 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 >@@ -2750,4 +2750,62 @@ > }); > } > >+// 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_ReportUnusedParameterIncludeDocCommentReference, >+ CompilerOptions.ENABLED); >+ >+ this.runConformTest(new String[] { >+ "X.java", >+ "public class X {\n"+ >+ "/***" + >+ " * @param S" + >+ " * @param t" + >+ " * @param k" + >+ " */" + >+ "public <S> void ph(int t) {\n"+ >+ "}\n"+ >+ "}\n" >+ }, >+ null /* no expected output string */, >+ null /* no extra class libraries */, >+ true /* flush output directory */, >+ null /* no vm arguments */, >+ customOptions, >+ null /* no custom requestor*/, >+ false /* do not skip javac for this peculiar test */); >+} >+ >+// 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", >+ "public class X {\n"+ >+ "/***" + >+ " * @param S" + >+ " * @param t" + >+ " * @param k" + >+ " */" + >+ "public <S> void ph(int t) {\n"+ >+ "}\n"+ >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " /*** * @param S * @param t * @param k */public <S> void ph(int t) {\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/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java >index ba88a60..230bd9d 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 >@@ -582,6 +582,20 @@ > return; > } > >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=397888 >+ boolean considerParamRefAsUsage = scope.compilerOptions().reportUnusedParameterIncludeDocCommentReference; >+ if (considerParamRefAsUsage) { >+ int paramTagsSize = this.paramReferences == null ? 0 : this.paramReferences.length; >+ for (int i = 0; i < paramTagsSize; i++) { >+ JavadocSingleNameReference param = this.paramReferences[i]; >+ TypeBinding typeBinding = scope.getType(param.token); >+ if (typeBinding != null && typeBinding instanceof ReferenceBinding) { >+ ReferenceBinding referenceBinding = (ReferenceBinding) typeBinding; >+ referenceBinding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >+ } >+ } >+ } >+ > // If no param tags then report a problem for each declaration type parameter > if (parameters != null) { > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850, avoid secondary errors when <= 1.4
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