Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340365

Summary: [1.7] Problems in new APIs (TryStatementWithResources, DisjunctiveType)
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 340375    
Bug Blocks:    
Attachments:
Description Flags
More fixes
none
Proposed fix none

Description Markus Keller CLA 2011-03-17 15:21:44 EDT
BETA_JAVA7

Problems in TryStatementWithResources:
- wrong @since 3.0 tags
- order of properties in PROPERTY_DESCRIPTORS should be declaration order. In the static initializer, the line
		addProperty(RESOURCES_PROPERTY, propertyList);
should be moved to before
		addProperty(BODY_PROPERTY, propertyList);

- for consistency, also the fields would better be ordered the same way (move "ASTNode.NodeList resources" up), and treeSize() should also be ordered

- constructor Javadoc should say "... the try statement has no resources, ..."

- in AST#newTryStatementWithResources(), "no resources" should also be moved to front

- clone0(*) and internalGetChildListProperty(*) are missing "resources"

- memSize() should contain 4 * 4 (one field added)


Problems in DisjunctiveType:
- wrong @since 3.0 tags
- type Javadoc
  - is missing grammar
  - typo: "inside as catch formal parameter type": as -> a
- compare DisjunctiveType.java with e.g. ParameterizedType.java and remove all unnecessary inconsistencies (e.g. ordering)
Comment 1 Markus Keller CLA 2011-03-17 17:14:51 EDT
The problems in TryStatementWithResources should be resolved when that node type gets integrated into TryStatement (see bug 340375).
Comment 2 Markus Keller CLA 2011-03-17 17:19:48 EDT
The grammar of TryStatementWithResources is also wrong:
It contains "[ CatchClause ]", but that should be "{ CatchClause }".
Comment 3 Olivier Thomann CLA 2011-03-17 21:33:53 EDT
(In reply to comment #2)
> The grammar of TryStatementWithResources is also wrong:
> It contains "[ CatchClause ]", but that should be "{ CatchClause }".
[..] means optional. So [ CatchClause ] is right for the TWR statement. You don't need to have catch clauses.
I'll fix the remaining issues by merging with the TryStatement.
Comment 4 Olivier Thomann CLA 2011-03-18 10:47:24 EDT
Released for 3.7M7 in BETA_JAVA7 branch.
Comment 5 Markus Keller CLA 2011-03-18 11:44:58 EDT
Created attachment 191520 [details]
More fixes

Here's a bunch of additional fixes for the new APIs. The changes in ASTNode are to ensure that nothing needs to be touched again when JLS5 is added.

The changes in ClassInstanceCreation and QualifiedType are just typos that should also be corrected in HEAD.
Comment 6 Markus Keller CLA 2011-03-18 11:45:43 EDT
.
Comment 7 Olivier Thomann CLA 2011-03-18 12:00:41 EDT
Released. Thx for the patch.
Comment 8 Olivier Thomann CLA 2011-03-18 12:44:12 EDT
Created attachment 191525 [details]
Proposed fix

Extracted the part that needs to be released in HEAD.
Comment 9 Olivier Thomann CLA 2011-03-18 12:44:30 EDT
Released in HEAD.
Comment 10 Jay Arthanareeswaran CLA 2011-06-29 07:38:57 EDT
Verified.