Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Another NPE and VE won't display my composite after some simple source editing.
Another NPE and VE won't display my composite after some simple source editing. [message #100860] Fri, 29 July 2005 22:03 Go to next message
Joel Kamentz is currently offline Joel KamentzFriend
Messages: 30
Registered: July 2009
Member
Discovered a case of a simple source edit which will choke VE and prevent it
from displaying the visuals for my composite.

I have a couple cases where I have a label associated with a scale control.
Scales aren't too informative by themselves, so I set up an event handler so
that a label can show the scale's value when it changes. However, I want
the label above the scale so it needs to be defined first.

Initially I use VE to define everything and get the following source code
where m_probDirs is the Scale and m_probDirsDisplay is the label:

m_probDirsDisplay = new CLabel(composite, SWT.NONE);
m_probDirsDisplay.setText("some text");
m_probDirs = new Scale(composite, SWT.NONE);
m_probDirs.setSelection(0);
m_probDirs.addSelectionListener(new
org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent
e) {
m_probDirsDisplay.setText("probability of dirs (vs. jars): "
+
m_probDirs.getSelection() + "%");
}
});

I want the label value to be correct without having to wait until the scale
is manipulated. So, I move the inital setText call after the code to create
the Scale:

m_probDirsDisplay = new CLabel(composite, SWT.NONE);
m_probDirs = new Scale(composite, SWT.NONE);
m_probDirs.setSelection(0);
m_probDirs.addSelectionListener(new
org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent
e) {
m_probDirsDisplay.setText("probability of dirs (vs. jars): "
+
m_probDirs.getSelection() + "%");
}
});
m_probDirsDisplay.setText("probability of dirs (vs. jars): " +
m_probDirs.getSelection() + "% ");

This has the added benefit of making the visual editor area display a real
value and size things better. The change works until I close and re-open
the visual editor on that class. (Might need to clean project to force a
re-parse.) Then I get the following message box:

Error trying to set new file into editor:
NPE (with no stack trace)

and some stack traces in the log (which follow later).

This seems an awfully simple change, and I would expect VE to handle it.

I can understand that visual editing might need to be an all-or-nothing
deal. But, it would be nice if there were a way to get a clue as to what
was bothering VE. I made a lucky guess and determined what the problem was.
Otherwise, here was a class I'd spent a few hours time one, primarily using
VE. I'd even made quite a few changes since that fatal source edit, without
VE complaining. I would be upsetting for VE to all-of-a-sudden tell you it
couldn't handle something which it had just been editing!



..log file contents:


!ENTRY org.eclipse.ve.java.core 4 0 2005-07-29 17:58:29.295
!MESSAGE Exception thrown.
!STACK 0
java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.ui 4 4 2005-07-29 17:58:29.311
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-07-29 17:58:29.327
!MESSAGE Failed to execute runnable (java.lang.NullPointerException)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
... 18 more

!ENTRY org.eclipse.jem.proxy 2 0 2005-07-29 17:58:29.795
!MESSAGE
+++ Warning +++: Fri Jul 29 17:58:29 EDT 2005 Project (Test1)-VM for
Test1:err>
org.eclipse.jem.internal.proxy.common.remote.CommandErrorExc eption--
Error code:7 Value data:"java.lang.NullPointerException:null"
at
org.eclipse.jem.internal.proxy.common.remote.Commands.readBa ckValue(Commands.java:1254)
at
org.eclipse.jem.internal.proxy.vm.remote.ConnectionHandler.r un(ConnectionHandler.java:454)
at
org.eclipse.jem.internal.proxy.vm.remote.CallbackHandler.cal lbackWithParms(CallbackHandler.java:150)
at
org.eclipse.ve.internal.swt.targetvm.ControlManager$5.run(Co ntrolManager.java:637)
at
org.eclipse.jem.internal.proxy.vm.remote.RemoteVMServerThrea d.doCallback(RemoteVMServerThread.java:541)
at
org.eclipse.ve.internal.swt.targetvm.ControlManager$ControlM anagerFeedbackController.run(ControlManager.java:634)
at
org.eclipse.ve.internal.swt.targetvm.ControlManager$1.run(Co ntrolManager.java:480)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at
org.eclipse.ve.internal.swt.targetvm.Environment$3.run(Envir onment.java:68)
Re: Another NPE and VE won't display my composite after some simple source editing. [message #100924 is a reply to message #100860] Mon, 01 August 2005 12:52 Go to previous messageGo to next message
Joe Winchester is currently offline Joe WinchesterFriend
Messages: 496
Registered: July 2009
Senior Member
Hi Joel,

From your description I have tried to re-create the error you got but
don't have enough information for me to encounter it. Could you please
post an idiot proof description of how to get the error, e.g.

1 - Open file foo.java
2 - select the lines 30 to 40. Cut and paste these so they are at line 20.
3 - Close the editor.
4 - Clean the project
5 - Re-open and see the VE crash.

Also post the full source code of the file(s) in error. Don't include
that much narrative of why you are doing what you are doing with moving
the code around. To create a bug report all we need is a set of
re-creatable steps from a standing start where we can make it crash and
then see what's wrong. If it crashes it's a bug.

By the way - there are two bits of parsing that go on with the VE when
you edit source code. One occurs each time you change the source and is
a snippit reload that tries to do intelligent delta on what has changed
into the model. If this can't do its job (which sometimes legitimately
occurs if the sippit analyzer realizes the changes made are too big to
delta in) then a full reload occurs. You can trigger this at any time
by pushing the pause button at the top and then unpausing. Each time
the VE closes a file and re-opens it we used to always re-parse from
scratch the source, however now we have a cache that holds information
that helps performance. This cache is what is cleared by doing a
Project>Clean.

Best regards,

Joe Winchester
Re: Another NPE and VE won't display my composite after some simple source editing. [message #100968 is a reply to message #100924] Mon, 01 August 2005 17:56 Go to previous messageGo to next message
Joel Kamentz is currently offline Joel KamentzFriend
Messages: 30
Registered: July 2009
Member
Ok. Simple steps.

Create a new workspace.
Set editor preferences to show line numbers.
Create a new plugin project named Test. Keep all defaults, but do not use a
template.
In the test package, create a new visual class SWT->Composite named C.
Display palette and java bean views.
Drop a CLabel in upper left (use default field name).
Drop a Scale somewhere below it (use default field name).
Add a selection event handler to the Scale (via popup menu from visuals
display).
delete line 21: cLabel.setText("CLabel");
now, between lines 28 and 29:
28: });
29: setSize(new Point(300, 200));

create a new line 29: cLabel.setText("CLabel " + scale.getSelection());

Save source file (using control-S).

Pause and unpause VE (using toolbar). Get NPE.

entire C.java:
package test;

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Scale;

public class C extends Composite {

private CLabel cLabel = null;
private Scale scale = null;

public C(Composite parent, int style) {
super(parent, style);
initialize();
}

private void initialize() {
cLabel = new CLabel(this, SWT.NONE);
cLabel.setBounds(new org.eclipse.swt.graphics.Rectangle(29,30,38,19));
scale = new Scale(this, SWT.NONE);
scale.setBounds(new org.eclipse.swt.graphics.Rectangle(75,106,170,42));
scale.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
System.out.println("widgetSelected()"); // TODO Auto-generated Event
stub widgetSelected()
}
});
cLabel.setText("CLabel " + scale.getSelection());
setSize(new Point(300, 200));
}

}



..log file contains:
!SESSION 2005-08-01
13:50:19.816 -----------------------------------------------
eclipse.buildId=I20050627-1435
java.version=1.5.0_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -showlocation
Command-line arguments: -os win32 -ws win32 -arch x86 -showlocation

!ENTRY org.eclipse.ve.java.core 4 0 2005-08-01 13:55:10.201
!MESSAGE Exception thrown.
!STACK 0
java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.ui 4 4 2005-08-01 13:55:10.217
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-08-01 13:55:10.217
!MESSAGE Failed to execute runnable (java.lang.NullPointerException)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
... 18 more




"Joe Winchester" <winchest@uk.ibm.com> wrote in message
news:dcl5u7$lhg$1@news.eclipse.org...
> Hi Joel,
>
> From your description I have tried to re-create the error you got but
> don't have enough information for me to encounter it. Could you please
> post an idiot proof description of how to get the error, e.g.
>
> 1 - Open file foo.java
> 2 - select the lines 30 to 40. Cut and paste these so they are at line
> 20.
> 3 - Close the editor.
> 4 - Clean the project
> 5 - Re-open and see the VE crash.
>
> Also post the full source code of the file(s) in error. Don't include
> that much narrative of why you are doing what you are doing with moving
> the code around. To create a bug report all we need is a set of
> re-creatable steps from a standing start where we can make it crash and
> then see what's wrong. If it crashes it's a bug.
>
> By the way - there are two bits of parsing that go on with the VE when you
> edit source code. One occurs each time you change the source and is a
> snippit reload that tries to do intelligent delta on what has changed into
> the model. If this can't do its job (which sometimes legitimately occurs
> if the sippit analyzer realizes the changes made are too big to delta in)
> then a full reload occurs. You can trigger this at any time by pushing
> the pause button at the top and then unpausing. Each time the VE closes a
> file and re-opens it we used to always re-parse from scratch the source,
> however now we have a cache that holds information that helps performance.
> This cache is what is cleared by doing a Project>Clean.
>
> Best regards,
>
> Joe Winchester
Re: Another NPE and VE won't display my composite after some simple source editing. [message #101533 is a reply to message #100968] Mon, 08 August 2005 20:38 Go to previous message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
Joel,
I opened bug 106404 to track this problem Please add yourself to the CC list if
you want to follow the report -->
https://bugs.eclipse.org/bugs/show_bug.cgi?id=106404

Regards...
Peter Walker
VE Development

Joel Kamentz wrote:
> Ok. Simple steps.
>
> Create a new workspace.
> Set editor preferences to show line numbers.
> Create a new plugin project named Test. Keep all defaults, but do not use a
> template.
> In the test package, create a new visual class SWT->Composite named C.
> Display palette and java bean views.
> Drop a CLabel in upper left (use default field name).
> Drop a Scale somewhere below it (use default field name).
> Add a selection event handler to the Scale (via popup menu from visuals
> display).
> delete line 21: cLabel.setText("CLabel");
> now, between lines 28 and 29:
> 28: });
> 29: setSize(new Point(300, 200));
>
> create a new line 29: cLabel.setText("CLabel " + scale.getSelection());
>
> Save source file (using control-S).
>
> Pause and unpause VE (using toolbar). Get NPE.
>
> entire C.java:
> package test;
>
> import org.eclipse.swt.graphics.Point;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.custom.CLabel;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Scale;
>
> public class C extends Composite {
>
> private CLabel cLabel = null;
> private Scale scale = null;
>
> public C(Composite parent, int style) {
> super(parent, style);
> initialize();
> }
>
> private void initialize() {
> cLabel = new CLabel(this, SWT.NONE);
> cLabel.setBounds(new org.eclipse.swt.graphics.Rectangle(29,30,38,19));
> scale = new Scale(this, SWT.NONE);
> scale.setBounds(new org.eclipse.swt.graphics.Rectangle(75,106,170,42));
> scale.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
> public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
> System.out.println("widgetSelected()"); // TODO Auto-generated Event
> stub widgetSelected()
> }
> });
> cLabel.setText("CLabel " + scale.getSelection());
> setSize(new Point(300, 200));
> }
>
> }
>
>
>
> .log file contains:
> !SESSION 2005-08-01
> 13:50:19.816 -----------------------------------------------
> eclipse.buildId=I20050627-1435
> java.version=1.5.0_04
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments: -showlocation
> Command-line arguments: -os win32 -ws win32 -arch x86 -showlocation
>
> !ENTRY org.eclipse.ve.java.core 4 0 2005-08-01 13:55:10.201
> !MESSAGE Exception thrown.
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
>
> !ENTRY org.eclipse.ui 4 4 2005-08-01 13:55:10.217
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 2005-08-01 13:55:10.217
> !MESSAGE Failed to execute runnable (java.lang.NullPointerException)
> !STACK 0
> org.eclipse.swt.SWTException: Failed to execute runnable
> (java.lang.NullPointerException)
> at org.eclipse.swt.SWT.error(SWT.java:2942)
> at org.eclipse.swt.SWT.error(SWT.java:2865)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
> ... 18 more
>
>
>
>
> "Joe Winchester" <winchest@uk.ibm.com> wrote in message
> news:dcl5u7$lhg$1@news.eclipse.org...
>
>>Hi Joel,
>>
>>From your description I have tried to re-create the error you got but
>>don't have enough information for me to encounter it. Could you please
>>post an idiot proof description of how to get the error, e.g.
>>
>>1 - Open file foo.java
>>2 - select the lines 30 to 40. Cut and paste these so they are at line
>>20.
>>3 - Close the editor.
>>4 - Clean the project
>>5 - Re-open and see the VE crash.
>>
>>Also post the full source code of the file(s) in error. Don't include
>>that much narrative of why you are doing what you are doing with moving
>>the code around. To create a bug report all we need is a set of
>>re-creatable steps from a standing start where we can make it crash and
>>then see what's wrong. If it crashes it's a bug.
>>
>>By the way - there are two bits of parsing that go on with the VE when you
>>edit source code. One occurs each time you change the source and is a
>>snippit reload that tries to do intelligent delta on what has changed into
>>the model. If this can't do its job (which sometimes legitimately occurs
>>if the sippit analyzer realizes the changes made are too big to delta in)
>>then a full reload occurs. You can trigger this at any time by pushing
>>the pause button at the top and then unpausing. Each time the VE closes a
>>file and re-opens it we used to always re-parse from scratch the source,
>>however now we have a cache that holds information that helps performance.
>>This cache is what is cleared by doing a Project>Clean.
>>
>>Best regards,
>>
>>Joe Winchester
>
>
>
Re: Another NPE and VE won't display my composite after some simple source editing. [message #610089 is a reply to message #100860] Mon, 01 August 2005 12:52 Go to previous message
Joe Winchester is currently offline Joe WinchesterFriend
Messages: 496
Registered: July 2009
Senior Member
Hi Joel,

From your description I have tried to re-create the error you got but
don't have enough information for me to encounter it. Could you please
post an idiot proof description of how to get the error, e.g.

1 - Open file foo.java
2 - select the lines 30 to 40. Cut and paste these so they are at line 20.
3 - Close the editor.
4 - Clean the project
5 - Re-open and see the VE crash.

Also post the full source code of the file(s) in error. Don't include
that much narrative of why you are doing what you are doing with moving
the code around. To create a bug report all we need is a set of
re-creatable steps from a standing start where we can make it crash and
then see what's wrong. If it crashes it's a bug.

By the way - there are two bits of parsing that go on with the VE when
you edit source code. One occurs each time you change the source and is
a snippit reload that tries to do intelligent delta on what has changed
into the model. If this can't do its job (which sometimes legitimately
occurs if the sippit analyzer realizes the changes made are too big to
delta in) then a full reload occurs. You can trigger this at any time
by pushing the pause button at the top and then unpausing. Each time
the VE closes a file and re-opens it we used to always re-parse from
scratch the source, however now we have a cache that holds information
that helps performance. This cache is what is cleared by doing a
Project>Clean.

Best regards,

Joe Winchester
Re: Another NPE and VE won't display my composite after some simple source editing. [message #610096 is a reply to message #100924] Mon, 01 August 2005 17:56 Go to previous message
Joel Kamentz is currently offline Joel KamentzFriend
Messages: 30
Registered: July 2009
Member
Ok. Simple steps.

Create a new workspace.
Set editor preferences to show line numbers.
Create a new plugin project named Test. Keep all defaults, but do not use a
template.
In the test package, create a new visual class SWT->Composite named C.
Display palette and java bean views.
Drop a CLabel in upper left (use default field name).
Drop a Scale somewhere below it (use default field name).
Add a selection event handler to the Scale (via popup menu from visuals
display).
delete line 21: cLabel.setText("CLabel");
now, between lines 28 and 29:
28: });
29: setSize(new Point(300, 200));

create a new line 29: cLabel.setText("CLabel " + scale.getSelection());

Save source file (using control-S).

Pause and unpause VE (using toolbar). Get NPE.

entire C.java:
package test;

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Scale;

public class C extends Composite {

private CLabel cLabel = null;
private Scale scale = null;

public C(Composite parent, int style) {
super(parent, style);
initialize();
}

private void initialize() {
cLabel = new CLabel(this, SWT.NONE);
cLabel.setBounds(new org.eclipse.swt.graphics.Rectangle(29,30,38,19));
scale = new Scale(this, SWT.NONE);
scale.setBounds(new org.eclipse.swt.graphics.Rectangle(75,106,170,42));
scale.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
System.out.println("widgetSelected()"); // TODO Auto-generated Event
stub widgetSelected()
}
});
cLabel.setText("CLabel " + scale.getSelection());
setSize(new Point(300, 200));
}

}



..log file contains:
!SESSION 2005-08-01
13:50:19.816 -----------------------------------------------
eclipse.buildId=I20050627-1435
java.version=1.5.0_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -showlocation
Command-line arguments: -os win32 -ws win32 -arch x86 -showlocation

!ENTRY org.eclipse.ve.java.core 4 0 2005-08-01 13:55:10.201
!MESSAGE Exception thrown.
!STACK 0
java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.ui 4 4 2005-08-01 13:55:10.217
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-08-01 13:55:10.217
!MESSAGE Failed to execute runnable (java.lang.NullPointerException)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.NullPointerException
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
at
org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
... 18 more




"Joe Winchester" <winchest@uk.ibm.com> wrote in message
news:dcl5u7$lhg$1@news.eclipse.org...
> Hi Joel,
>
> From your description I have tried to re-create the error you got but
> don't have enough information for me to encounter it. Could you please
> post an idiot proof description of how to get the error, e.g.
>
> 1 - Open file foo.java
> 2 - select the lines 30 to 40. Cut and paste these so they are at line
> 20.
> 3 - Close the editor.
> 4 - Clean the project
> 5 - Re-open and see the VE crash.
>
> Also post the full source code of the file(s) in error. Don't include
> that much narrative of why you are doing what you are doing with moving
> the code around. To create a bug report all we need is a set of
> re-creatable steps from a standing start where we can make it crash and
> then see what's wrong. If it crashes it's a bug.
>
> By the way - there are two bits of parsing that go on with the VE when you
> edit source code. One occurs each time you change the source and is a
> snippit reload that tries to do intelligent delta on what has changed into
> the model. If this can't do its job (which sometimes legitimately occurs
> if the sippit analyzer realizes the changes made are too big to delta in)
> then a full reload occurs. You can trigger this at any time by pushing
> the pause button at the top and then unpausing. Each time the VE closes a
> file and re-opens it we used to always re-parse from scratch the source,
> however now we have a cache that holds information that helps performance.
> This cache is what is cleared by doing a Project>Clean.
>
> Best regards,
>
> Joe Winchester
Re: Another NPE and VE won't display my composite after some simple source editing. [message #610176 is a reply to message #100968] Mon, 08 August 2005 20:38 Go to previous message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
Joel,
I opened bug 106404 to track this problem Please add yourself to the CC list if
you want to follow the report -->
https://bugs.eclipse.org/bugs/show_bug.cgi?id=106404

Regards...
Peter Walker
VE Development

Joel Kamentz wrote:
> Ok. Simple steps.
>
> Create a new workspace.
> Set editor preferences to show line numbers.
> Create a new plugin project named Test. Keep all defaults, but do not use a
> template.
> In the test package, create a new visual class SWT->Composite named C.
> Display palette and java bean views.
> Drop a CLabel in upper left (use default field name).
> Drop a Scale somewhere below it (use default field name).
> Add a selection event handler to the Scale (via popup menu from visuals
> display).
> delete line 21: cLabel.setText("CLabel");
> now, between lines 28 and 29:
> 28: });
> 29: setSize(new Point(300, 200));
>
> create a new line 29: cLabel.setText("CLabel " + scale.getSelection());
>
> Save source file (using control-S).
>
> Pause and unpause VE (using toolbar). Get NPE.
>
> entire C.java:
> package test;
>
> import org.eclipse.swt.graphics.Point;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.custom.CLabel;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Scale;
>
> public class C extends Composite {
>
> private CLabel cLabel = null;
> private Scale scale = null;
>
> public C(Composite parent, int style) {
> super(parent, style);
> initialize();
> }
>
> private void initialize() {
> cLabel = new CLabel(this, SWT.NONE);
> cLabel.setBounds(new org.eclipse.swt.graphics.Rectangle(29,30,38,19));
> scale = new Scale(this, SWT.NONE);
> scale.setBounds(new org.eclipse.swt.graphics.Rectangle(75,106,170,42));
> scale.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
> public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
> System.out.println("widgetSelected()"); // TODO Auto-generated Event
> stub widgetSelected()
> }
> });
> cLabel.setText("CLabel " + scale.getSelection());
> setSize(new Point(300, 200));
> }
>
> }
>
>
>
> .log file contains:
> !SESSION 2005-08-01
> 13:50:19.816 -----------------------------------------------
> eclipse.buildId=I20050627-1435
> java.version=1.5.0_04
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments: -showlocation
> Command-line arguments: -os win32 -ws win32 -arch x86 -showlocation
>
> !ENTRY org.eclipse.ve.java.core 4 0 2005-08-01 13:55:10.201
> !MESSAGE Exception thrown.
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
>
> !ENTRY org.eclipse.ui 4 4 2005-08-01 13:55:10.217
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 2005-08-01 13:55:10.217
> !MESSAGE Failed to execute runnable (java.lang.NullPointerException)
> !STACK 0
> org.eclipse.swt.SWTException: Failed to execute runnable
> (java.lang.NullPointerException)
> at org.eclipse.swt.SWT.error(SWT.java:2942)
> at org.eclipse.swt.SWT.error(SWT.java:2865)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.setup Control(CompositeGraphicalEditPart.java:96)
> at
> org.eclipse.ve.internal.swt.CompositeGraphicalEditPart.creat eChild(CompositeGraphicalEditPart.java:84)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:733)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:232)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
> at
> org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:195)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:734)
> at
> org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:684)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.setRootModel(JavaVisualEditorPart.java:506)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart.initializeViewers(JavaVisualEditorPart.java:987)
> at
> org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$12.run(JavaVisualEditorPart.java:1977)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
> ... 18 more
>
>
>
>
> "Joe Winchester" <winchest@uk.ibm.com> wrote in message
> news:dcl5u7$lhg$1@news.eclipse.org...
>
>>Hi Joel,
>>
>>From your description I have tried to re-create the error you got but
>>don't have enough information for me to encounter it. Could you please
>>post an idiot proof description of how to get the error, e.g.
>>
>>1 - Open file foo.java
>>2 - select the lines 30 to 40. Cut and paste these so they are at line
>>20.
>>3 - Close the editor.
>>4 - Clean the project
>>5 - Re-open and see the VE crash.
>>
>>Also post the full source code of the file(s) in error. Don't include
>>that much narrative of why you are doing what you are doing with moving
>>the code around. To create a bug report all we need is a set of
>>re-creatable steps from a standing start where we can make it crash and
>>then see what's wrong. If it crashes it's a bug.
>>
>>By the way - there are two bits of parsing that go on with the VE when you
>>edit source code. One occurs each time you change the source and is a
>>snippit reload that tries to do intelligent delta on what has changed into
>>the model. If this can't do its job (which sometimes legitimately occurs
>>if the sippit analyzer realizes the changes made are too big to delta in)
>>then a full reload occurs. You can trigger this at any time by pushing
>>the pause button at the top and then unpausing. Each time the VE closes a
>>file and re-opens it we used to always re-parse from scratch the source,
>>however now we have a cache that holds information that helps performance.
>>This cache is what is cleared by doing a Project>Clean.
>>
>>Best regards,
>>
>>Joe Winchester
>
>
>
Previous Topic:how to implement it by using VE/ SWT?
Next Topic:Combining SWT and Swing Control
Goto Forum:
  


Current Time: Wed Sep 25 04:28:43 GMT 2024

Powered by FUDForum. Page generated in 0.49299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top