Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-09-10 18:17:04 +0000
committerkmoore2007-09-10 18:17:04 +0000
commit37af69700e048ab2b5b597abb1cbd339368a13d0 (patch)
tree187714a0b63ee573a83a4ae3fbe6769c9c216eae /jpa/plugins/org.eclipse.jpt.core
parent02112aa13667b9ff0cf74ff6e86cdc22111f3586 (diff)
downloadwebtools.dali-37af69700e048ab2b5b597abb1cbd339368a13d0.tar.gz
webtools.dali-37af69700e048ab2b5b597abb1cbd339368a13d0.tar.xz
webtools.dali-37af69700e048ab2b5b597abb1cbd339368a13d0.zip
191282 - applied patch - NPE on rename class
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java
index ca6a080db8..eca26005c7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java
@@ -765,7 +765,15 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType
}
public boolean includes(int offset) {
- return this.fullTextRange().includes(offset);
+ ITextRange fullTextRange = this.fullTextRange();
+ if (fullTextRange == null) {
+ //This happens if the type no longer exists in the java (rename in editor).
+ //The text selection event is fired before the update from java so our
+ //model has not yet had a chance to update appropriately. For now, avoid the NPE,
+ //not sure of the ultimate solution to these 2 threads accessing our model
+ return false;
+ }
+ return fullTextRange.includes(offset);
}
public ITextRange fullTextRange() {

Back to the top