Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2015-09-10 19:04:05 +0000
committerStephan Herrmann2015-09-10 19:05:52 +0000
commitcd30c2aefc8ef97a24996dcd5bc12b89d4757b4d (patch)
treec1a2629059e324506bdedf7f8a64d750e8ce6012
parent92c3b72eafd96028cad6a3b6166e68a71c8ec1a5 (diff)
downloadorg.eclipse.objectteams-cd30c2aefc8ef97a24996dcd5bc12b89d4757b4d.tar.gz
org.eclipse.objectteams-cd30c2aefc8ef97a24996dcd5bc12b89d4757b4d.tar.xz
org.eclipse.objectteams-cd30c2aefc8ef97a24996dcd5bc12b89d4757b4d.zip
Bug 477102 - NullPointerException in ResourceMarkable.exists (96)
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java17
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/internal/core/ext/ResourceMarkable.java4
2 files changed, 11 insertions, 10 deletions
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java
index e0b36ce78..21b68ad5f 100644
--- a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java
@@ -1,7 +1,7 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2003, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+ * Copyright 2003, 2015 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute for Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
@@ -10,7 +10,6 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: CallinMarkerCreator2.java 23435 2010-02-04 00:14:38Z stephan $
*
* Please visit http://www.eclipse.org/objectteams for updates and contact.
*
@@ -190,12 +189,14 @@ public class CallinMarkerCreator2 extends JavaEditorActivationListener
IEditorPart editor = (IEditorPart) this.fActiveEditor;
if (baseMarkable.isBinary()) {
IJavaElement baseJavaElement = baseMarkable.getJavaElement();
- this.m_cachedMarkersForJavaElements.remove(baseJavaElement);
- if (this.fActiveEditor != null && this.fActiveEditor instanceof IEditorPart) {
- if (editor.getEditorInput() instanceof IClassFileEditorInput) {
- IClassFile editorClassFile = ((IClassFileEditorInput)editor.getEditorInput()).getClassFile();
- if (editorClassFile != null && !isCreatingMarkersFor(editorClassFile) && editorClassFile.equals(baseJavaElement))
- updateForBaseMarkable(baseMarkable, editor);
+ if (baseJavaElement != null) {
+ this.m_cachedMarkersForJavaElements.remove(baseJavaElement);
+ if (this.fActiveEditor != null && this.fActiveEditor instanceof IEditorPart) {
+ if (editor.getEditorInput() instanceof IClassFileEditorInput) {
+ IClassFile editorClassFile = ((IClassFileEditorInput)editor.getEditorInput()).getClassFile();
+ if (editorClassFile != null && !isCreatingMarkersFor(editorClassFile) && editorClassFile.equals(baseJavaElement))
+ updateForBaseMarkable(baseMarkable, editor);
+ }
}
}
} else {
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/internal/core/ext/ResourceMarkable.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/internal/core/ext/ResourceMarkable.java
index a587e0afd..0d232be61 100644
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/internal/core/ext/ResourceMarkable.java
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/internal/core/ext/ResourceMarkable.java
@@ -1,13 +1,12 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2008 Technical University Berlin, Germany.
+ * Copyright 2008, 2015 Technical University Berlin, Germany.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: ResourceMarkable.java 23435 2010-02-04 00:14:38Z stephan $
*
* Please visit http://www.eclipse.org/objectteams for updates and contact.
*
@@ -92,6 +91,7 @@ public class ResourceMarkable extends AbstractMarkable {
public boolean exists() {
if (!this.fResource.exists()) return false;
IJavaElement javaElement = getJavaElement();
+ if (javaElement == null) return false;
do {
if (!javaElement.exists())
return false;

Back to the top