Author: scabanovich
Date: 2012-01-10 20:50:47 -0500 (Tue, 10 Jan 2012)
New Revision: 37752
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
Log:
JBIDE-10601
https://issues.joss.org/browse/JBIDE-10601
When copying context, we should check if definition exists. Alternatively, we would have
to do clean build.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2012-01-11
01:37:14 UTC (rev 37751)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2012-01-11
01:50:47 UTC (rev 37752)
@@ -81,12 +81,31 @@
}
if(!clean) {
copy.types.addAll(types);
- copy.typeDefinitions.putAll(typeDefinitions);
- copy.annotations.putAll(annotations);
+ for (String qn: typeDefinitions.keySet()) {
+ TypeDefinition d = typeDefinitions.get(qn);
+ if(d.exists()) {
+ copy.typeDefinitions.put(qn, d);
+ } else {
+ copy.types.remove(qn);
+ }
+ }
+ for (String qn: annotations.keySet()) {
+ AnnotationDefinition d = annotations.get(qn);
+ if(d.exists()) {
+ copy.annotations.put(qn, d);
+ }
+ }
copy.vetoedTypes.addAll(vetoedTypes);
copy.packages.addAll(packages);
- copy.packageDefinitions.putAll(packageDefinitions);
+ for (String qn: packageDefinitions.keySet()) {
+ PackageDefinition d = packageDefinitions.get(qn);
+ if(d.exists()) {
+ copy.packageDefinitions.put(qn, d);
+ } else {
+ packages.remove(qn);
+ }
+ }
for (IPath p: resources.keySet()) {
Set<String> set = resources.get(p);