Author: yradtsevich
Date: 2011-08-08 07:02:43 -0400 (Mon, 08 Aug 2011)
New Revision: 33672
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://issues.jboss.org/browse/JBIDE-9370 : NPE when close VPE during page refresh
execution
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-08-08
10:56:40 UTC (rev 33671)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-08-08
11:02:43 UTC (rev 33672)
@@ -574,7 +574,7 @@
// refresh job in time, so we just ignore
// this exception
}
- } catch(Exception ex) {
+ } catch(RuntimeException ex) {
VpePlugin.getPluginLog().logError(ex);
}
getChangeEvents().remove(eventBean);
@@ -1568,9 +1568,9 @@
// refresh job in time, so we just ignore this
// exception
}
- }catch (Exception ex){
+ } catch (RuntimeException ex) {
VpePlugin.getPluginLog().logError(ex);
- }finally {
+ } finally {
if (switcher != null) {
switcher.stopActiveEditor();
}
@@ -2471,6 +2471,8 @@
} catch (VpeDisposeException ex) {
// vpe vas closed when refresh job is running, so just
// ignore this exception
+ } catch(RuntimeException ex) {
+ VpePlugin.getPluginLog().logError(ex);
} finally {
if (switcher != null) {
switcher.stopActiveEditor();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-08-08
10:56:40 UTC (rev 33671)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-08-08
11:02:43 UTC (rev 33672)
@@ -260,13 +260,8 @@
private boolean addNode(Node sourceNode, nsIDOMNode visualNextNode, nsIDOMNode
visualContainer) {
try {
- nsIDOMNode visualNewNode = null;
-
- try {
- visualNewNode = createNode(sourceNode, visualContainer);
- } catch (Exception ex) {
- VpePlugin.getPluginLog().logError(ex);
- }
+ nsIDOMNode visualNewNode = createNode(sourceNode, visualContainer);
+
// Commented as fix for JBIDE-3012.
// // Fix for JBIDE-1097
@@ -319,7 +314,7 @@
* @return new visual node
*/
public nsIDOMNode createNode(Node sourceNode,
- nsIDOMNode visualOldContainer) {
+ nsIDOMNode visualOldContainer) throws VpeDisposeException {
boolean registerFlag = isCurrentMainDocument();
@@ -338,7 +333,6 @@
// JBIDE-675, checks if editor was disposed or not
if (getPageContext().getSourceBuilder() == null
|| includeDocuments == null) {
-
throw new VpeDisposeException();
}
// check source node can be changed and link can be a null in this case
@@ -385,7 +379,7 @@
VpeTemplate defTemplate = getTemplateManager().getDefTemplate();
creationData = defTemplate.create(getPageContext(), sourceNode,
getVisualDocument());
- } catch (Exception ex) {
+ } catch (RuntimeException ex) {
VpePlugin.getPluginLog().logError(ex);
VpeTemplate defTemplate = getTemplateManager().getDefTemplate();
creationData = defTemplate.create(getPageContext(), sourceNode,
@@ -487,7 +481,7 @@
getPageContext().setCurrentVisualNode(visualOldContainer);
try {
template.validate(getPageContext(), sourceNode, getVisualDocument(), creationData);
- } catch (Exception ex) {
+ } catch (RuntimeException ex) {
VpePlugin.getPluginLog().logError(ex);
}
getPageContext().setCurrentVisualNode(null);
@@ -693,7 +687,7 @@
try {
containerTemplate.setPseudoContent(pageContext, sourceContainer,
visualContainer, getVisualDocument());
- } catch (Exception ex) {
+ } catch (RuntimeException ex) {
VpePlugin.getPluginLog().logError(ex);
}
} else {