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 190131 Details for
Bug 338402
[1.7][compiler][enh] Open issues in try with resources implementation
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 - part 3
patch.txt (text/plain), 24.35 KB, created by
Srikanth Sankaran
on 2011-03-02 06:57:53 EST
(
hide
)
Description:
Patch - part 3
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2011-03-02 06:57:53 EST
Size:
24.35 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java,v >retrieving revision 1.116.2.5 >diff -u -r1.116.2.5 TryStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java 1 Mar 2011 13:27:51 -0000 1.116.2.5 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java 2 Mar 2011 11:56:35 -0000 >@@ -15,6 +15,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.*; >@@ -105,6 +106,17 @@ > > for (int i = 0, max = this.resources.length; i < max; i++) { > flowInfo = this.resources[i].analyseCode(currentScope, handlingContext, flowInfo.copy()); >+ TypeBinding type = this.resources[i].binding.type; >+ if (type != null && type.isValidBinding()) { >+ ReferenceBinding binding = (ReferenceBinding) type; >+ MethodBinding closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter >+ if (closeMethod != null && closeMethod.returnType.id == TypeIds.T_void) { >+ ReferenceBinding[] thrownExceptions = closeMethod.thrownExceptions; >+ for (int j = 0, length = thrownExceptions.length; j < length; j++) { >+ handlingContext.checkExceptionHandlers(thrownExceptions[j], this.resources[i], flowInfo, currentScope); >+ } >+ } >+ } > } > FlowInfo tryInfo; > if (this.tryBlock.isEmptyBlock()) { >@@ -217,6 +229,17 @@ > > for (int i = 0, max = this.resources.length; i < max; i++) { > flowInfo = this.resources[i].analyseCode(currentScope, handlingContext, flowInfo.copy()); >+ TypeBinding type = this.resources[i].binding.type; >+ if (type != null && type.isValidBinding()) { >+ ReferenceBinding binding = (ReferenceBinding) type; >+ MethodBinding closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter >+ if (closeMethod != null && closeMethod.returnType.id == TypeIds.T_void) { >+ ReferenceBinding[] thrownExceptions = closeMethod.thrownExceptions; >+ for (int j = 0, length = thrownExceptions.length; j < length; j++) { >+ handlingContext.checkExceptionHandlers(thrownExceptions[j], this.resources[j], flowInfo, currentScope); >+ } >+ } >+ } > } > FlowInfo tryInfo; > if (this.tryBlock.isEmptyBlock()) { >@@ -796,9 +819,11 @@ > if (resourceType.isClass() || resourceType.isInterface()) { > if (resourceType.findSuperTypeOriginatingFrom(TypeIds.T_JavaLangAutoCloseable, false /*AutoCloseable is not a class*/) == null && resourceType.isValidBinding()) { > upperScope.problemReporter().resourceHasToBeAutoCloseable(resourceType, this.resources[i].type); >+ localVariableBinding.type = new ProblemReferenceBinding(CharOperation.splitOn('.', resourceType.shortReadableName()), null, ProblemReasons.InvalidTypeForAutoManagedResource); > } > } else { > upperScope.problemReporter().resourceHasToBeAutoCloseable(resourceType, this.resources[i].type); >+ localVariableBinding.type = new ProblemReferenceBinding(CharOperation.splitOn('.', resourceType.shortReadableName()), null, ProblemReasons.InvalidTypeForAutoManagedResource); > } > } > localScope = new BlockScope(localScope, 1); >Index: compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java,v >retrieving revision 1.61.8.3 >diff -u -r1.61.8.3 ConstantPool.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 2 Feb 2011 20:24:20 -0000 1.61.8.3 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 2 Mar 2011 11:56:36 -0000 >@@ -75,6 +75,7 @@ > public static final char[] Clinit = "<clinit>".toCharArray(); //$NON-NLS-1$ > public static final char[] DefaultConstructorSignature = "()V".toCharArray(); //$NON-NLS-1$ > public static final char[] ClinitSignature = DefaultConstructorSignature; >+ public static final char[] Close = "close".toCharArray(); //$NON-NLS-1$ > public static final char[] DesiredAssertionStatus = "desiredAssertionStatus".toCharArray(); //$NON-NLS-1$ > public static final char[] DesiredAssertionStatusSignature = "()Z".toCharArray(); //$NON-NLS-1$ > public static final char[] DoubleConstrSignature = "(D)V".toCharArray(); //$NON-NLS-1$ >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java,v >retrieving revision 1.14 >diff -u -r1.14 ProblemReasons.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java 10 May 2006 18:03:50 -0000 1.14 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java 2 Mar 2011 11:56:36 -0000 >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -26,4 +30,5 @@ > final int ParameterizedMethodTypeMismatch = 12; // for generic method > final int TypeArgumentsForRawGenericMethod = 13; // for generic method > final int InvalidTypeForStaticImport = 14; >+ final int InvalidTypeForAutoManagedResource = 15; > } >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Attic/TryWithResourcesStatementTest.java,v >retrieving revision 1.1.2.8 >diff -u -r1.1.2.8 TryWithResourcesStatementTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java 1 Mar 2011 13:26:16 -0000 1.1.2.8 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java 2 Mar 2011 11:56:40 -0000 >@@ -540,41 +540,430 @@ > "Syntax error on token \"(\", Resources expected after this token\n" + > "----------\n"); > } >-public void test019() { >+public void test020() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements AutoCloseable {\n" + >+ " public static void main(String [] args) {\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " throw new XXException();\n" + >+ " } catch (XException x) {\n" + >+ " } catch (YException y) {\n" + >+ " } catch (ZException z) {\n" + >+ " } finally {\n" + >+ " }\n" + >+ " }\n" + >+ " public X() throws XException {\n" + >+ " throw new XException();\n" + >+ " }\n" + >+ " public void close() throws XXException {\n" + >+ " throw new XXException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Y implements AutoCloseable {\n" + >+ " public Y() throws YException {\n" + >+ " throw new YException();\n" + >+ " }\n" + >+ " public void close() throws YYException {\n" + >+ " throw new YYException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Z implements AutoCloseable {\n" + >+ " public Z() throws ZException {\n" + >+ " throw new ZException();\n" + >+ " }\n" + >+ " public void close() throws ZZException {\n" + >+ " throw new ZZException();\n" + >+ " }\n" + >+ "}\n" + >+ "class XException extends Exception {}\n" + >+ "class XXException extends Exception {}\n" + >+ "class YException extends Exception {}\n" + >+ "class YYException extends Exception {}\n" + >+ "class ZException extends Exception {}\n" + >+ "class ZZException extends Exception {}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Unhandled exception type XXException\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Unhandled exception type YYException\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^\n" + >+ "Unhandled exception type ZZException\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 4)\n" + >+ " throw new XXException();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Unhandled exception type XXException\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 34)\n" + >+ " class XException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 35)\n" + >+ " class XXException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 36)\n" + >+ " class YException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "8. WARNING in X.java (at line 37)\n" + >+ " class YYException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "9. WARNING in X.java (at line 38)\n" + >+ " class ZException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "10. WARNING in X.java (at line 39)\n" + >+ " class ZZException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n"); >+} >+public void test021() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public void method1(){\n" + >+ " try (Y i = null) {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" + >+ "class Y {\n" + >+ " public void close () {}\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " try (Y i = null) {\n" + >+ " ^\n" + >+ "The resource type Y has to be a subclass of java.lang.AutoCloseable \n" + >+ "----------\n"); >+} >+public void test022() { > this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >+ " public void method1(){\n" + >+ " try (Y i = null) {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" + >+ "class Y implements AutoCloseable {\n" + >+ " public int close () { return 0; }\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 9)\n" + >+ " public int close () { return 0; }\n" + >+ " ^^^\n" + >+ "The return type is incompatible with AutoCloseable.close()\n" + >+ "----------\n"); >+} >+public void test023() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public void method1(){\n" + >+ " try (Y i = null) {\n" + >+ " System.out.println();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" + >+ "class Y implements AutoCloseable {\n" + >+ " public void close () throws Blah {}\n" + >+ "}\n" + >+ "class Blah extends Throwable {}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " try (Y i = null) {\n" + >+ " ^\n" + >+ "Unhandled exception type Blah\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 9)\n" + >+ " public void close () throws Blah {}\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Exception Blah is not compatible with throws clause in AutoCloseable.close()\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 11)\n" + >+ " class Blah extends Throwable {}\n" + >+ " ^^^^\n" + >+ "The serializable class Blah does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n"); >+} >+public void test024() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements AutoCloseable {\n" + > " public static void main(String [] args) {\n" + >- " try (Y y = null) {\n" + >- " } catch (Exception e) {\n" + >- " System.out.println(y); \n" + >- " } finally {\n" + >- " System.out.println(y); \n" + >- " }\n" + >- " System.out.println(y); \n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " throw new XXException();\n" + >+ " } catch (XException x) {\n" + >+ " } catch (YException y) {\n" + >+ " } catch (ZException z) {\n" + >+ " } catch (XXException x) {\n" + >+ " } catch (YYException y) {\n" + >+ " } catch (ZZException z) {\n" + >+ " } finally {\n" + >+ " }\n" + >+ " }\n" + >+ " public X() throws XException {\n" + >+ " throw new XException();\n" + >+ " }\n" + >+ " public void close() throws XXException {\n" + >+ " throw new XXException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Y implements AutoCloseable {\n" + >+ " public Y() throws YException {\n" + >+ " throw new YException();\n" + >+ " }\n" + >+ " public void close() throws YYException {\n" + >+ " throw new YYException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Z implements AutoCloseable {\n" + >+ " public Z() throws ZException {\n" + >+ " throw new ZException();\n" + >+ " }\n" + >+ " public void close() throws ZZException {\n" + >+ " throw new ZZException();\n" + >+ " }\n" + >+ "}\n" + >+ "class XException extends Exception {}\n" + >+ "class XXException extends Exception {}\n" + >+ "class YException extends Exception {}\n" + >+ "class YYException extends Exception {}\n" + >+ "class ZException extends Exception {}\n" + >+ "class ZZException extends Exception {}\n" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 37)\n" + >+ " class XException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 38)\n" + >+ " class XXException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 39)\n" + >+ " class YException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "4. WARNING in X.java (at line 40)\n" + >+ " class YYException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 41)\n" + >+ " class ZException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 42)\n" + >+ " class ZZException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n"); >+} >+public void test025() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements AutoCloseable {\n" + >+ " public static void main(String [] args) {\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " throw new XXException();\n" + >+ " } catch (XException x) {\n" + >+ " } catch (YException y) {\n" + >+ " } catch (ZException z) {\n" + >+ " \n" + >+ " }\n" + >+ " }\n" + >+ " public X() throws XException {\n" + >+ " throw new XException();\n" + >+ " }\n" + >+ " public void close() throws XXException {\n" + >+ " throw new XXException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Y implements AutoCloseable {\n" + >+ " public Y() throws YException {\n" + >+ " throw new YException();\n" + >+ " }\n" + >+ " public void close() throws YYException {\n" + >+ " throw new YYException();\n" + >+ " }\n" + >+ "}\n" + >+ "class Z implements AutoCloseable {\n" + >+ " public Z() throws ZException {\n" + >+ " throw new ZException();\n" + >+ " }\n" + >+ " public void close() throws ZZException {\n" + >+ " throw new ZZException();\n" + >+ " }\n" + >+ "}\n" + >+ "class XException extends Exception {}\n" + >+ "class XXException extends Exception {}\n" + >+ "class YException extends Exception {}\n" + >+ "class YYException extends Exception {}\n" + >+ "class ZException extends Exception {}\n" + >+ "class ZZException extends Exception {}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Unhandled exception type XXException\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Unhandled exception type YYException\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 3)\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " ^\n" + >+ "Unhandled exception type ZZException\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 4)\n" + >+ " throw new XXException();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Unhandled exception type XXException\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 34)\n" + >+ " class XException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 35)\n" + >+ " class XXException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 36)\n" + >+ " class YException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "8. WARNING in X.java (at line 37)\n" + >+ " class YYException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "9. WARNING in X.java (at line 38)\n" + >+ " class ZException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "10. WARNING in X.java (at line 39)\n" + >+ " class ZZException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n"); >+} >+public void test026() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements AutoCloseable {\n" + >+ " public static void main(String [] args) {\n" + >+ " try (X x = new X(); Y y = new Y(); Z z = new Z()) {\n" + >+ " throw new XXException();\n" + >+ " } catch (XException x) {\n" + >+ " } catch (YException y) {\n" + >+ " } catch (ZException z) {\n" + >+ " } catch (XXException x) {\n" + >+ " } catch (YYException y) {\n" + >+ " } catch (ZZException z) {\n\n" + >+ " }\n" + >+ " }\n" + >+ " public X() throws XException {\n" + >+ " throw new XException();\n" + >+ " }\n" + >+ " public void close() throws XXException {\n" + >+ " throw new XXException();\n" + > " }\n" + > "}\n" + > "class Y implements AutoCloseable {\n" + >- " public void close() {\n" + >+ " public Y() throws YException {\n" + >+ " throw new YException();\n" + >+ " }\n" + >+ " public void close() throws YYException {\n" + >+ " throw new YYException();\n" + > " }\n" + >- "}\n" >+ "}\n" + >+ "class Z implements AutoCloseable {\n" + >+ " public Z() throws ZException {\n" + >+ " throw new ZException();\n" + >+ " }\n" + >+ " public void close() throws ZZException {\n" + >+ " throw new ZZException();\n" + >+ " }\n" + >+ "}\n" + >+ "class XException extends Exception {}\n" + >+ "class XXException extends Exception {}\n" + >+ "class YException extends Exception {}\n" + >+ "class YYException extends Exception {}\n" + >+ "class ZException extends Exception {}\n" + >+ "class ZZException extends Exception {}\n" > }, > "----------\n" + >- "1. ERROR in X.java (at line 5)\n" + >- " System.out.println(y); \n" + >- " ^\n" + >- "y cannot be resolved to a variable\n" + >+ "1. WARNING in X.java (at line 37)\n" + >+ " class XException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class XException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 38)\n" + >+ " class XXException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class XXException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 39)\n" + >+ " class YException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class YException does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "4. WARNING in X.java (at line 40)\n" + >+ " class YYException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class YYException does not declare a static final serialVersionUID field of type long\n" + > "----------\n" + >- "2. ERROR in X.java (at line 7)\n" + >- " System.out.println(y); \n" + >- " ^\n" + >- "y cannot be resolved to a variable\n" + >+ "5. WARNING in X.java (at line 41)\n" + >+ " class ZException extends Exception {}\n" + >+ " ^^^^^^^^^^\n" + >+ "The serializable class ZException does not declare a static final serialVersionUID field of type long\n" + > "----------\n" + >- "3. ERROR in X.java (at line 9)\n" + >- " System.out.println(y); \n" + >- " ^\n" + >- "y cannot be resolved to a variable\n" + >+ "6. WARNING in X.java (at line 42)\n" + >+ " class ZZException extends Exception {}\n" + >+ " ^^^^^^^^^^^\n" + >+ "The serializable class ZZException does not declare a static final serialVersionUID field of type long\n" + > "----------\n"); > } > public static Class testClass() {
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 338402
:
190016
|
190034
| 190131 |
190659
|
190744
|
190751