Bug 130140 - ASTParser should specify failure for IClassFile without source
Summary: ASTParser should specify failure for IClassFile without source
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-02 11:12 EST by Markus Keller CLA
Modified: 2006-03-28 08:26 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-03-02 11:12:46 EST
HEAD

ASTParser#createAST(..) currently throws this exception when called after setSource(IClassFile) for a class file without source attachment.

java.lang.IllegalStateException
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:783)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:616)

createAST(..) specifies that it can throw an ISE at any time, but since this case is fully predictable, I think at least the javadoc of setSource(IClassFile) should warn that the parser will fail if source is not available.

And while you're at the javadocs, there are also 2 glitches in the class doc:
- "// handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5" should include 1.6
- "settings are automicatically returned to their defaults" should be
  "settings are automatically reset to their defaults"
Comment 1 Olivier Thomann CLA 2006-03-09 20:01:14 EST
Fixed and released in HEAD.
To verify, please check the doc.
Comment 2 Jerome Lanneluc CLA 2006-03-28 08:26:54 EST
Verified for 3.2 M6 using build I20060328-0010