jdt core - build notes R2.0 |
Java development tools core |
Here are the build notes for the Eclipse JDT/Core plug-in project
org.eclipse.jdt.core,
describing bug resolution and substantial changes in the HEAD branch.
Most recent information is listed first.
This present document covers all changes up to Release 2.0, changes which occurred since then in 2.1 stream are described in build notes R2.1. |
IWorkingCopy#findSharedWorkingCopy()
which was no longer used anyway. Proper API is taking
a IBufferFactory
in argument.ISafeRunnable
). IJavaSearchConstants
: READ_REFERENCES and WRITE_REFERENCES.
They were annoted with intention to discard before 2.0 since were temporarily introduced and deprecated (due to bad naming).
/** * @deprecated - use WRITE_ACCESSES instead (will be discarded before 2.0) * @since 2.0 */ int WRITE_REFERENCES = WRITE_ACCESSES;
IJavaProject
. These were not in 1.0, and shouldn't have been
introduced (incorrectly resurrected from 0.9).
IJavaProject#getClasspath(...) --> IJavaProject#getRawClasspath(...)
IJavaProject#setClasspath(...) --> IJavaProject#setRawClasspath(...)
IJavaProject#newProjectEntry(...) --> JavaCore#newProjectEntry(...)
IJavaProject#newLibraryEntry(...) --> JavaCore#newLibraryEntry(...)
IJavaProject#newSourceEntry(...) --> JavaCore#newSourceEntry(...)
IJavaModel#refreshExternalArchives(IJavaElement[],IProgressMonitor)
. Elements
can either be package fragment roots, projects or Java model.JavaCore#getDefaultOptions
comment
* COMPILER / Reporting Unused Import * When enabled, the compiler will issue an error or a warning for unused import * reference * - option id: "org.eclipse.jdt.core.compiler.problem.unusedImport" * - possible values: { "error", "warning", "ignore" } * - default: "ignore"Note that if import problems (separate settings) are disabled, unused imports will not be reported either. This option is also available to the batch compiler ("-warn:unusedImports"). Implementations of
IProblemRequestor
can identify this new problem through its ID IProblem#UnusedImport
.
IJavaModel#refreshExternalJARs(IJavaProject[],IProgressMonitor)
. ITypeHierarchy#getCachedFlags(IType)
). Note that these
flags can help answering both isClass/isInterface queries as well (see Flags.isInterface(int)
IJavaModel#refreshExternalJARs
.
/** * Triggers an update of the JavaModel with respect to the referenced external JARs. * This operation will issue a JavaModel delta describing the discovered changes, in term * of Java element package fragment roots added, removed or changed. * * @param monitor - a progress monitor used to report progress * @exception JavaModelException in one of the corresponding situation: * - an exception occurs while accessing project resources * * @see IJavaElementDelta * @since 2.0 */ void refreshExternalJARs(IProgressMonitor monitor) throws JavaModelException;
IJavaElementDelta#F_ARCHIVE_CONTENT_CHANGED
ToolFactory.createDefaultClassFileReader(IClassFile classfile, int decodingFlag)
as an helper method to
create a classfile reader for classfile elements.JavaCore#getDefaultOptions()
* COMPILER / Maximum number of problems reported per compilation unit * Specify the maximum number of problems reported on each compilation unit. * - option id: "org.eclipse.jdt.core.compiler.maxProblemPerUnit" * - possible values: "<n>" where <n> is zero or a positive integer (if zero then all problems are reported). * - default: "100"
IType.newSuperTypeHierarchy(IWorkingCopy[], IProgressMonitor)
IType.newTypeHierarchy(IWorkingCopy[], IProgressMonitor)
JavaCore#getSharedWorkingCopies(IBufferFactory)
allowing to retrieve all registered working
copies for a given buffer factory. IWorkingCopy#reconcile(boolean forceProblemDetection, IProgressMonitor monitor)
allowing to force
problem refresh even if working copy was already consistent.
IClasspathContainer
new kind constant K_DEFAULT_SYSTEM
to denote system libraries implicitely contributed
by a runtime. ClasspathContainerInitializer
JavaCore#getOptions
) using its plugin property store. Clients no longer need to save them. ResourcesPlugin.getEncoding()
.
* BUILDER / Abort if Invalid Classpath * Allow to toggle the builder to abort if the classpath is invalid * - option id: "org.eclipse.jdt.core.builder.invalidClasspath" * - possible values: { "abort", "ignore" } * - default: "ignore"
classpathContainerChanged()
got replaced with setter method JavaCore.setClasspathContainer(IPath containerPath, IJavaProject[] affectedProjects, IClasspathContainer respectiveContainers)
ClasspathContainerResolver
got renamed into ClasspathContainerInitializer
CPE_SOURCE
entry.
IClasspathContainer
in order to allow containers to be presented in a UI.
extends
keyword of a class header the relevance grow if the type is a class.
implements
keyword of a class header the relevance grow if the type is an interface.
extends
keyword of an interface header the relevance grow if the type is an interface.
exception
or error
).
IJavaProject.findType(String)
IJavaProject.findType(String, String)
IMethod.isMainMethod()
IMethod.isSimilar(IMethod)
IType.getFullyQualifiedName(char)
IType.getTypeQualifiedName(char)
IWorkingCopy.findSharedWorkingCopy()
is now taking an extra argument: the buffer factory it is associated with. This ensures that
working copies can only be reused for the same buffer factories.
CPE_CONTAINER
), (see proposal here) so as to better encapsulate client defined libraries.
Typically, VM installs would use classpath containers instead of classpath variables (JRE_LIB
) so as to better describe the corresponding
set of libraries (including extension dirs) to be placed on the build path.
New APIs added to reflect this addition:
JavaCore.newContainerEntry(IPath containerPath)
JavaCore.newContainerEntry(IPath containerPath, boolean isExported)
JavaCore.classpathContainerChanged(IPath containerPath, IJavaElement scope)
ClasspathContainerResolver
IJavaElementDelta.F_SOURCEATTACHED
if a source
has been attached to a jar and no source previously existed.
IJavaElementDelta.F_SOURCEDETACHED
if a source
has been detached from a jar and no other source has been attached.
IJavaElementDelta.F_SOURCEDETACHED | JavaElementDelta.F_SOURCEATTACHED
if an attached source has been changed.
/**
* Event type constant (bit mask) indicating an after-the-fact
* report of creations, deletions, and modifications
* to one or more Java element(s) expressed as a hierarchical
* java element delta as returned by getDelta
.
*
* Note: this notification occurs during the corresponding POST_CHANGE
* resource change notification, and contains a full delta accounting for
* any JavaModel operation and/or resource change.
*
* @see IJavaElementDelta
* @see IResourceChangeEvent
* @see #getDelta
* @since 2.0
*/
public static final int POST_CHANGE = 1;
/**
* Event type constant (bit mask) indicating an after-the-fact
* report of creations, deletions, and modifications
* to one or more Java element(s) expressed as a hierarchical
* java element delta as returned by getDelta
.
*
* Note: this notification occurs during the corresponding PRE_AUTO_BUILD
* resource change notification. The delta which is notified here only contains
* information relative to the previous JavaModel operations (i.e. ignores the
* possible resources which have changed outside Java operations). In
* particular, it is possible that the JavaModel be inconsistent with respect to
* resources which got modified outside JavaModel operations (it will only be
* fully consistent once the POST_CHANGE notification has occured).
*
* @see IJavaElementDelta
* @see IResourceChangeEvent
* @see #getDelta
* @since 2.0
*/
public static final int PRE_AUTO_BUILD = 2;
/**
* Event type constant (bit mask) indicating an after-the-fact
* report of creations, deletions, and modifications
* to one or more Java element(s) expressed as a hierarchical
* java element delta as returned by getDelta
.
*
* Note: this notification occurs as a result of a working copy reconcile
* operation.
*
* @see IJavaElementDelta
* @see IResourceChangeEvent
* @see #getDelta
* @since 2.0
*/
public static final int POST_RECONCILE = 4;
/**
* Adds the given listener for changes to Java elements.
* Has no effect if an identical listener is already registered.
* After completion of this method, the given listener will be registered for exactly the
* the specified events. If they were previously registered for other events, they
* will be deregistered.
*
* Once registered, a listener starts receiving notification of changes to
* java elements in the model. The listener continues to receive
* notifications until it is replaced or removed.
*
* Listeners can listen for several types of event as defined in ElementChangeEvent
.
* Clients are free to register for any number of event types however if they register
* for more than one, it is their responsibility to ensure they correctly handle the
* case where the same java element change shows up in multiple notifications.
* Clients are guaranteed to receive only the events for which they are registered.
*
*
* @param listener the listener
* @param eventMask the bit-wise OR of all event types of interest to the listener
* @see IElementChangeListener
* @see ElementChangeEvent
* @see #removeElementChangeListener
* @since 2.0
*/
public static void addElementChangedListener(IElementChangedListener listener, int eventMask)
createArraySignature(char[], int arrayCount)
createCharArrayTypeSignature(char[], boolean)
createMethodSignature(char[][], char[])
getArrayCount(char[])
getElementType(char[])
getParameterCount(char[])
getParameterTypes(char[])
getQualifier(char[])
getReturnType(char[])
getSimpleName(char[])
getSimpleNames(char[])
toCharArray(char[], char[], char[][], boolean, boolean)
toCharArray(char[])
toQualifiedName(char[][])
IWorkingCopy#getSharedWorkingCopy(IProgressMonitor, IBufferFactory)
, use API with extra IProblemRequestor
IWorkingCopy#getWorkingCopy(IProgressMonitor, IBufferFactory)
, use API with extra IProblemRequestor
IWorkingCopy#reconcile(IProblemRequestor)
, use API with no IProblemRequestor
IJavaElement.getAncestor(int)
IJavaElement.getOpenable()
IJavaElement.getPath()
IJavaElement.getResource()
IJavaProject.isOnClasspath(IJavaElement)
IPackageFragmentRoot.getRawClasspathEntry()
IType.findMethods(IMethod)
IWorkingCopy.findElements(IJavaElement)
IWorkingCopy.findPrimaryType()
IProblemRequestor
. #beginReporting is always called before restarting error detection. #endReporting is always called at the
end of detection.
JavaCore#setClasspathVariables
, this allows to update
all affected projects exactly once, instead of iterating multiple times on each project (if it references the variable). This can improve performance
when setting JRE variables.
relevance
to be able to sort proposal by degree of relevance.
relevance
is a positive integer which are used for determine if this proposal is more relevant than another proposal.
This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
value is higher.
IBuffer
by saying that:
IBuffer
(e.g.
IType.createMethod(...)
) ensures that the same line delimiter
(i.e. either "\n"
or "\r"
or "\r\n"
) is
used accross the whole buffer. Thus these operations may change the line delimiter(s)
included in the string to be append, or replaced.
However implementors of this interface should be aware that other clients of IBuffer
might not do such transformations beforehand.addBufferChangedListener
and removeBufferChangedListener
have no effect if the buffer is already closed.setContent
might throw a RuntimeException
if called after the buffer
has been closed.IScanner#getSource
so as to retrieve the scanner original source
IScanner#setSourceBuffer
into IScanner#setSource
WaitUntilReady
policy.
The background indexer now takes all the CPU when another thread is waiting for it to
finish indexing.
User will notice this improvement when doing a search or opening a type and there are
still files to index.
org.eclipse.jdt.core.compiler.IScanner
). org.eclipse.jdt.core.ToolFactory#createScanner
), allowing to obtain
a scanner (implementing IScanner
API). org.eclipse.jdt.core.ICodeFormatter
). org.eclipse.jdt.core.ToolFactory#createCodeFormatter
), allowing to obtain
a code formatter (implementing ICodeFormatter
API). Note that an extension point was also added
to allow client code to contribute a code formatter implementation. The code formatter extension point is named
org.eclipse.jdt.core.codeFormatter
, also see associate comment in plugin.xml.org.eclipse.jdt.core.ToolFactory#createDefaultCodeFormatter
), allowing to obtain
a default code formatter (implementing ICodeFormatter
API). org.eclipse.jdt.core.IProblemRequestor
) to working copy #reconcile(...)
operation. The problem requestor is passed along at creation time.
IBufferFactory
got deprecated, they will be removed in a subsequent build.
org.eclipse.jdt.internal.core.parser.InvalidInputException
org.eclipse.jdt.core.compiler.InvalidInputException
org.eclipse.jdt.internal.core.parser.TerminalSymbols
org.eclipse.jdt.core.compiler.ITerminalSymbols
org.eclipse.jdt.core/debug/search=true
CorrectionEngine#computeCorrections(IProblem, ICompilationUnit, ICorrectionRequestor)
, allowing.
to compute replacement corrections for IProblem(s) detected while reconciling.ISourceReference#exists()
, allowing.
to check existency before invoking ISourceReference
behavior. All implementations did already provide
an exists()
method since they also are implementing IJavaElement
.IDOMFactory.createInterface()
and IDOMFactory.createClass()
.
See 10980 for details.IJavaElementDelta.F_FINE_GRAINED
that indicates
that a fine-grained delta was computed for a given delta.
Clients can use this flag to find out if a compilation unit
that have a F_CONTENT
change should assume that there are
no finer grained changes (F_FINE_GRAINED
is set) or if
finer grained changes were not considered (F_FINE_GRAINED
is not set).
org.eclipse.jdt.core.compiler.IProblem
)
ICompletionRequestor
to surface IProblems instead of IMarkers.IClassFile.getWorkingCopy(IProgressMonitor, IBufferFactory)
for consistence with IWorkingCopy
.
The returned working copy is just a wrapper on the class file's buffer.
Thus only the getBuffer()
operation is valid on this working
copy.
IWorkingCopy
instance when asking for a working copy.
See IWorkingCopy.getSharedWorkingCopy(IProgressMonitor, IBufferFactory)
,
IWorkingCopy.findSharedWorkingCopy()
and IWorkingCopy.destroy()
for more detail.
org.eclipse.jdt.core/debug/sharedworkingcopy=true
org.eclipse.jdt.core/debug/cpvariable=true
org.eclipse.jdt.core/debug/zipaccess=true
IBuffer
is created through an
IBufferFactory
, its content is set with the original
element's content.
IBufferFactory
used when creating an IWorkingCopy
(see ICompilationUnit.getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory)
)
is now remembered and will be reused if the working copy is closed then reopen.
SearchEngine(IWorkingCopy[])
which takes a list of working copies that will take precedence
over their original compilation units in the subsequent search
operations on this search engine.
Helper method for computing a resolved and expanded path (all exports from prerequisites) which was introduced in 204, got removed. This is not an API change, it never made it out officially.
SearchEngine.createJavaSearchScope(IResource[]) has been deprecated. Use SearchEngine.createJavaSearchScope(IJavaElement[]) instead. The rational is that createJavaSearchScope(IResource[]) was not well defined for projects, and it could not define a search scope for java elements that didn't have a corresponding resource (e.g. external jars). This deprecated API's behavior has also reverted to the 1.0 state for backward compatibility. The specification of createJavaSearchScope(IJavaElement[]) is as follows:
Helper
method computing a resolved and expanded path (all exports from prerequisites)
+ IJavaProject.getExpandedClasspath(boolean)