### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java,v retrieving revision 1.127 diff -u -r1.127 JavaBuilder.java --- model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java 31 Jan 2007 07:47:25 -0000 1.127 +++ model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java 12 Mar 2007 18:05:08 -0000 @@ -31,7 +31,7 @@ CompilationParticipant[] participants; NameEnvironment nameEnvironment; SimpleLookupTable binaryLocationsPerProject; // maps a project to its binary resources (output folders, class folders, zip/jar files) -State lastState; +public State lastState; BuildNotifier notifier; char[][] extraResourceFileFilters; String[] extraResourceFolderFilters; @@ -103,7 +103,7 @@ try { if (resource != null && resource.exists()) { resource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE); - + // delete managed markers Set markerTypes = JavaModelManager.getJavaModelManager().compilationParticipants.managedMarkerTypes(); if (markerTypes.size() == 0) return; @@ -130,7 +130,7 @@ if (resource != null && resource.exists()) { resource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE); resource.deleteMarkers(IJavaModelMarker.TASK_MARKER, false, IResource.DEPTH_INFINITE); - + // delete managed markers Set markerTypes = JavaModelManager.getJavaModelManager().compilationParticipants.managedMarkerTypes(); if (markerTypes.size() == 0) return; @@ -201,24 +201,24 @@ } catch (CoreException e) { Util.log(e, "JavaBuilder handling CoreException while building: " + currentProject.getName()); //$NON-NLS-1$ IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); + marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IJavaModelMarker.CATEGORY_ID, CategorizedProblem.CAT_BUILDPATH); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); } catch (ImageBuilderInternalException e) { Util.log(e.getThrowable(), "JavaBuilder handling ImageBuilderInternalException while building: " + currentProject.getName()); //$NON-NLS-1$ IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); + marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IJavaModelMarker.CATEGORY_ID, CategorizedProblem.CAT_BUILDPATH); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); } catch (MissingSourceFileException e) { // do not log this exception since its thrown to handle aborted compiles because of missing source files if (DEBUG) - System.out.println(Messages.bind(Messages.build_missingSourceFile, e.missingSourceFile)); + System.out.println(Messages.bind(Messages.build_missingSourceFile, e.missingSourceFile)); removeProblemsAndTasksFor(currentProject); // make this the only problem for this project IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_missingSourceFile, e.missingSourceFile)); + marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_missingSourceFile, e.missingSourceFile)); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); } finally { @@ -237,7 +237,7 @@ private void buildAll() { notifier.checkCancel(); - notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); + notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && lastState != null) System.out.println("Clearing last state : " + lastState); //$NON-NLS-1$ clearLastState(); @@ -248,7 +248,7 @@ private void buildDeltas(SimpleLookupTable deltas) { notifier.checkCancel(); - notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); + notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && lastState != null) System.out.println("Clearing last state : " + lastState); //$NON-NLS-1$ clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time @@ -280,7 +280,7 @@ } catch (CoreException e) { Util.log(e, "JavaBuilder handling CoreException while cleaning: " + currentProject.getName()); //$NON-NLS-1$ IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); + marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_inconsistentProject, e.getLocalizedMessage())); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); } finally { @@ -328,7 +328,7 @@ } private SimpleLookupTable findDeltas() { - notifier.subTask(Messages.bind(Messages.build_readingDelta, currentProject.getName())); + notifier.subTask(Messages.bind(Messages.build_readingDelta, currentProject.getName())); IResourceDelta delta = getDelta(currentProject); SimpleLookupTable deltas = new SimpleLookupTable(3); if (delta != null) { @@ -364,7 +364,7 @@ if (canSkip) continue nextProject; // project has no structural changes in its output folders } - notifier.subTask(Messages.bind(Messages.build_readingDelta, p.getName())); + notifier.subTask(Messages.bind(Messages.build_readingDelta, p.getName())); delta = getDelta(p); if (delta != null) { if (delta.getKind() != IResourceDelta.NO_CHANGE) { @@ -389,7 +389,7 @@ } /* Return the list of projects for which it requires a resource delta. This builder's project -* is implicitly included and need not be specified. Builders must re-specify the list +* is implicitly included and need not be specified. Builders must re-specify the list * of interesting projects every time they are run as this is not carried forward * beyond the next build. Missing projects should be specified but will be ignored until * they are added to the workspace. @@ -544,7 +544,7 @@ for (int i = 0, l = this.participants.length; i < l; i++) if (this.participants[i].aboutToBuild(this.javaProject) == CompilationParticipant.NEEDS_FULL_BUILD) kind = FULL_BUILD; - + // Flush the existing external files cache if this is the beginning of a build cycle String projectName = currentProject.getName(); if (builtProjects == null || builtProjects.contains(projectName)) { @@ -608,7 +608,7 @@ removeProblemsAndTasksFor(currentProject); // remove all compilation problems IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.MESSAGE, Messages.build_abortDueToClasspathProblems); + marker.setAttribute(IMarker.MESSAGE, Messages.build_abortDueToClasspathProblems); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IJavaModelMarker.CATEGORY_ID, CategorizedProblem.CAT_BUILDPATH); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); @@ -646,8 +646,8 @@ IMarker marker = currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); marker.setAttribute(IMarker.MESSAGE, isClasspathBroken(prereq.getRawClasspath(), p) - ? Messages.bind(Messages.build_prereqProjectHasClasspathProblems, p.getName()) - : Messages.bind(Messages.build_prereqProjectMustBeRebuilt, p.getName())); + ? Messages.bind(Messages.build_prereqProjectHasClasspathProblems, p.getName()) + : Messages.bind(Messages.build_prereqProjectMustBeRebuilt, p.getName())); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IJavaModelMarker.CATEGORY_ID, CategorizedProblem.CAT_BUILDPATH); marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); @@ -671,7 +671,7 @@ if (participantPath != currentPath) { IProject project = workspaceRoot.getProject(participantPath.segment(0)); if (hasBeenBuilt(project)) { - if (DEBUG) + if (DEBUG) System.out.println("Requesting another build iteration since cycle participant " + project.getName() //$NON-NLS-1$ + " has not yet seen some structural changes"); //$NON-NLS-1$ needRebuild(); Index: model/org/eclipse/jdt/internal/core/builder/State.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java,v retrieving revision 1.58 diff -u -r1.58 State.java --- model/org/eclipse/jdt/internal/core/builder/State.java 29 Mar 2006 03:08:49 -0000 1.58 +++ model/org/eclipse/jdt/internal/core/builder/State.java 12 Mar 2007 18:05:08 -0000 @@ -32,7 +32,7 @@ // keyed by the project relative path of the type (ie. "src1/p1/p2/A.java"), value is a ReferenceCollection or an AdditionalTypeCollection SimpleLookupTable references; // keyed by qualified type name "p1/p2/A", value is the project relative path which defines this type "src1/p1/p2/A.java" -SimpleLookupTable typeLocators; +public SimpleLookupTable typeLocators; int buildNumber; long lastStructuralBuildTime; @@ -97,8 +97,7 @@ this.typeLocators.put(keyTable[i], valueTable[i]); } } - -char[][] getDefinedTypeNamesFor(String typeLocator) { +public char[][] getDefinedTypeNamesFor(String typeLocator) { Object c = references.get(typeLocator); if (c instanceof AdditionalTypeCollection) return ((AdditionalTypeCollection) c).definedTypeNames; @@ -321,7 +320,7 @@ private static char[][] readNames(DataInputStream in) throws IOException { int length = in.readInt(); char[][] names = new char[length][]; - for (int i = 0; i < length; i++) + for (int i = 0; i < length; i++) names[i] = readName(in); return names; } @@ -627,7 +626,7 @@ AccessRule[] accessRules = accessRuleSet.getAccessRules(); int length = accessRules.length; out.writeInt(length); - if (length != 0) { + if (length != 0) { for (int i = 0; i < length; i++) { AccessRule accessRule = accessRules[i]; writeName(accessRule.pattern, out); Index: model/org/eclipse/jdt/core/JavaCore.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v retrieving revision 1.565 diff -u -r1.565 JavaCore.java --- model/org/eclipse/jdt/core/JavaCore.java 7 Mar 2007 16:09:14 -0000 1.565 +++ model/org/eclipse/jdt/core/JavaCore.java 12 Mar 2007 18:05:08 -0000 @@ -70,6 +70,7 @@ package org.eclipse.jdt.core; import java.io.File; +import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; @@ -128,14 +129,16 @@ *

*

* The single instance of this class can be accessed from any plug-in declaring - * the Java model plug-in as a prerequisite via + * the Java model plug-in as a prerequisite via * JavaCore.getJavaCore(). The Java model plug-in will be activated * automatically if not already active. *

*/ public final class JavaCore extends Plugin { - private static Plugin JAVA_CORE_PLUGIN = null; + private static final IResource[] NO_GENERATED_RESOURCES = new IResource[0]; + + private static Plugin JAVA_CORE_PLUGIN = null; /** * The plug-in identifier of the Java core support * (value "org.eclipse.jdt.core"). @@ -157,7 +160,7 @@ /** * The identifier for the Java nature * (value "org.eclipse.jdt.core.javanature"). - * The presence of this nature on a project indicates that it is + * The presence of this nature on a project indicates that it is * Java-capable. * * @see org.eclipse.core.resources.IProject#hasNature(java.lang.String) @@ -175,7 +178,7 @@ * @since 3.0 */ public static final String USER_LIBRARY_CONTAINER_ID= "org.eclipse.jdt.USER_LIBRARY"; //$NON-NLS-1$ - + // *************** Possible IDs for configurable options. ******************** /** @@ -592,7 +595,7 @@ * @see #getDefaultOptions() * @since 3.2 */ - public static final String COMPILER_PB_FATAL_OPTIONAL_ERROR = PLUGIN_ID + ".compiler.problem.fatalOptionalError"; //$NON-NLS-1$ + public static final String COMPILER_PB_FATAL_OPTIONAL_ERROR = PLUGIN_ID + ".compiler.problem.fatalOptionalError"; //$NON-NLS-1$ /** * Possible configurable option ID. * @see #getDefaultOptions() @@ -646,7 +649,7 @@ * @see #getDefaultOptions() * @since 3.0 */ - public static final String COMPILER_TASK_CASE_SENSITIVE = PLUGIN_ID + ".compiler.taskCaseSensitive"; //$NON-NLS-1$ + public static final String COMPILER_TASK_CASE_SENSITIVE = PLUGIN_ID + ".compiler.taskCaseSensitive"; //$NON-NLS-1$ /** * Possible configurable option ID. * @see #getDefaultOptions() @@ -717,13 +720,13 @@ * @see #getDefaultOptions() * @since 2.1 */ - public static final String CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.cleanOutputFolder"; //$NON-NLS-1$ + public static final String CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.cleanOutputFolder"; //$NON-NLS-1$ /** * Possible configurable option ID. * @see #getDefaultOptions() * @since 3.2 */ - public static final String CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.recreateModifiedClassFileInOutputFolder"; //$NON-NLS-1$ + public static final String CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.recreateModifiedClassFileInOutputFolder"; //$NON-NLS-1$ /** * Possible configurable option ID. * @see #getDefaultOptions() @@ -757,7 +760,7 @@ /** * Possible configurable option ID. * @see #getDefaultOptions() - * @since 2.1 + * @since 2.1 */ public static final String CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS = PLUGIN_ID + ".classpath.exclusionPatterns"; //$NON-NLS-1$ /** @@ -768,13 +771,13 @@ public static final String CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS = PLUGIN_ID + ".classpath.multipleOutputLocations"; //$NON-NLS-1$ /** * Default task tag - * @deprecated Use {@link #DEFAULT_TASK_TAGS} instead + * @deprecated Use {@link #DEFAULT_TASK_TAGS} instead * @since 2.1 */ public static final String DEFAULT_TASK_TAG = "TODO"; //$NON-NLS-1$ /** * Default task priority - * @deprecated Use {@link #DEFAULT_TASK_PRIORITIES} instead + * @deprecated Use {@link #DEFAULT_TASK_PRIORITIES} instead * @since 2.1 */ public static final String DEFAULT_TASK_PRIORITY = "NORMAL"; //$NON-NLS-1$ @@ -962,7 +965,7 @@ * @since 3.2 */ public static final String TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC = PLUGIN_ID + ".timeoutForParameterNameFromAttachedJavadoc"; //$NON-NLS-1$ - + /** * Possible configurable option value. * @see #getDefaultOptions() @@ -1149,7 +1152,7 @@ /** * Value of the content-type for Java source files. Use this value to retrieve the Java content type * from the content type manager, and to add new Java-like extensions to this content type. - * + * * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String) * @see #getJavaLikeExtensions() * @since 3.2 @@ -1159,10 +1162,10 @@ /** * Creates the Java core plug-in. *

- * The plug-in instance is created automatically by the + * The plug-in instance is created automatically by the * Eclipse platform. Clients must not call. *

- * + * * @since 3.0 */ public JavaCore() { @@ -1178,7 +1181,7 @@ * and any reconcile operation (POST_RECONCILE). * For finer control of the notification, use addElementChangedListener(IElementChangedListener,int), * which allows to specify a different eventMask. - * + * * @param listener the listener * @see ElementChangedEvent */ @@ -1191,20 +1194,20 @@ * Has no effect if an identical listener is already registered. * After completion of this method, the given listener will be registered for exactly * the specified events. If they were previously registered for other events, they - * will be deregistered. + * 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. + * 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. + * 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 IElementChangedListener @@ -1232,15 +1235,15 @@ if (attributes != null && element != null) attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier()); } - + /** - * Adds the given listener for POST_CHANGE resource change events to the Java core. + * Adds the given listener for POST_CHANGE resource change events to the Java core. * The listener is guaranteed to be notified of the POST_CHANGE resource change event before * the Java core starts processing the resource change event itself. *

* Has no effect if an identical listener is already registered. *

- * + * * @param listener the listener * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) * @since 3.0 @@ -1249,13 +1252,13 @@ public static void addPreProcessingResourceChangedListener(IResourceChangeListener listener) { addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE); } - + /** - * Adds the given listener for resource change events of the given types to the Java core. + * Adds the given listener for resource change events of the given types to the Java core. * The listener is guaranteed to be notified of the resource change event before * the Java core starts processing the resource change event itself. *

- * If an identical listener is already registered, the given event types are added to the event types + * If an identical listener is already registered, the given event types are added to the event types * of interest to the listener. *

*

@@ -1269,7 +1272,7 @@ * * This list may increase in the future. *

- * + * * @param listener the listener * @param eventMask the bit-wise OR of all event types of interest to the * listener @@ -1280,7 +1283,7 @@ public static void addPreProcessingResourceChangedListener(IResourceChangeListener listener, int eventMask) { JavaModelManager.getJavaModelManager().deltaState.addPreResourceChangedListener(listener, eventMask); } - + /** * Configures the given marker for the given Java element. * Used for markers, which denote a Java element rather than a resource. @@ -1296,12 +1299,12 @@ if (marker != null && element != null) marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier()); } - + /** * Returns the Java model element corresponding to the given handle identifier * generated by IJavaElement.getHandleIdentifier(), or * null if unable to create the associated element. - * + * * @param handleIdentifier the given handle identifier * @return the Java element corresponding to the handle identifier */ @@ -1314,9 +1317,9 @@ * generated by IJavaElement.getHandleIdentifier(), or * null if unable to create the associated element. * If the returned Java element is an ICompilationUnit, its owner - * is the given owner if such a working copy exists, otherwise the compilation unit + * is the given owner if such a working copy exists, otherwise the compilation unit * is a primary compilation unit. - * + * * @param handleIdentifier the given handle identifier * @param owner the owner of the returned compilation unit, ignored if the returned * element is not a compilation unit @@ -1331,14 +1334,14 @@ JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel(); return model.getHandleFromMemento(memento, owner); } - + /** * Returns the Java element corresponding to the given file, or * null if unable to associate the given file * with a Java element. * *

The file must be one of: