Bug 112327 - Inconsistent behavior of getSourceRange()
Summary: Inconsistent behavior of getSourceRange()
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-12 08:47 EDT by Dani Megert CLA
Modified: 2007-06-22 05:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2005-10-12 08:47:10 EDT
I20051011-1655 (but also in R3.0)

Have the following:
JP
 + f1
   + A.class
 + f2
   + B.class
   + B.java

where f1 and f2 aren't on the build path and are not declared as output folder

If I call A.getSourceRange() I get null but if a call C.getSourceSourceRange() I
get:
org.eclipse.core.runtime.CoreException: The classfile is not on the classpath
Comment 1 Philipe Mulet CLA 2005-10-12 08:52:41 EDT
Jerome: Could we make source attachment be part of the minimal behavior for
these ? I suspect this is what Dani has in mind, as opposed to getting an
exception for both.
Comment 2 Dani Megert CLA 2005-10-12 09:19:07 EDT
Yes, that would be nice: for A.class we currently show the disassembled code and
we also prevent the attach source buttons to appear. It would be nice if B.class
would behave the same or even nicer, would return B.java as its source.
Comment 3 Jerome Lanneluc CLA 2007-06-22 05:48:07 EDT
Using 3.3RC4, getSourceRange() now returns null in both case. 
So this bug is now an enhancement request to have the source for B.class be B.java.