Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[bpel-dev] patch8=fix_npe_when_switching_to_src_tab_from_other_file

Hi Simon,

 

The attached patch fixes a very annoying NPE:

-          Open source tab of the BPEL editor;

-          Open another file in the Eclipse;

-          Switch to the BPEL editor.

NPE is thrown

(this is #6 in the https://bugs.eclipse.org/bugs/show_bug.cgi?id=197468)

 

Thanks,

            Vitaly.

### Eclipse Workspace Patch 1.0
#P org.eclipse.bpel.ui
Index: src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Attic/BPELMultipageEditorPart.java,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 BPELMultipageEditorPart.java
--- src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	30 Jul 2007 08:22:06 -0000	1.1.2.6
+++ src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	30 Jul 2007 16:12:44 -0000
@@ -324,6 +324,8 @@
 	private OutlinePage outlinePage;
 	protected BPELTabbedPropertySheetPage currentPropertySheetPage;
 	
+	protected ActionRegistry actionRegistry;
+	 
 	private static int DESIGN_PAGE_INDEX = 0;
 	private static int SOURCE_PAGE_INDEX = 1;
 
@@ -529,6 +531,13 @@
 	}
 
 	
+	protected ActionRegistry getActionRegistry() {
+		if (actionRegistry == null)
+			actionRegistry = new ActionRegistry();
+		return actionRegistry;
+	}
+
+	
 	public Object getAdapter(Class type) {
 		if (type == Process.class) {
 			return process;
@@ -572,7 +581,11 @@
 			return currentPropertySheetPage;
 		}
 
-	    return super.getAdapter(type);
+		if (type == ActionRegistry.class) {
+			return getActionRegistry();
+		}
+		
+		return super.getAdapter(type);
 	  }
 
 	public CommandStack getCommandStack() {

Back to the top