Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-05-27 19:57:36 -0400
committerpelder2008-05-27 19:57:36 -0400
commit7a601a9ad02d0bb578ed273d1956a298154188cc (patch)
tree1804578da85a1c4a81dda18d5b26439f6ee76a45
parent0e7ae4f5d6bcfa4c016ebd27bab8442939443514 (diff)
downloadorg.eclipse.jet-7a601a9ad02d0bb578ed273d1956a298154188cc.tar.gz
org.eclipse.jet-7a601a9ad02d0bb578ed273d1956a298154188cc.tar.xz
org.eclipse.jet-7a601a9ad02d0bb578ed273d1956a298154188cc.zip
[234279] Exceptions in IWorkspaceAction.getResource() silently aborts processing of JET's committing of workspace actions
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
index 2d8a591..bef92ad 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java
@@ -234,7 +234,7 @@ public final class WorkspaceContextExtender
protected boolean isActionRequired(JET2Context context, IWorkspaceAction action)
{
- final IResource resource = action.getResource();
+ final IResource resource = getActionResource(action);
if(resource != null && !(resource instanceof IFile)) {
// For non-files, action is required only if resource does not exist
return !resource.exists();
@@ -262,6 +262,20 @@ public final class WorkspaceContextExtender
return ActionsUtil.finalizeAndTestForChange(file, ext.getContentWriter(), existingContents);
}
+ private IResource getActionResource(IWorkspaceAction action)
+ {
+ IResource resource;
+ try
+ {
+ resource = action.getResource();
+ }
+ catch (JET2TagException e)
+ {
+ resource = null;
+ }
+ return resource;
+ }
+
/**
* @param context
* @param action
@@ -299,7 +313,7 @@ public final class WorkspaceContextExtender
*/
protected void doActionCommitted(final JET2Context context, final IWorkspaceAction action) throws JET2TagException
{
- final IResource resource = action.getResource();
+ final IResource resource = getActionResource(action);
if(action instanceof IWorkspaceActionExtension) {
ActionsUtil.contentCommitted(((IWorkspaceActionExtension)action).getContentWriter(), resource);
}

Back to the top