Lines 40-45
Link Here
|
40 |
|
40 |
|
41 |
public static int MaxCompileLoop = 5; // perform a full build if it takes more than ? incremental compile loops |
41 |
public static int MaxCompileLoop = 5; // perform a full build if it takes more than ? incremental compile loops |
42 |
|
42 |
|
|
|
43 |
// Global table containing list of binary changes which are non structural. Used to optimize inter-project scenario (refine binary deltas) |
44 |
// Flushed at the end of a build iteration, thus only optimizing the incremental workspace build. |
45 |
public static HashMap BinaryChangeNatures = new HashMap(50); |
46 |
public static String STRUCTURAL = "STRUCTURAL"; //$NON-NLS-1$ |
47 |
public static String NON_STRUCTURAL = "NON STRUCTURAL"; //$NON-NLS-1 |
48 |
|
43 |
protected IncrementalImageBuilder(JavaBuilder javaBuilder) { |
49 |
protected IncrementalImageBuilder(JavaBuilder javaBuilder) { |
44 |
super(javaBuilder); |
50 |
super(javaBuilder); |
45 |
this.nameEnvironment.isIncrementalBuild = true; |
51 |
this.nameEnvironment.isIncrementalBuild = true; |
Lines 291-296
Link Here
|
291 |
case IResourceDelta.CHANGED : |
297 |
case IResourceDelta.CHANGED : |
292 |
if ((binaryDelta.getFlags() & IResourceDelta.CONTENT) == 0) |
298 |
if ((binaryDelta.getFlags() & IResourceDelta.CONTENT) == 0) |
293 |
return; // skip it since it really isn't changed |
299 |
return; // skip it since it really isn't changed |
|
|
300 |
// if listed amongst binary changes to ignore, then no need to react to this delta (14103) |
301 |
if (BinaryChangeNatures.get(resource) == NON_STRUCTURAL) { |
302 |
if (JavaBuilder.DEBUG) |
303 |
System.out.println("Skipped over unchanged class file " + typePath); //$NON-NLS-1$ |
304 |
return; // skip it since it really isn't changed |
305 |
} |
294 |
if (JavaBuilder.DEBUG) |
306 |
if (JavaBuilder.DEBUG) |
295 |
System.out.println("Found changed class file " + typePath); //$NON-NLS-1$ |
307 |
System.out.println("Found changed class file " + typePath); //$NON-NLS-1$ |
296 |
addDependentsOf(typePath, false); |
308 |
addDependentsOf(typePath, false); |
Lines 602-608
Link Here
|
602 |
protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newBytes) throws CoreException { |
614 |
protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newBytes) throws CoreException { |
603 |
try { |
615 |
try { |
604 |
byte[] oldBytes = Util.getResourceContentsAsByteArray(file); |
616 |
byte[] oldBytes = Util.getResourceContentsAsByteArray(file); |
605 |
if (this.compileLoop > 1) { // only optimize files which were recompiled during the dependent pass, see 33990 |
617 |
if (this.compileLoop > 1) { // only optimize files which were recompiled during the dependent pass, see 33990 (update timestamp) |
606 |
notEqual : if (newBytes.length == oldBytes.length) { |
618 |
notEqual : if (newBytes.length == oldBytes.length) { |
607 |
for (int i = newBytes.length; --i >= 0;) |
619 |
for (int i = newBytes.length; --i >= 0;) |
608 |
if (newBytes[i] != oldBytes[i]) break notEqual; |
620 |
if (newBytes[i] != oldBytes[i]) break notEqual; |
Lines 616-622
Link Here
|
616 |
if (!(reader.isLocal() || reader.isAnonymous()) && reader.hasStructuralChanges(newBytes)) { |
628 |
if (!(reader.isLocal() || reader.isAnonymous()) && reader.hasStructuralChanges(newBytes)) { |
617 |
if (JavaBuilder.DEBUG) |
629 |
if (JavaBuilder.DEBUG) |
618 |
System.out.println("Type has structural changes " + fileName); //$NON-NLS-1$ |
630 |
System.out.println("Type has structural changes " + fileName); //$NON-NLS-1$ |
|
|
631 |
BinaryChangeNatures.put(file, STRUCTURAL); |
619 |
addDependentsOf(new Path(fileName), true); |
632 |
addDependentsOf(new Path(fileName), true); |
|
|
633 |
} else { |
634 |
// dependent projects may ignore a change to this file since wasn't structural (14103) |
635 |
if (BinaryChangeNatures.get(file) != STRUCTURAL) { |
636 |
BinaryChangeNatures.put(file, NON_STRUCTURAL); |
637 |
} |
620 |
} |
638 |
} |
621 |
} catch (ClassFormatException e) { |
639 |
} catch (ClassFormatException e) { |
622 |
addDependentsOf(new Path(fileName), true); |
640 |
addDependentsOf(new Path(fileName), true); |