Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359049

Summary: NullPointerException in CSSDocumentRegionEdgeMatcher while typing in CSS file
Product: [WebTools] WTP Source Editing Reporter: Victor Homyakov <vkhomyackov>
Component: wst.cssAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: major    
Priority: P3    
Version: 3.3.1   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Victor Homyakov CLA 2011-09-27 08:41:44 EDT
Eclipse shows popup "Problem Occurred: NullPointerException" when I'm typing new CSS rule. Example of text causing exception when typed or pasted into CSS file:
th[]{}

Details from Error Log:
Message: Unhandled event loop exception
Exception Stack Trace:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4282)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.NullPointerException
	at org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher.match(CSSDocumentRegionEdgeMatcher.java:68)
	at org.eclipse.jface.text.source.MatchingCharacterPainter.paint(MatchingCharacterPainter.java:220)
	at org.eclipse.jface.text.PaintManager.paint(PaintManager.java:298)
	at org.eclipse.jface.text.PaintManager.access$1(PaintManager.java:296)
	at org.eclipse.jface.text.PaintManager$1.run(PaintManager.java:353)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 22 more

Eclipse: Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 1
Build id: 20110916-0149
Comment 1 Nick Sandonato CLA 2011-09-27 11:10:30 EDT
Problem was the empty attribute selector was not being tokenized correctly. Fixing the tokenizer prevents this error.