Project: Eclipse_Platform_UI
Bug 377798 ResourceHandler#getLastApplictionModification() doesn't work for platform:/plugin/org.eclipse.platform/LegacyIDE.e4xmi
Reported: 2012-04-26 13:00:24 | Status: verified fixed

ResourceHandler's getLastApplicationModification() masks an NPE and doesn't properly fetch the last modification time of the Platform SDK's e4xmi file (platform:/plugin/org.eclipse.platform/LegacyIDE.e4xmi). The method uses Bundle#getResource() to resolve the .e4xmi file. But getResource() uses the bundle's classpath (which in org.eclipse.platform is the embedded platform.jar), and so the call returns null. There is no guard against this possibility, and so the NPE is eaten by a catch statement and the file appears to have no last-modification time. getLastApplicationModification() should instead first try to resolve the e4xmi as a bundle entry (not using the classpath), and then resolve using the classpath if not found. And it should guard against the file not being resolved to prevent spurious NPEs.

Files changed in fix:
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java