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

Bug 362814

Summary: junit NPE with org.eclipse.debug.core.capture_output=false
Product: z_Archived Reporter: Volker Stolz <stolz+bugzilla>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Volker Stolz CLA 2011-11-03 11:58:51 EDT
Build Identifier: unknown

If a JUnit launch contains the line
  <booleanAttribute key="org.eclipse.debug.core.capture_output" value="false"/>
junit will fail rather ungracefully with:

java.lang.NullPointerException
	at org.eclipse.buckminster.core.commands.Launch.internalRun(Launch.java:211)
	at org.eclipse.buckminster.junit.JUnitCommand.internalRun(JUnitCommand.java:99)
	at org.eclipse.buckminster.core.commands.WorkspaceCommand.run(WorkspaceCommand.java:91)
	at org.eclipse.buckminster.cmdline.AbstractCommand.basicRun(AbstractCommand.java:200)
	at org.eclipse.buckminster.cmdline.Headless.run(Headless.java:317)
	at org.eclipse.buckminster.cmdline.Headless.run(Headless.java:136)
	at org.eclipse.buckminster.cmdline.Headless.start(Headless.java:156)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

An easy workaround is to remove this option from the launch, but arguably Buckminster could either handle this case, or fail more gracefully. (Old Java saying: every function will return null eventually ;)


Reproducible: Always

Steps to Reproduce:
1. Create a JUnit launch and switch off Console Allocation in the "Common" tab
2. ./buckminster --displaystacktrace ... junit -l ...
3. Kaboom