[549540] Error:Jsp page outline view click JavaScript method
diff --git a/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSelectionConverterFactory.java b/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSelectionConverterFactory.java
index f2fe818..e722b67 100755
--- a/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSelectionConverterFactory.java
+++ b/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSelectionConverterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -132,7 +132,11 @@
@Override
public IRegion getSelectionRegion(Object o) {
if (o instanceof IDOMNode) {
- IStructuredDocumentRegion documentRegion = ((IDOMNode)o).getFirstStructuredDocumentRegion();
+ IDOMNode domNode = ((IDOMNode)o);
+ IStructuredDocumentRegion documentRegion = domNode.getFirstStructuredDocumentRegion();
+ if (documentRegion == null) {
+ return new Region(domNode.getStartOffset(), domNode.getLength());
+ }
IRegion nameRegion = getNameRegion(documentRegion);
if (nameRegion != null) {
return nameRegion;
diff --git a/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConverterFactory.java b/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConverterFactory.java
index 98c6bc5..47c5821 100755
--- a/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConverterFactory.java
+++ b/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConverterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -126,7 +126,11 @@
@Override
public IRegion getSelectionRegion(Object o) {
if (o instanceof IDOMNode) {
- IStructuredDocumentRegion documentRegion = ((IDOMNode)o).getFirstStructuredDocumentRegion();
+ IDOMNode domNode = ((IDOMNode)o);
+ IStructuredDocumentRegion documentRegion = domNode.getFirstStructuredDocumentRegion();
+ if (documentRegion == null) {
+ return new Region(domNode.getStartOffset(), domNode.getLength());
+ }
IRegion nameRegion = getNameRegion(documentRegion);
if (nameRegion != null) {
return nameRegion;