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 209772 Details for
Bug 365582
FUP of bug 361938: Other error code pattern
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_365582.txt (text/plain), 3.79 KB, created by
Olivier Thomann
on 2012-01-19 14:48:19 EST
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2012-01-19 14:48:19 EST
Size:
3.79 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java >index 5bb5733..8970e8f 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -5265,6 +5265,16 @@ public class ASTTest extends org.eclipse.jdt.core.tests.junit.extension.TestCase > * @deprecated (Uses getLeadingComment() which is deprecated) > */ > public void testTryStatement() { >+ if (this.ast.apiLevel() <= AST.JLS3) { >+ // node type introduced in 4.0 API >+ try { >+ final TryStatement x = this.ast.newTryStatement(); >+ x.resources(); >+ assertTrue("should not be reached if jls level <= JLS3", false); >+ } catch (UnsupportedOperationException e) { >+ // pass >+ } >+ } > long previousCount = this.ast.modificationCount(); > final TryStatement x = this.ast.newTryStatement(); > assertTrue(this.ast.modificationCount() > previousCount); >diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java >index bb4b322..79575e1 100644 >--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java >+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -352,7 +352,7 @@ public class TryStatement extends Statement { > */ > public List resources() { > // more efficient than just calling unsupportedIn2_3() to check >- if (this.resources != null) { >+ if (this.resources == null) { > unsupportedIn2_3(); > } > return this.resources; >diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java >index 9394af1..b53e418 100644 >--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java >+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -1528,9 +1528,9 @@ public class NaiveASTFlattener extends ASTVisitor { > public boolean visit(TryStatement node) { > printIndent(); > this.buffer.append("try ");//$NON-NLS-1$ >- List resources = node.resources(); > if (node.getAST().apiLevel() >= AST.JLS4) { >- if (!node.resources().isEmpty()) { >+ List resources = node.resources(); >+ if (!resources.isEmpty()) { > this.buffer.append('('); > for (Iterator it = resources.iterator(); it.hasNext(); ) { > VariableDeclarationExpression variable = (VariableDeclarationExpression) it.next();
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 365582
: 209772