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

Bug 337917

Summary: Wrong code type in Source Code Information Type leads to crash
Product: z_Archived Reporter: Joerg Reichert <joerg83reichert>
Component: RemusAssignee: Tom Seidel <tom.seidel>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
zipped logs none

Description Joerg Reichert CLA 2011-02-22 17:43:02 EST
Build Identifier: RCP-TRUNK-114, Date: 2011-02-21_02_11

I created a new Source Code Information Type item, selected Java as Type but copied some Scala Code in it (evil, I know ;, but there is no Scala support currently)). The point is, this causes RIM to crash and when I try to restart it crashes again. I have to select a new workspace. There seems to be no handling for non formattable code.

Reproducible: Always
Comment 1 Tom Seidel CLA 2011-02-22 17:54:50 EST
Could you provide the source code you've pasted into the editor, for reproducing?
Comment 2 Joerg Reichert CLA 2011-02-22 17:56:50 EST
sure:


val controlTypeID = new scala.util.matching.Regex(""".*controlTypeID="(.[^"]*)".*""")
    val lines = scala.io.Source.fromFile("all.xml").getLines().toList
    val values = scala.collection.mutable.Set.empty[String]
    lines foreach(l => for(controlTypeID(s) <- controlTypeID findAllIn l) values.add(s))
    val nameCompare = new Ordering[String] {
      def compare(s1 : String, s2 : String) = s1.compareToIgnoreCase(s2)
    }
    val sortedValues = scala.collection.immutable.TreeSet.empty[String](nameCompare) ++ values
    sortedValues map(_.replace("com.balsamiq.mockups::"), "") foreach(v => println(v))
Comment 3 Tom Seidel CLA 2011-02-25 11:04:04 EST
This error is not reproducable for me, neither on Snow Leopard nor on any other system. Pasting source code from another language shouldn't be the problem, the only thing is that the highlighting will not work properly. Is this error reproducable?
Comment 4 Joerg Reichert CLA 2011-02-25 11:11:11 EST
just reproduced it right now, now under Mac (the previous one was under Windows Vista). I Create a new Source Information Item, copied the code in the edit pane and close it. After a short moment RIM crashs. Restarting and trying to open the information file causes a NPE:

!ENTRY org.eclipse.jface 4 2 2011-02-25 17:08:33.314
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.remus.ui.editors.InformationEditorInput.setLabels(InformationEditorInput.java:53)
	at org.eclipse.remus.ui.editors.InformationEditorInput.<init>(InformationEditorInput.java:47)
	at org.eclipse.remus.ui.editors.InformationEditorInput.<init>(InformationEditorInput.java:35)
	at org.eclipse.remus.ui.collapsiblebuttons.NavigationSection$2.handleOpen(NavigationSection.java:109)
	at org.eclipse.remus.ui.viewer.NavigationViewer$3.open(NavigationViewer.java:149)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.remus.application.Application.start(Application.java:133)
	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:369)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 5 Joerg Reichert CLA 2011-02-25 11:13:45 EST
ah forgotten to mention: I can reopen the information file, I can see the (unformatted) code, but when I go to the edit tab, RIm crashes.
Comment 6 Tom Seidel CLA 2011-02-25 11:31:30 EST
Does this crash appear general on SourceCode items or only at this special one? A whole application crash is really strange it indicates more a JVM Crash, a normal Exception wouldn't cause an application crash.
Comment 7 Joerg Reichert CLA 2011-02-25 16:20:01 EST
Created attachment 189856 [details]
zipped logs
Comment 8 Joerg Reichert CLA 2011-02-25 16:20:42 EST
I tried it under Mac with XML code and RIM went down after reopen and clicking around (i.e. the click on edit after reopen seems not the cause). Maybe it is really sommething different. Under Windows I could not reproduce the bug with other source content. I append the two logs (Windows from 02/22/11 and Mac from today).
Comment 9 Tom Seidel CLA 2012-12-13 10:29:08 EST
We will switch to a pure JavaScript Syntax Highlighter in the future. They are more powerful, lightweight and don't rely so heavily on the underlying OS.