diff options
| author | Kent Johnson | 2002-05-20 18:01:02 +0000 |
|---|---|---|
| committer | Kent Johnson | 2002-05-20 18:01:02 +0000 |
| commit | 1d631cdc6d8aa97d297a027f3883f9c7312c678d (patch) | |
| tree | b33409ba9af8b8b1e6c22d8c9f8b87b1f807e4d4 | |
| parent | c2c9899514741103674136b061d37380904756e0 (diff) | |
| download | eclipse.jdt.core-1d631cdc6d8aa97d297a027f3883f9c7312c678d.tar.gz eclipse.jdt.core-1d631cdc6d8aa97d297a027f3883f9c7312c678d.tar.xz eclipse.jdt.core-1d631cdc6d8aa97d297a027f3883f9c7312c678d.zip | |
*** empty log message ***
3 files changed, 25 insertions, 22 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java index 56345508e4..1962c5b07a 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java @@ -122,7 +122,7 @@ public void acceptResult(CompilationResult result) { createErrorFor(resourceForLocation(sourceLocation), Util.bind("build.duplicateClassFile", new String(typeName))); //$NON-NLS-1$
continue;
}
- newState.locationForType(qualifiedTypeName, sourceLocation);
+ newState.recordLocationForType(qualifiedTypeName, sourceLocation);
}
definedTypeNames.add(writeClassFile(classFile, !isNestedType));
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java index f869a8defd..79d58e96a3 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java @@ -152,7 +152,7 @@ protected void addAffectedSourceFiles() { protected void addDependentsOf(IPath path, boolean hasStructuralChanges) {
if (hasStructuralChanges)
- newState.hasStructuralChanges();
+ newState.tagAsStructurallyChanged();
// the qualifiedStrings are of the form 'p1/p1' & the simpleStrings are just 'X'
path = path.setDevice(null);
String packageName = path.uptoSegment(path.segmentCount() - 1).toString();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java index d062d67baa..a09f59784b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java @@ -84,10 +84,6 @@ char[][] getDefinedTypeNamesFor(String location) { return null; // means only one type is defined with the same name as the file... saves space
}
-void hasStructuralChanges() {
- this.lastStructuralBuildTime = System.currentTimeMillis();
-}
-
boolean isDuplicateLocation(String qualifiedName, String location) {
String existingLocation = (String) typeLocations.get(qualifiedName);
return existingLocation != null && !existingLocation.equals(location);
@@ -118,20 +114,6 @@ boolean isKnownPackage(String qualifiedPackageName) { return false;
}
-boolean isStructurallyChanged(IProject prereqProject, State prereqState) {
- if (prereqState != null) {
- Object o = structuralBuildTimes.get(prereqProject.getName());
- long previous = o == null ? 0 : ((Long) o).longValue();
- if (previous == prereqState.lastStructuralBuildTime) return false;
- }
- return true;
-}
-
-void locationForType(String qualifiedName, String location) {
- this.knownPackageNames = null;
- typeLocations.put(qualifiedName, location);
-}
-
void record(String location, char[][][] qualifiedRefs, char[][] simpleRefs, char[] mainTypeName, ArrayList typeNames) {
if (typeNames.size() == 1 && CharOperation.equals(mainTypeName, (char[]) typeNames.get(0))) {
references.put(location, new ReferenceCollection(qualifiedRefs, simpleRefs));
@@ -142,6 +124,11 @@ void record(String location, char[][][] qualifiedRefs, char[][] simpleRefs, char }
}
+void recordLocationForType(String qualifiedName, String location) {
+ this.knownPackageNames = null;
+ typeLocations.put(qualifiedName, location);
+}
+
void recordStructuralDependency(IProject prereqProject, State prereqState) {
if (prereqState != null)
structuralBuildTimes.put(prereqProject.getName(), new Long(prereqState.lastStructuralBuildTime));
@@ -176,8 +163,11 @@ void removeTypeLocation(String locationToRemove) { static State read(DataInputStream in) throws IOException {
if (JavaBuilder.DEBUG)
System.out.println("About to read state..."); //$NON-NLS-1$
- if (VERSION != in.readByte())
- throw new IOException(Util.bind("build.unhandledVersionFormat")); //$NON-NLS-1$
+ if (VERSION != in.readByte()) {
+ if (JavaBuilder.DEBUG)
+ System.out.println("Found non-compatible state version... answered null"); //$NON-NLS-1$
+ return null;
+ }
State newState = new State();
newState.javaProjectName = in.readUTF();
@@ -275,6 +265,19 @@ boolean wasNoopBuild() { return buildNumber == -1;
}
+void tagAsStructurallyChanged() {
+ this.lastStructuralBuildTime = System.currentTimeMillis();
+}
+
+boolean wasStructurallyChanged(IProject prereqProject, State prereqState) {
+ if (prereqState != null) {
+ Object o = structuralBuildTimes.get(prereqProject.getName());
+ long previous = o == null ? 0 : ((Long) o).longValue();
+ if (previous == prereqState.lastStructuralBuildTime) return false;
+ }
+ return true;
+}
+
void write(DataOutputStream out) throws IOException {
int length;
Object[] keyTable;
|
