*** empty log message ***
diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 392c785..100f450 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -1,7 +1,7 @@
### JavaBatchCompiler messages.
### compiler version id
-compiler.version = 0.245
+compiler.version = 0.242b
### scanning
scanning.start = Collecting source files inside {0}
diff --git a/model/org/eclipse/jdt/internal/core/Util.java b/model/org/eclipse/jdt/internal/core/Util.java
index 60115bb..f9dc4a6 100644
--- a/model/org/eclipse/jdt/internal/core/Util.java
+++ b/model/org/eclipse/jdt/internal/core/Util.java
@@ -166,7 +166,7 @@
}
/**
* Concatenate two strings with a char in between.
- * @see #concat(String, String)
+ * @see concat(String, String)
*/
public static String concat(String s1, char c, String s2) {
if (s1 == null) s1 = "null"; //$NON-NLS-1$
@@ -202,7 +202,7 @@
/**
* Concatenate three strings.
- * @see #concat(String, String)
+ * @see concat(String, String)
*/
public static String concat(String s1, String s2, String s3) {
if (s1 == null) s1 = "null"; //$NON-NLS-1$
@@ -260,11 +260,7 @@
int len = a.length;
if (len != b.length) return false;
for (int i = 0; i < len; ++i) {
- if (a[i] == null) {
- if (b[i] != null) return false;
- } else {
- if (!a[i].equals(b[i])) return false;
- }
+ if (!a[i].equals(b[i])) return false;
}
return true;
}
@@ -535,19 +531,33 @@
return JavaConventions.validateIdentifier(folderName).getSeverity() != IStatus.ERROR;
}
- /*
- * Add a log entry
- */
- public static void log(Throwable e, String message) {
- IStatus status= new Status(
- IStatus.ERROR,
- JavaCore.getPlugin().getDescriptor().getUniqueIdentifier(),
- IStatus.ERROR,
- message,
- e);
- JavaCore.getPlugin().getLog().log(status);
- }
-
+/**
+ * Add entry into the workspace log file
+ */
+public static void log(String message){
+ JavaCore.getPlugin().getLog().log(
+ new JavaModelStatus(IStatus.ERROR, message));
+}
+
+/**
+ * Add entry into the workspace log file
+ */
+public static void log(Throwable e){
+ JavaCore.getPlugin().getLog().log(
+ new JavaModelStatus(IStatus.ERROR, e));
+}
+/*
+ * Add a log entry
+ */
+public static void log(Throwable e, String message) {
+ IStatus status= new Status(
+ IStatus.ERROR,
+ JavaCore.getPlugin().getDescriptor().getUniqueIdentifier(),
+ IStatus.ERROR,
+ message,
+ e);
+ JavaCore.getPlugin().getLog().log(status);
+}
/**
* Normalizes the cariage returns in the given text.
* They are all changed to use the given buffer's line sepatator.
@@ -1048,9 +1058,10 @@
int suffixLength = SUFFIX_CLASS.length;
if (nameLength < suffixLength) return false;
- for (int i = 0, offset = nameLength - suffixLength; i < suffixLength; i++) {
- char c = name.charAt(offset + i);
- if (c != SUFFIX_class[i] && c != SUFFIX_CLASS[i]) return false;
+ for (int i = 0; i < suffixLength; i++) {
+ char c = name.charAt(nameLength - i - 1);
+ int suffixIndex = suffixLength - i - 1;
+ if (c != SUFFIX_class[suffixIndex] && c != SUFFIX_CLASS[suffixIndex]) return false;
}
return true;
}
@@ -1100,9 +1111,10 @@
int suffixLength = SUFFIX_JAVA.length;
if (nameLength < suffixLength) return false;
- for (int i = 0, offset = nameLength - suffixLength; i < suffixLength; i++) {
- char c = name.charAt(offset + i);
- if (c != SUFFIX_java[i] && c != SUFFIX_JAVA[i]) return false;
+ for (int i = 0; i < suffixLength; i++) {
+ char c = name.charAt(nameLength - i - 1);
+ int suffixIndex = suffixLength - i - 1;
+ if (c != SUFFIX_java[suffixIndex] && c != SUFFIX_JAVA[suffixIndex]) return false;
}
return true;
}
diff --git a/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java b/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
index 4bd0223..128d540 100644
--- a/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
@@ -11,7 +11,6 @@
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.internal.core.*;
-import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.util.CharOperation;
import org.eclipse.jdt.internal.core.Util;
@@ -35,7 +34,6 @@
public static final String CLASS_EXTENSION = "class"; //$NON-NLS-1$
public static final String JAR_EXTENSION = "jar"; //$NON-NLS-1$
public static final String ZIP_EXTENSION = "zip"; //$NON-NLS-1$
-public static final String OPTION_InvalidClasspathSwitch = "org.eclipse.jdt.core.builder.invalidClasspath"; //$NON-NLS-1$
public static final String OPTION_ResourceCopyFilter = "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"; //$NON-NLS-1$
public static boolean DEBUG = false;
@@ -76,7 +74,7 @@
protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) throws CoreException {
this.currentProject = getProject();
- if (currentProject == null || !currentProject.isAccessible()) return new IProject[0];
+ if (currentProject == null || !currentProject.exists()) return new IProject[0];
if (DEBUG)
System.out.println("\nStarting build of " + currentProject.getName() //$NON-NLS-1$
@@ -88,29 +86,27 @@
notifier.checkCancel();
initializeBuilder();
- if (isWorthBuilding()) {
- if (kind == FULL_BUILD) {
+ if (kind == FULL_BUILD) {
+ buildAll();
+ } else {
+ if ((this.lastState = getLastState(currentProject)) == null) {
+ if (DEBUG)
+ System.out.println("Performing full build since last saved state was not found"); //$NON-NLS-1$
buildAll();
- } else {
- if ((this.lastState = getLastState(currentProject)) == null) {
- if (DEBUG)
- System.out.println("Performing full build since last saved state was not found"); //$NON-NLS-1$
+ } else if (hasClasspathChanged() || hasOutputLocationChanged()) {
+ // if the output location changes, do not delete the binary files from old location
+ // the user may be trying something
+ buildAll();
+ } else if (sourceFolders.length > 0) { // if there is no source to compile & no classpath changes then we are done
+ clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time
+ SimpleLookupTable deltas = findDeltas();
+ if (deltas == null)
buildAll();
- } else if (hasClasspathChanged() || hasOutputLocationChanged()) {
- // if the output location changes, do not delete the binary files from old location
- // the user may be trying something
- buildAll();
- } else if (sourceFolders.length > 0) { // if there is no source to compile & no classpath changes then we are done
- clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time
- SimpleLookupTable deltas = findDeltas();
- if (deltas == null)
- buildAll();
- else
- buildDeltas(deltas);
- }
+ else
+ buildDeltas(deltas);
}
- ok = true;
}
+ ok = true;
} catch (CoreException e) {
Util.log(e, "JavaBuilder handling CoreException"); //$NON-NLS-1$
try {
@@ -121,7 +117,7 @@
throw e;
}
} catch (ImageBuilderInternalException e) {
- Util.log(e.getThrowable(), "JavaBuilder handling ImageBuilderInternalException"); //$NON-NLS-1$
+ Util.log(e, "JavaBuilder handling ImageBuilderInternalException"); //$NON-NLS-1$
try {
IMarker marker = currentProject.createMarker(ProblemMarkerTag);
marker.setAttribute(IMarker.MESSAGE, Util.bind("build.inconsistentProject")); //$NON-NLS-1$
@@ -129,17 +125,11 @@
} catch (CoreException ignore) {
throw e.getThrowable();
}
- } catch (MissingClassFileException e) {
- // do not log this exception since its thrown to handle aborted compiles because of missing class files
- if (DEBUG)
- System.out.println(Util.bind("build.incompleteClassPath", e.missingClassFile)); //$NON-NLS-1$
+ } catch (IncompleteClassPathException e) {
IMarker marker = currentProject.createMarker(ProblemMarkerTag);
marker.setAttribute(IMarker.MESSAGE, Util.bind("build.incompleteClassPath", e.missingClassFile)); //$NON-NLS-1$
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
} 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(Util.bind("build.missingSourceFile", e.missingSourceFile)); //$NON-NLS-1$
removeProblemsFor(currentProject); // make this the only problem for this project
IMarker marker = currentProject.createMarker(ProblemMarkerTag);
marker.setAttribute(IMarker.MESSAGE, Util.bind("build.missingSourceFile", e.missingSourceFile)); //$NON-NLS-1$
@@ -278,9 +268,10 @@
Object[] keyTable = binaryResources.keyTable;
for (int i = 0, l = keyTable.length; i < l; i++) {
IProject p = (IProject) keyTable[i];
- if (p != null && p != currentProject && !projects.contains(p))
+ if (p != null && !projects.contains(p))
projects.add(p);
}
+ this.binaryResources = null;
}
} catch(JavaModelException e) {
return new IProject[0];
@@ -364,12 +355,12 @@
binaryResources);
this.sourceFolders = new IContainer[sourceList.size()];
sourceList.toArray(this.sourceFolders);
-
+
String filterSequence = (String) JavaCore.getOptions().get(OPTION_ResourceCopyFilter);
this.resourceFilters = filterSequence != null && filterSequence.length() > 0
? CharOperation.splitOn(',', filterSequence.toCharArray())
: null;
-
+
// Flush the existing external files cache if this is the beginning of a build cycle
String projectName = this.currentProject.getName();
if (builtProjects == null || builtProjects.contains(projectName)) {
@@ -379,46 +370,6 @@
builtProjects.add(projectName);
}
-private boolean isWorthBuilding() throws CoreException {
-// boolean abortBuilds = JavaCore.ABORT.equals(JavaCore.getOptions().get(OPTION_InvalidClasspathSwitch));
-// if (abortBuilds) {
-// IMarker[] markers =
-// currentProject.findMarkers(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ONE);
-// if (markers.length > 0) {
-// if (DEBUG)
-// System.out.println("Aborted build because project is involved in a cycle or has classpath problems"); //$NON-NLS-1$
-//
-// // remove all existing class files... causes all dependent projects to do the same
-// new BatchImageBuilder(this).scrubOutputFolder();
-//
-// removeProblemsFor(currentProject); // make this the only problem for this project
-// return false;
-// }
-// }
-//
-// // make sure all prereq projects have valid build states
-// IProject[] requiredProjects = getRequiredProjects();
-// next : for (int i = 0, length = requiredProjects.length; i < length; i++) {
-// IProject p = requiredProjects[i];
-// if (getLastState(p) == null) {
-// if (!abortBuilds && !p.isOpen()) continue next; // skip closed projects if we're not aborting builds because of classpath problems
-// if (DEBUG)
-// System.out.println("Aborted build because prereq project " + p.getName() //$NON-NLS-1$
-// + " was not built"); //$NON-NLS-1$
-//
-// // remove all existing class files... causes all dependent projects to do the same
-// new BatchImageBuilder(this).scrubOutputFolder();
-//
-// removeProblemsFor(currentProject); // make this the only problem for this project
-// IMarker marker = currentProject.createMarker(ProblemMarkerTag);
-// marker.setAttribute(IMarker.MESSAGE, Util.bind("build.prereqProjectWasNotBuilt", p.getName())); //$NON-NLS-1$
-// marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
-// return false;
-// }
-// }
- return true;
-}
-
private void recordNewState(State state) {
Object[] keyTable = binaryResources.keyTable;
for (int i = 0, l = keyTable.length; i < l; i++) {