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 194931 Details for
Bug 343621
Setting "Unchecked generic type operation" to Error is disabling/hiding other Warning settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_343621_2.txt (text/plain), 3.53 KB, created by
Olivier Thomann
on 2011-05-06 09:25:15 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-05-06 09:25:15 EDT
Size:
3.53 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java,v >retrieving revision 1.92 >diff -u -r1.92 CompilationUnitDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 5 May 2011 14:29:58 -0000 1.92 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 6 May 2011 13:18:44 -0000 >@@ -215,7 +215,9 @@ > CategorizedProblem[] problems = this.compilationResult.problems; > int problemCount = this.compilationResult.problemCount; > for (int i = 0; i < problemCount; i++) { >- if (problems[i].getID() == IProblem.LocalVariableIsNeverUsed) { >+ CategorizedProblem currentProblem = problems[i]; >+ if (currentProblem.getID() == IProblem.LocalVariableIsNeverUsed >+ && currentProblem.isWarning()) { > problems[i] = null; > removed++; > } >@@ -299,7 +301,9 @@ > if (remainingErrors > 0) { > for (int i = 0; i < problemCount; i++) { > CategorizedProblem problem; >- if ((problem = problems[i]) != null && problem.getID() == IProblem.LocalVariableIsNeverUsed) { >+ if ((problem = problems[i]) != null >+ && problem.getID() == IProblem.LocalVariableIsNeverUsed >+ && problem.isWarning()) { > problems[i] = null; > removed++; > } >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java,v >retrieving revision 1.19 >diff -u -r1.19 LocalVariableTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java 22 Oct 2010 22:42:32 -0000 1.19 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java 6 May 2011 13:18:46 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 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 >@@ -714,6 +714,32 @@ > // javac options > JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=343621 >+public void test021() { >+ Map options = getCompilerOptions(); >+ options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.ERROR); >+ runNegativeTest( >+ new String[] { /* test files */ >+ "X.java", >+ "public class X {\n" + >+ " public Object[] foo() {\n" + >+ " Object[] i, j= new Object[0];\n" + >+ " i= j = null;\n" + >+ " i= (new Object[] { null, null });\n" + >+ " return j;\n" + >+ " }\n" + >+ "}", // ================= >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object[] i, j= new Object[0];\n" + >+ " ^\n" + >+ "The value of the local variable i is not used\n" + >+ "----------\n", >+ null /* no class libraries */, >+ true, >+ options /* custom options */); >+} > public static Class testClass() { > return LocalVariableTest.class; > }
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 343621
:
194283
|
194284
|
194745
|
194832
| 194931