jdt core - Breaking API changes from R2.1 to R3.0
java development tooling core |
This document lists all API changes (breaking or not) that occured between R2.1 and R3.0 and how to migrate from the R2.1 API to the R3.0 API. |
IWorkingCopy
now extends ICompilationUnit
(see bug 36987 )
Historically, IWorkingCopy
gathered all working copy concerns,
and ICompilationUnit
implement this interface, though only the
factory method makes sense for them; thus their implementation of the working
copy features do nothing relevant to clients. IWorkingCopy
also
implements the spec'ed factory method, but it doesn't work for these.
Clients using IWorkingCopy
and ICompilationUnit
can
adapt to this change by referencing IWorkingCopy
instead of
ICompilationUnit
when a working copy is needed.
IWorkingCopies
(i.e.
getWorkingCopy
and getSharedWorkingCopy
) now return
an IWorkingCopy
instead of an IJavaElement
.
Working copies were initialy designed to be editable elements on any IJavaElement
.
Pratice showed that they were used only to edit ICompilationUnit
. To avoid
downcasting to IWorkingCopy
, the factory methods now return an
IWorkingCopy
.
Clients using factory methods to create working copies can now remove the cast from
IJavaElement
to IWorkingCopy
.
CharOperation.patchMatch(...)
no longer treat non absolute pattern 'foo'
as '**/foo'
for free. This was inconsistent with Ant patternset rules. This has no incidence on
source folder exclusion patterns which are implicitely concatenating exclusion patterns to source folder
paths when using them. Only direct clients to this CharOperation
API will be affected.
The following messages ID are added:
The following messages ID are removed:
IJavaProject#forceClasspathReload(IProgressMonitor)
to force reload of .classpath
file
before next automatic update occurs.
/** * Force the project to reload its.classpath
file from disk and update the classpath accordingly. * Usually, a change to the.classpath
file is automatically noticed and reconciled at the next * resource change notification event. If required to consider such a change prior to the next automatic * refresh, then this functionnality should be used to trigger a refresh. In particular, if a change to the file is performed, * during an operation where this change needs to be reflected before the operation ends, then an explicit refresh is * necessary. * * @param monitor a progress monitor for reporting operation progress * @exception JavaModelException if the classpath could not be updated. Reasons * include: * - This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
CPE_PROJECT
refers to this project (INVALID_PATH)
* - This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
* - The output location path refers to a location not contained in this project (PATH_OUTSIDE_PROJECT
)
* - The output location path is not an absolute path (RELATIVE_PATH
)
* - The output location path is nested inside a package fragment root of this project (INVALID_PATH
)
* - The classpath is being modified during resource change event notification (CORE_EXCEPTION)
* @since 3.0
*/
JavaCore.newLibraryEntry(...)
null). This adjustment is made necessary for
library entries generated from classpath variables which cannot be set to null
. Also see
bug 38531.
* @param sourceAttachmentPath the absolute path of the corresponding source archive or folder,
* or null
if none. Note, since 3.0, an empty path is allowed to denote no source attachment.
* and will be automatically converted to null
.