Community
Participate
Working Groups
In the JDT Java model, both ICompilationUnit and IClassFile consist of pretty much the same elements: ITypes, IMethods and IFields. The interface ITypeRoot is the common protocol for ICompilationUnit and IClassFile. It is important to note that, unlike a compilation unit, a class file might not have a corresponding workspace file (for example, it may reside in a jar file outside the workspace). In Handly, the existing design is that ISourceElements must be contained in a ISourceFile that is located in the Eclipse workspace (ISourceElement#getSourceFile and ISourceFile#getFile never return null according to their contracts). This makes it impossible to implement models like the Java model that describe (the contents of) "binary modules" in roughly the same terms as "source modules". This design flaw should be addressed as early as possible, i.e. in Handly 0.3. To that end, a new interface, IModule, is proposed that roughly corresponds to ITypeRoot in JDT. IModule will extend ISourceElement, and will be extended by ISourceFile. ISourceElement will get a new method #getModule() that never returns null. The existing #getSourceFile() method will be removed (this is the only breaking change in the proposed redesign). See https://dev.eclipse.org/mhonarc/lists/handly-dev/msg00087.html for the original discussion.
Gerrit change https://git.eclipse.org/r/42906 was merged to [master]. Commit: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=ddea315852a5915434205bc2205899c19ae5335a
Pushed to master.
Reopened due to a discussion on handly-dev: https://dev.eclipse.org/mhonarc/lists/handly-dev/msg00102.html
Reverted commit ddea315852a5915434205bc2205899c19ae5335a.
New Gerrit change created: https://git.eclipse.org/r/43942
Gerrit change https://git.eclipse.org/r/43942 was merged to [master]. Commit: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=bb6c198f828dff8435d4c98614b45efebd3ec732
Here's the complete list of breaking changes: * ISourceElement#getSourceFile() got removed * ISourceElementInfo#getSnapshot() may now return null (if no source is available) * ISourceElementInfo#getFullRange() and #getIdentifyingRange() may now return null, but may no more return a NULL_RANGE (see below) * TextRange#isNull() and #NULL_RANGE got removed. The special source range with a -1 offset and a 0 length is a JDT legacy that I did not readily identified as such. It would be very painful to deprecate it (JDT couldn't): that's why we have to do it as soon as possible. For reference, see bug 130161