Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-09-10 18:14:35 +0000
committerkmoore2007-09-10 18:14:35 +0000
commit630378bcd023c5a44296bc48f81cfb7e9b76a49a (patch)
tree1f778f48ebd048e8ab5c00c170e3bff726cd2ebe
parentfa5a694d16eb26af165a0cc7194b4405200cd3bc (diff)
downloadwebtools.dali-630378bcd023c5a44296bc48f81cfb7e9b76a49a.tar.gz
webtools.dali-630378bcd023c5a44296bc48f81cfb7e9b76a49a.tar.xz
webtools.dali-630378bcd023c5a44296bc48f81cfb7e9b76a49a.zip
191282 - applied patch - NPE on rename class
-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 0aa62bae94..0ecd3685e2 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
@@ -779,7 +779,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