Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] NPE with HEAD code

Whoops. Clown nose for me. The previous patch was dumb. :) Attached is a
*working* simple patch.

On Thu, 2004-04-01 at 16:08, Jared Burns wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=57130
> 
> Here's a simple patch that fixes the problem.
> 
> - Jared
> 
> On Thu, 2004-04-01 at 14:40, John Arthorne wrote:
> > I get a NPE opening editors with all of the UI module loaded from HEAD
> > (text file, new workspace).  Is there something outside the UI module
> > that I need to get this working?  Known bug?
> > 
> > org.eclipse.core.runtime.CoreException[1]:
> > java.lang.NullPointerException
> >         at java.lang.Throwable.<init>(Throwable.java)
> >         at java.lang.Throwable.<init>(Throwable.java:73)
> >         at
> > java.lang.NullPointerException.<init>(NullPointerException.java:60)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.findContributedAction(AbstractTextEditor.java:3592)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.getAction(AbstractTextEditor.java:3567)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.updateInsertModeAction(AbstractTextEditor.java:4658)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.handleInsertModeChanged(AbstractTextEditor.java:4652)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.setInsertMode(AbstractTextEditor.java:4487)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.switchToNextInsertMode(AbstractTextEditor.java:4518)
> >         at
> > org.eclipse.ui.texteditor.AbstractTextEditor.configureInsertMode(AbstractTextEditor.java:4543)
> >         at
> > org.eclipse.ui.editors.text.TextEditor.initializeEditor(TextEditor.java:94)
> >         at
> > org.eclipse.ui.texteditor.ExtendedTextEditor.<init>(ExtendedTextEditor.java:180)
> >         at
> > org.eclipse.ui.editors.text.TextEditor.<init>(TextEditor.java:73)
> >         at java.lang.Class.newInstanceImpl(Native Method)
> >         at java.lang.Class.newInstance(Class.java)
Index: AbstractTextEditor.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java,v
retrieving revision 1.98
diff -u -r1.98 AbstractTextEditor.java
--- AbstractTextEditor.java	1 Apr 2004 16:04:55 -0000	1.98
+++ AbstractTextEditor.java	2 Apr 2004 00:13:15 -0000
@@ -3589,7 +3589,7 @@
 			for (int i= 0; i < elements.length; i++) {
 				IConfigurationElement element= elements[i];				
 				if (TAG_CONTRIBUTION_TYPE.equals(element.getName())) {
-					if (!getSite().getId().equals(element.getAttribute("targetID"))) //$NON-NLS-1$
+					if (getSite() == null || !getSite().getId().equals(element.getAttribute("targetID"))) //$NON-NLS-1$
 						continue;
 
 					IConfigurationElement[] children= element.getChildren("action"); //$NON-NLS-1$

Back to the top