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 153869 Details for
Bug 236385
[compiler] Warn for potential programming problem if an object is created but not used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
bug_236385_patch2.txt (text/plain), 20.08 KB, created by
Stephan Herrmann
on 2009-12-05 14:44:07 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2009-12-05 14:44:07 EST
Size:
20.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.220 >diff -u -r1.220 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 11 Nov 2009 19:28:04 -0000 1.220 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 5 Dec 2009 19:33:22 -0000 >@@ -115,7 +115,8 @@ > * RedundantSuperinterface > * Benjamin Muskalla - added the following constants > * MissingSynchronizedModifierInInheritedMethod >- * >+ * Stephan Herrmann - added the following constants >+ * UnusedObjectAllocation > *******************************************************************************/ > package org.eclipse.jdt.core.compiler; > >@@ -428,6 +429,8 @@ > int UnhandledExceptionInImplicitConstructorCall = TypeRelated + 147; > > // expressions >+ /** @since 3.6 */ >+ int UnusedObjectAllocation = Internal + 148; > /** @since 3.5 */ > int DeadCode = Internal + 149; > int ArrayReferenceRequired = Internal + 150; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v >retrieving revision 1.82 >diff -u -r1.82 AllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 25 Nov 2009 04:56:02 -0000 1.82 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 5 Dec 2009 19:33:23 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Stephan Herrmann - Contribution for bug 236385 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >@@ -82,8 +83,11 @@ > } > > public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { >+ if (!valueRequired) >+ currentScope.problemReporter().unusedObjectAllocation(this); >+ > int pc = codeStream.position; >- MethodBinding codegenBinding = this.binding.original(); >+ MethodBinding codegenBinding = this.binding.original(); > ReferenceBinding allocatedType = codegenBinding.declaringClass; > > codeStream.new_(allocatedType); >Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.225 >diff -u -r1.225 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 26 Nov 2009 16:20:04 -0000 1.225 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 5 Dec 2009 19:33:27 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Benjamin Muskalla - Contribution for bug 239066 >+ * Stephan Herrmann - Contribution for bug 236385 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.impl; > >@@ -127,6 +128,7 @@ > public static final String OPTION_ReportDeadCode = "org.eclipse.jdt.core.compiler.problem.deadCode"; //$NON-NLS-1$ > public static final String OPTION_ReportDeadCodeInTrivialIfStatement = "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$ > public static final String OPTION_ReportTasks = "org.eclipse.jdt.core.compiler.problem.tasks"; //$NON-NLS-1$ >+ public static final String OPTION_ReportUnusedObjectAllocation = "org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation"; //$NON-NLS-1$ > > // Backward compatibility > public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$ >@@ -232,6 +234,7 @@ > public static final int ShouldImplementHashcode = IrritantSet.GROUP2 | ASTNode.Bit1; > public static final int DeadCode = IrritantSet.GROUP2 | ASTNode.Bit2; > public static final int Tasks = IrritantSet.GROUP2 | ASTNode.Bit3; >+ public static final int UnusedObjectAllocation = IrritantSet.GROUP2 | ASTNode.Bit4; > > // Severity level for handlers > /** >@@ -515,6 +518,8 @@ > return OPTION_ReportMissingHashCodeMethod; > case DeadCode : > return OPTION_ReportDeadCode; >+ case UnusedObjectAllocation: >+ return OPTION_ReportUnusedObjectAllocation; > } > return null; > } >@@ -641,6 +646,7 @@ > OPTION_ReportUnusedDeclaredThrownException, > OPTION_ReportUnusedImport, > OPTION_ReportUnusedLocal, >+ OPTION_ReportUnusedObjectAllocation, > OPTION_ReportUnusedParameter, > OPTION_ReportUnusedPrivateMember, > OPTION_ReportVarargsArgumentNeedCast, >@@ -701,6 +707,7 @@ > case UnusedPrivateMember : > case UnusedDeclaredThrownException : > case DeadCode : >+ case UnusedObjectAllocation : > return "unused"; //$NON-NLS-1$ > case DiscouragedReference : > case ForbiddenReference : >@@ -891,6 +898,7 @@ > optionsMap.put(OPTION_ReportDeadCode, getSeverityString(DeadCode)); > optionsMap.put(OPTION_ReportDeadCodeInTrivialIfStatement, this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED); > optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks)); >+ optionsMap.put(OPTION_ReportUnusedObjectAllocation, getSeverityString(UnusedObjectAllocation)); > return optionsMap; > } > >@@ -1287,6 +1295,7 @@ > if ((optionValue = optionsMap.get(OPTION_ReportMissingHashCodeMethod)) != null) updateSeverity(ShouldImplementHashcode, optionValue); > if ((optionValue = optionsMap.get(OPTION_ReportDeadCode)) != null) updateSeverity(DeadCode, optionValue); > if ((optionValue = optionsMap.get(OPTION_ReportTasks)) != null) updateSeverity(Tasks, optionValue); >+ if ((optionValue = optionsMap.get(OPTION_ReportUnusedObjectAllocation)) != null) updateSeverity(UnusedObjectAllocation, optionValue); > > // Javadoc options > if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) { >@@ -1488,6 +1497,7 @@ > buf.append("\n\t- dead code: ").append(getSeverityString(DeadCode)); //$NON-NLS-1$ > buf.append("\n\t- dead code in trivial if statement: ").append(this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED); //$NON-NLS-1$ > buf.append("\n\t- tasks severity: ").append(getSeverityString(Tasks)); //$NON-NLS-1$ >+ buf.append("\n\t- unused object allocation: ").append(getSeverityString(UnusedObjectAllocation)); //$NON-NLS-1$ > return buf.toString(); > } > >Index: compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java,v >retrieving revision 1.8 >diff -u -r1.8 IrritantSet.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 6 Oct 2009 19:24:18 -0000 1.8 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 5 Dec 2009 19:33:27 -0000 >@@ -97,7 +97,8 @@ > // group-2 warnings enabled by default > .set( > CompilerOptions.DeadCode >- |CompilerOptions.Tasks); >+ |CompilerOptions.Tasks >+ |CompilerOptions.UnusedObjectAllocation); > > ALL.setAll(); > HIDING >@@ -117,7 +118,8 @@ > .set(CompilerOptions.UnusedImport) > .set(CompilerOptions.UnusedTypeArguments) > .set(CompilerOptions.RedundantSuperinterface) >- .set(CompilerOptions.DeadCode); >+ .set(CompilerOptions.DeadCode) >+ .set(CompilerOptions.UnusedObjectAllocation); > String suppressRawWhenUnchecked = System.getProperty("suppressRawWhenUnchecked"); //$NON-NLS-1$ > if (suppressRawWhenUnchecked != null && "true".equalsIgnoreCase(suppressRawWhenUnchecked)) { //$NON-NLS-1$ > UNCHECKED.set(CompilerOptions.RawTypeReference); >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.402 >diff -u -r1.402 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 23 Nov 2009 16:45:35 -0000 1.402 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 5 Dec 2009 19:33:40 -0000 >@@ -414,6 +414,9 @@ > > case IProblem.Task : > return CompilerOptions.Tasks; >+ >+ case IProblem.UnusedObjectAllocation: >+ return CompilerOptions.UnusedObjectAllocation; > } > return 0; > } >@@ -464,6 +467,7 @@ > case CompilerOptions.MissingSynchronizedModifierInInheritedMethod : > case CompilerOptions.ShouldImplementHashcode : > case CompilerOptions.DeadCode : >+ case CompilerOptions.UnusedObjectAllocation : > return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM; > > case CompilerOptions.OverriddenPackageDefaultMethod : >@@ -7124,6 +7128,14 @@ > localDecl.sourceStart, > localDecl.sourceEnd); > } >+public void unusedObjectAllocation(AllocationExpression allocationExpression) { >+ this.handle( >+ IProblem.UnusedObjectAllocation, >+ NoArgument, >+ NoArgument, >+ allocationExpression.sourceStart, >+ allocationExpression.sourceEnd); >+} > public void unusedPrivateConstructor(ConstructorDeclaration constructorDecl) { > > int severity = computeSeverity(IProblem.UnusedPrivateConstructor); >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.255 >diff -u -r1.255 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 11 Nov 2009 19:28:04 -0000 1.255 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 5 Dec 2009 19:33:42 -0000 >@@ -123,6 +123,8 @@ > 146 = Default constructor cannot handle exception type {0} thrown by implicit super constructor. Must define an explicit constructor > 147 = Unhandled exception type {0} thrown by implicit super constructor > >+ >+148 = Allocating an object that is never used > 149 = Dead code > 150 = The type of the expression must be an array type but it resolved to {0} > 151 = Must explicitly convert the char[] to a String >Index: model/org/eclipse/jdt/core/JavaCore.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v >retrieving revision 1.643 >diff -u -r1.643 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 26 Oct 2009 17:21:09 -0000 1.643 >+++ model/org/eclipse/jdt/core/JavaCore.java 5 Dec 2009 19:33:52 -0000 >@@ -81,7 +81,9 @@ > * COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE > * IBM Corporation - added getOptionForConfigurableSeverity(int) > * Benjamin Muskalla - added COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD >+ * Stephan Herrmann - added COMPILER_PB_UNUSED_OBJECT_ALLOCATION > *******************************************************************************/ >+ > package org.eclipse.jdt.core; > > import java.util.ArrayList; >@@ -1541,6 +1543,19 @@ > */ > public static final String COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD = PLUGIN_ID + ".compiler.problem.missingSynchronizedOnInheritedMethod"; //$NON-NLS-1$ > /** >+ * Compiler option ID: Reporting Allocation of an Unused Object. >+ * <p>When enabled, the compiler will issue an error or a warning if an object is allocated but never used, >+ * neither by holding a reference nor by invoking one of the object's methods. >+ * <dl> >+ * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation"</code></dd> >+ * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> >+ * <dt>Default:</dt><dd><code>"warning"</code></dd> >+ * </dl> >+ * @since 3.6 >+ * @category CompilerOptionID >+ */ >+ public static final String COMPILER_PB_UNUSED_OBJECT_ALLOCATION = PLUGIN_ID + ".compiler.problem.unusedObjectAllocation"; //$NON-NLS-1$ >+ /** > * Core option ID: Computing Project Build Order. > * <p>Indicate whether JavaCore should enforce the project build order to be based on > * the classpath prerequisite chain. When requesting to compute, this takes over >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.199 >diff -u -r1.199 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 7 Oct 2009 14:58:12 -0000 1.199 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 5 Dec 2009 19:34:10 -0000 >@@ -1856,6 +1856,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference\" value=\"enabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + >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.33 >diff -u -r1.33 CompilerInvocationTests.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 12 Nov 2009 17:37:03 -0000 1.33 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 5 Dec 2009 19:34:15 -0000 >@@ -843,6 +843,7 @@ > expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); > expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); > expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); >+ expectedProblemAttributes.put("UnusedObjectAllocation", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); > expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); > expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); > expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); >@@ -1475,6 +1476,7 @@ > expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_IMPORT)); > expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LABEL)); > expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); >+ expectedProblemAttributes.put("UnusedObjectAllocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_OBJECT_ALLOCATION)); > expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); > expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); > expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); >Index: src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java,v >retrieving revision 1.39 >diff -u -r1.39 FlowAnalysisTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 28 Apr 2009 17:17:32 -0000 1.39 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 5 Dec 2009 19:34:18 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Stephan Herrmann - Contribution for bug 236385 > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >@@ -2021,6 +2022,123 @@ > "Unreachable code\n" + > "----------\n"); > } >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+public void test063() { >+ runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; } \n" + >+ " public void foo() {" + >+ " if (bar())\n" + >+ " new IllegalArgumentException(\"You must not bar!\");\n" + >+ " }\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 4)\n" + >+ " new IllegalArgumentException(\"You must not bar!\");\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Allocating an object that is never used\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+// non-throwable type >+public void test064() { >+ runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; } \n" + >+ " public void foo() {" + >+ " if (bar())\n" + >+ " new String(\"You must not bar!\");\n" + >+ " }\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 4)\n" + >+ " new String(\"You must not bar!\");\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Allocating an object that is never used\n" + >+ "----------\n"); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+// warning suppressed >+public void test065() { >+ if (this.complianceLevel < ClassFileConstants.JDK1_5) return; >+ runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; }\n" + >+ " @SuppressWarnings(\"unused\")\n" + >+ " public void foo() {" + >+ " if (bar())\n" + >+ " new IllegalArgumentException(\"You must not bar!\");\n" + >+ " }\n" + >+ "}", >+ }); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+// warning ignored >+public void test066() { >+ Map compilerOptions = getCompilerOptions(); >+ compilerOptions.put(CompilerOptions.OPTION_ReportUnusedObjectAllocation, CompilerOptions.IGNORE); >+ runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; }\n" + >+ " public void foo() {" + >+ " if (bar())\n" + >+ " new IllegalArgumentException(\"You must not bar!\");\n" + >+ " }\n" + >+ "}", >+ }, >+ "" /* expectedOutputString */, >+ null /* classLib */, >+ true /* shouldFlushOutputDirectory */, >+ null /* vmArguments */, >+ compilerOptions /* customOptions */, >+ null /* clientRequestor */); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+// instance is assigned >+public void test067() { >+ runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; }\n" + >+ " Throwable t;\n" + >+ " public void foo() {" + >+ " t = new IllegalArgumentException(\"You must not bar!\");\n" + >+ " }\n" + >+ "}", >+ }); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 >+// method invoked >+public void test068() { >+ runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " boolean bar() { return false; }\n" + >+ " public void foo() {" + >+ " if (bar())\n" + >+ " new IllegalArgumentException(\"You must not bar!\").printStackTrace();\n" + >+ " }\n" + >+ "}", >+ }); >+} >+ > public static Class testClass() { > return FlowAnalysisTest.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 236385
:
110739
|
111358
|
153869
|
155923
|
155983
|
155987
|
155989
|
156030