Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2015-04-22 23:48:42 +0000
committerNick Sandonato2015-04-22 23:49:18 +0000
commit4018ef0cdb134fcd922a194c81d8cd29d88b4804 (patch)
tree0e287b0f855076c952164f8bc071074f250924d3
parent80a2bff5fe66fc28253431adabd6b14e9c649354 (diff)
downloadwebtools.sourceediting-4018ef0cdb134fcd922a194c81d8cd29d88b4804.tar.gz
webtools.sourceediting-4018ef0cdb134fcd922a194c81d8cd29d88b4804.tar.xz
webtools.sourceediting-4018ef0cdb134fcd922a194c81d8cd29d88b4804.zip
Bug 462949 - NPE in XMLJavaHyperlinkDetector.detectHyperlinks
Issue is fixed by adding a null-check for a region value returned by selectQualifiedName(...) (can return null) Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
index d640e1c015..615b5d58de 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation and others.
* 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
@@ -230,7 +230,8 @@ public class XMLJavaHyperlinkDetector extends AbstractHyperlinkDetector {
IDocument document = textViewer.getDocument();
// find hyperlink range for Java element
IRegion hyperlinkRegion = region.getLength() > 0 ? region : selectQualifiedName(document, region.getOffset());
- if (isJspJavaContent(document, hyperlinkRegion)) { // Handled by JSPJavaHyperlinkDetector
+ if (hyperlinkRegion == null || // Bug #462949 - Because selectQualifiedName may return null
+ isJspJavaContent(document, hyperlinkRegion)) { // Handled by JSPJavaHyperlinkDetector
return null;
}
String name = null;

Back to the top