Lines 85-92
Link Here
|
85 |
|
85 |
|
86 |
private void synchWithJavaDelta(IJavaElementDelta delta) { |
86 |
private void synchWithJavaDelta(IJavaElementDelta delta) { |
87 |
switch (delta.getElement().getElementType()) { |
87 |
switch (delta.getElement().getElementType()) { |
88 |
case IJavaElement.JAVA_MODEL : |
|
|
89 |
case IJavaElement.JAVA_PROJECT : |
88 |
case IJavaElement.JAVA_PROJECT : |
|
|
89 |
if (this.updateOnClasspathChanges(delta)) { |
90 |
break; |
91 |
} |
92 |
case IJavaElement.JAVA_MODEL : |
90 |
case IJavaElement.PACKAGE_FRAGMENT_ROOT : |
93 |
case IJavaElement.PACKAGE_FRAGMENT_ROOT : |
91 |
case IJavaElement.PACKAGE_FRAGMENT : |
94 |
case IJavaElement.PACKAGE_FRAGMENT : |
92 |
this.synchChildrenWithJavaDelta(delta); |
95 |
this.synchChildrenWithJavaDelta(delta); |
Lines 123-128
Link Here
|
123 |
} |
126 |
} |
124 |
} |
127 |
} |
125 |
|
128 |
|
|
|
129 |
//bug 235384 - we need to update all compilation units when a classpath change occurs. |
130 |
//The persistence.jar could have been added/removed from the classpath which affects |
131 |
//whether we know about the jpa annotations or not. |
132 |
private boolean updateOnClasspathChanges(IJavaElementDelta delta) { |
133 |
if (BitTools.flagIsSet(delta.getFlags(), IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) || |
134 |
BitTools.flagIsSet(delta.getFlags(), IJavaElementDelta.F_CLASSPATH_CHANGED)) { |
135 |
this.jpaCompilationUnit.updateFromJava(); |
136 |
return true; |
137 |
} |
138 |
return false; |
139 |
} |
140 |
|
126 |
public void updateFromResource() { |
141 |
public void updateFromResource() { |
127 |
this.jpaCompilationUnit.updateFromJava(); |
142 |
this.jpaCompilationUnit.updateFromJava(); |
128 |
} |
143 |
} |