Lines 252-283
Link Here
|
252 |
*/ |
252 |
*/ |
253 |
private SourceElementParser sourceElementParserCache; |
253 |
private SourceElementParser sourceElementParserCache; |
254 |
|
254 |
|
255 |
/* |
|
|
256 |
* Map from IProject to ClasspathChange |
257 |
*/ |
258 |
public HashMap classpathChanges = new HashMap(); |
259 |
|
260 |
public DeltaProcessor(DeltaProcessingState state, JavaModelManager manager) { |
255 |
public DeltaProcessor(DeltaProcessingState state, JavaModelManager manager) { |
261 |
this.state = state; |
256 |
this.state = state; |
262 |
this.manager = manager; |
257 |
this.manager = manager; |
263 |
} |
258 |
} |
264 |
|
259 |
|
265 |
public ClasspathChange addClasspathChange(IProject project, IClasspathEntry[] oldRawClasspath, IPath oldOutputLocation, IClasspathEntry[] oldResolvedClasspath) { |
|
|
266 |
ClasspathChange change = (ClasspathChange) this.classpathChanges.get(project); |
267 |
if (change == null) { |
268 |
change = new ClasspathChange((JavaProject) this.manager.getJavaModel().getJavaProject(project), oldRawClasspath, oldOutputLocation, oldResolvedClasspath); |
269 |
this.classpathChanges.put(project, change); |
270 |
} else { |
271 |
if (change.oldRawClasspath == null) |
272 |
change.oldRawClasspath = oldRawClasspath; |
273 |
if (change.oldOutputLocation == null) |
274 |
change.oldOutputLocation = oldOutputLocation; |
275 |
if (change.oldResolvedClasspath == null) |
276 |
change.oldResolvedClasspath = oldResolvedClasspath; |
277 |
} |
278 |
return change; |
279 |
} |
280 |
|
281 |
/* |
260 |
/* |
282 |
* Adds the dependents of the given project to the list of the projects |
261 |
* Adds the dependents of the given project to the list of the projects |
283 |
* to update. |
262 |
* to update. |
Lines 487-498
Link Here
|
487 |
} |
466 |
} |
488 |
|
467 |
|
489 |
private void checkExternalFolderChange(IProject project, JavaProject javaProject) { |
468 |
private void checkExternalFolderChange(IProject project, JavaProject javaProject) { |
490 |
ClasspathChange change = (ClasspathChange) this.classpathChanges.get(project); |
469 |
ClasspathChange change = this.state.getClasspathChange(project); |
491 |
this.state.addExternalFolderChange(javaProject, change == null ? null : change.oldResolvedClasspath); |
470 |
this.state.addExternalFolderChange(javaProject, change == null ? null : change.oldResolvedClasspath); |
492 |
} |
471 |
} |
493 |
|
472 |
|
494 |
private void checkProjectReferenceChange(IProject project, JavaProject javaProject) { |
473 |
private void checkProjectReferenceChange(IProject project, JavaProject javaProject) { |
495 |
ClasspathChange change = (ClasspathChange) this.classpathChanges.get(project); |
474 |
ClasspathChange change = this.state.getClasspathChange(project); |
496 |
this.state.addProjectReferenceChange(javaProject, change == null ? null : change.oldResolvedClasspath); |
475 |
this.state.addProjectReferenceChange(javaProject, change == null ? null : change.oldResolvedClasspath); |
497 |
} |
476 |
} |
498 |
|
477 |
|
Lines 1927-1936
Link Here
|
1927 |
} |
1906 |
} |
1928 |
|
1907 |
|
1929 |
// generate classpath change deltas |
1908 |
// generate classpath change deltas |
1930 |
if (this.classpathChanges.size() > 0) { |
1909 |
HashMap classpathChanges = this.state.removeAllClasspathChanges(); |
|
|
1910 |
if (classpathChanges.size() > 0) { |
1931 |
boolean hasDelta = this.currentDelta != null; |
1911 |
boolean hasDelta = this.currentDelta != null; |
1932 |
JavaElementDelta javaDelta = currentDelta(); |
1912 |
JavaElementDelta javaDelta = currentDelta(); |
1933 |
Iterator changes = this.classpathChanges.values().iterator(); |
1913 |
Iterator changes = classpathChanges.values().iterator(); |
1934 |
while (changes.hasNext()) { |
1914 |
while (changes.hasNext()) { |
1935 |
ClasspathChange change = (ClasspathChange) changes.next(); |
1915 |
ClasspathChange change = (ClasspathChange) changes.next(); |
1936 |
int result = change.generateDelta(javaDelta); |
1916 |
int result = change.generateDelta(javaDelta); |
Lines 1955-1961
Link Here
|
1955 |
if (elementsToRefresh != null) { |
1935 |
if (elementsToRefresh != null) { |
1956 |
hasDelta |= createExternalArchiveDelta(elementsToRefresh, null); |
1936 |
hasDelta |= createExternalArchiveDelta(elementsToRefresh, null); |
1957 |
} |
1937 |
} |
1958 |
this.classpathChanges.clear(); |
|
|
1959 |
if (!hasDelta) |
1938 |
if (!hasDelta) |
1960 |
this.currentDelta = null; |
1939 |
this.currentDelta = null; |
1961 |
} |
1940 |
} |