Community
Participate
Working Groups
Build ID: 3.3.1.1 Steps To Reproduce: Trying to a debugee Eclipse under the PDE, I experienced the following Exception: Needless to say the launch failed, and a dead but irremovable '[Eclipse Application]' was left in the Debug View. java.lang.NullPointerException at org.eclipse.pde.internal.ui.launcher.LauncherUtils.getTimeStamp(LauncherUtils.java:242) at org.eclipse.pde.internal.ui.launcher.LauncherUtils.handleUseDefault(LauncherUtils.java:270) at org.eclipse.pde.internal.ui.launcher.LauncherUtils.validateProjectDependencies(LauncherUtils.java:172) at org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration.validateProjectDependencies(AbstractPDELaunchConfiguration.java:395) at org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration.preLaunchCheck(AbstractPDELaunchConfiguration.java:301) at org.eclipse.pde.ui.launcher.EclipseApplicationLaunchConfiguration.preLaunchCheck(EclipseApplicationLaunchConfiguration.java:237) at org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration.launch(AbstractPDELaunchConfiguration.java:67) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899) at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) More information:
Are you able to reproduce this? The code in question comes from calls to java.io.File. We seem to be getting null when we call File.listFiles(). From the javadoc, it appears this is the case when the File is not a directory (we call isDirectory() prior) or there is an I/O Exception. I am wondering what is failing in the call...
I can't readily reproduce it, but java.io.File documentation (http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#listFiles()) says: "Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs." And it a quick google seems to show a Java bug filed for the possibility isDirectory() && listFiles==null (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4803836) It would seem to be the case that if the the directory disappeared (for whatever reason) between the two method calls, null would be returned by listFiles instead of an Exception being thrown or an empty list returned, which is counterintuitive...
I can see this possibly happening with the classfile output directory. To prevent this (and since it is not readily reproducible), we should put the null check. Adding bugday tag as this should be a simple fix.
Created attachment 88389 [details] Patch attached The attached patch adds null checking. I hope this is enough.
Thank you for the patch, Jakub! I will try to review it today.
Beautiful and elegant :) Thanks a lot of the patch. Sounds like a pretty nasty side effect that hopefully no one else will have to deal with now. If you interested on being added to the PDE wall of over achievers (http://www.eclipse.org/pde/pde-ui/committers/committers.php), please send me a photo with a green leafy back ground and we will make sure it gets up.