diff options
author | Thomas Watson | 2019-09-13 13:50:36 +0000 |
---|---|---|
committer | Thomas Watson | 2019-09-13 13:50:36 +0000 |
commit | fdae0cda5fe009d577238ae8adb1c8cc8a6923dc (patch) | |
tree | 7448445770b47b2aa990805f7b01e832f3ffbe62 | |
parent | 88af5b2416b3acc3730299b7af45bac958ebaf25 (diff) | |
download | rt.equinox.framework-fdae0cda5fe009d577238ae8adb1c8cc8a6923dc.tar.gz rt.equinox.framework-fdae0cda5fe009d577238ae8adb1c8cc8a6923dc.tar.xz rt.equinox.framework-fdae0cda5fe009d577238ae8adb1c8cc8a6923dc.zip |
Bug 550605 - StackOverflowError in CDSBundleFileEntryI20190915-1800I20190914-1800I20190913-1800
The method CDSBundleEntry.getEntry() ended up calling
CDSBundleFile.getEntry(path) which ends up returning another
CDSBundleEntry object. The intention was to get the wrapped entry from
the next BundleFile in the chain. The result of getting another
CDSBundleEntry is that we endless recurse when calling methods like
CDSBundleEntry.getInputStream()
Change-Id: I0c684eb63987797cd9e092a405274ccb1d4eae71
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java | 14 | ||||
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java index 6293fb0e6..746af6cb1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java @@ -48,8 +48,8 @@ public class CDSBundleEntry extends BundleEntry { this.bundleFile = bundleFile; } - private BundleEntry getEntry() { - BundleEntry entry = bundleFile.getEntry(path); + private BundleEntry getWrappedEntry() { + BundleEntry entry = bundleFile.getWrappedEntry(path); if (entry == null) { throw new IllegalStateException("Could not find original entry for the class: " + path); //$NON-NLS-1$ } @@ -66,7 +66,7 @@ public class CDSBundleEntry extends BundleEntry { */ @Override public URL getFileURL() { - return getEntry().getFileURL(); + return getWrappedEntry().getFileURL(); } /* @@ -79,7 +79,7 @@ public class CDSBundleEntry extends BundleEntry { public InputStream getInputStream() throws IOException { // someone is trying to get the real bytes of the class file!! // just return the entry from the wrapped file instead of the magic cookie - return getEntry().getInputStream(); + return getWrappedEntry().getInputStream(); } /* @@ -104,7 +104,7 @@ public class CDSBundleEntry extends BundleEntry { */ @Override public URL getLocalURL() { - return getEntry().getLocalURL(); + return getWrappedEntry().getLocalURL(); } @Override @@ -114,11 +114,11 @@ public class CDSBundleEntry extends BundleEntry { @Override public long getSize() { - return getEntry().getSize(); + return getWrappedEntry().getSize(); } @Override public long getTime() { - return getEntry().getTime(); + return getWrappedEntry().getTime(); } } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java index ff7256a88..29a8dd796 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java @@ -83,6 +83,10 @@ public class CDSBundleFile extends BundleFileWrapper { return be; } + BundleEntry getWrappedEntry(String path) { + return super.getEntry(path); + } + /** * Returns the file url to the content of the actual bundle file * @return the file url to the content of the actual bundle file |