Lines 201-207
Link Here
|
201 |
ReferenceCollection refs = (ReferenceCollection) valueTable[i]; |
201 |
ReferenceCollection refs = (ReferenceCollection) valueTable[i]; |
202 |
if (refs.includes(internedQualifiedNames, internedSimpleNames)) { |
202 |
if (refs.includes(internedQualifiedNames, internedSimpleNames)) { |
203 |
IFile file = javaBuilder.currentProject.getFile(typeLocator); |
203 |
IFile file = javaBuilder.currentProject.getFile(typeLocator); |
204 |
SourceFile sourceFile = findSourceFile(file); |
204 |
SourceFile sourceFile = findSourceFile(file, true); |
205 |
if (sourceFile == null) continue next; |
205 |
if (sourceFile == null) continue next; |
206 |
if (sourceFiles.contains(sourceFile)) continue next; |
206 |
if (sourceFiles.contains(sourceFile)) continue next; |
207 |
if (compiledAllAtOnce && previousSourceFiles != null && previousSourceFiles.contains(sourceFile)) |
207 |
if (compiledAllAtOnce && previousSourceFiles != null && previousSourceFiles.contains(sourceFile)) |
Lines 306-321
Link Here
|
306 |
// delete generated files and recompile any affected source files |
306 |
// delete generated files and recompile any affected source files |
307 |
try { |
307 |
try { |
308 |
for (int j = deletedGeneratedFiles.length; --j >= 0;) { |
308 |
for (int j = deletedGeneratedFiles.length; --j >= 0;) { |
309 |
SourceFile sourceFile = findSourceFile(deletedGeneratedFiles[j]); |
309 |
IFile deletedFile = deletedGeneratedFiles[j]; |
310 |
if (sourceFile == null) continue; |
310 |
if (deletedFile.exists()) continue; // only delete .class files for source files that were actually deleted |
|
|
311 |
|
312 |
SourceFile sourceFile = findSourceFile(deletedFile, false); |
311 |
String typeLocator = sourceFile.typeLocator(); |
313 |
String typeLocator = sourceFile.typeLocator(); |
312 |
int mdSegmentCount = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); |
314 |
int mdSegmentCount = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); |
313 |
IPath typePath = sourceFile.resource.getFullPath().removeFirstSegments(mdSegmentCount).removeFileExtension(); |
315 |
IPath typePath = sourceFile.resource.getFullPath().removeFirstSegments(mdSegmentCount).removeFileExtension(); |
|
|
316 |
addDependentsOf(typePath, true); // add dependents of the source file since its now deleted |
317 |
previousSourceFiles = null; // existing source files did not see it as deleted since they were compiled before it was |
314 |
char[][] definedTypeNames = newState.getDefinedTypeNamesFor(typeLocator); |
318 |
char[][] definedTypeNames = newState.getDefinedTypeNamesFor(typeLocator); |
315 |
if (definedTypeNames == null) { // defined a single type matching typePath |
319 |
if (definedTypeNames == null) { // defined a single type matching typePath |
316 |
removeClassFile(typePath, sourceFile.sourceLocation.binaryFolder); |
320 |
removeClassFile(typePath, sourceFile.sourceLocation.binaryFolder); |
317 |
} else { |
321 |
} else { |
318 |
addDependentsOf(typePath, true); // add dependents of the source file since it may be involved in a name collision |
|
|
319 |
if (definedTypeNames.length > 0) { // skip it if it failed to successfully define a type |
322 |
if (definedTypeNames.length > 0) { // skip it if it failed to successfully define a type |
320 |
IPath packagePath = typePath.removeLastSegments(1); |
323 |
IPath packagePath = typePath.removeLastSegments(1); |
321 |
for (int d = 0, l = definedTypeNames.length; d < l; d++) |
324 |
for (int d = 0, l = definedTypeNames.length; d < l; d++) |
Lines 692-698
Link Here
|
692 |
IFile[] addedGeneratedFiles = result.addedFiles; |
695 |
IFile[] addedGeneratedFiles = result.addedFiles; |
693 |
if (addedGeneratedFiles != null) { |
696 |
if (addedGeneratedFiles != null) { |
694 |
for (int j = addedGeneratedFiles.length; --j >= 0;) { |
697 |
for (int j = addedGeneratedFiles.length; --j >= 0;) { |
695 |
SourceFile sourceFile = findSourceFile(addedGeneratedFiles[j]); |
698 |
SourceFile sourceFile = findSourceFile(addedGeneratedFiles[j], true); |
696 |
if (sourceFile != null && !sourceFiles.contains(sourceFile)) |
699 |
if (sourceFile != null && !sourceFiles.contains(sourceFile)) |
697 |
this.sourceFiles.add(sourceFile); |
700 |
this.sourceFiles.add(sourceFile); |
698 |
} |
701 |
} |