[359892] ContainerImpl#getFile(String URI) will not always find a file (even if the container has the file)
diff --git a/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF index 407bc19..c72de33 100644 --- a/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.jst.j2ee.core; singleton:=true -Bundle-Version: 1.2.5.qualifier +Bundle-Version: 1.2.6.qualifier Bundle-Activator: org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java index cc41fbc..6f61e94 100644 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java +++ b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java
@@ -202,13 +202,19 @@ getFiles(); } - IPath URIPath = new Path(URI); + // Some load strategies load the files as relative, and some as absolute paths, so... + // First try with the original URI + File file = (File) getFileIndex().get(URI); - if (URIPath.segmentCount() > 1) - URIPath = URIPath.makeAbsolute(); - - File file = (File) getFileIndex().get(URIPath.toString()); - + if (file == null){ + // If the file was not found, try using absolute path + IPath URIPath = new Path(URI); + if (URIPath.segmentCount() > 1){ + URIPath = URIPath.makeAbsolute(); + file = (File) getFileIndex().get(URIPath.toString()); + } + } + if (file == null) { throw new java.io.FileNotFoundException(URI); }