Summary: | AST.parseCompilationUnit(IClassFile, boolean) should not throw an IllegalArgumentException no source is available | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 2.1 M5 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Dirk Baeumer
2003-01-28 12:35:45 EST
Why would you call this API on a classfile that has no source? The closest thing we could do to match the spec (no null is expected) would be an empty unit, but then you would need to know that no source is associated. An exception is a better way. I agree though that IllegalArgumentExceptions are not very helpful in this case... could improve the message at least. Would it be enough ? I changed our code to check if the class file as source by checking the source range. The reason why I filed the PR was that I wanted to avoid calling getSource before calling the parse method since otherwise we would have "created" the source twice. No action required from JDT/UI anymore |