Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 19884 Details for
Bug 88128
Eclipse and JVM Shutdown Hooks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
shutdownHook.patch (text/plain), 7.46 KB, created by
Thomas Watson
on 2005-04-13 14:41:18 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2005-04-13 14:41:18 EDT
Size:
7.46 KB
patch
obsolete
>Index: core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java,v >retrieving revision 1.44 >diff -u -r1.44 BundleHost.java >--- core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java 23 Mar 2005 21:15:16 -0000 1.44 >+++ core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java 13 Apr 2005 18:38:26 -0000 >@@ -545,10 +545,8 @@ > return; > // First close the BundleLoader > BundleLoader loader = proxy.getBasicBundleLoader(); >- if (loader != null) { >- loader.clear(); >+ if (loader != null) > loader.close(); >- } > proxy.setStale(); > // if proxy is not null then make sure to unset user object > // associated with the proxy in the state >Index: core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java,v >retrieving revision 1.61 >diff -u -r1.61 BundleLoader.java >--- core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java 13 Apr 2005 18:03:37 -0000 1.61 >+++ core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java 13 Apr 2005 18:38:26 -0000 >@@ -33,6 +33,10 @@ > public class BundleLoader implements ClassLoaderDelegate { > public final static String DEFAULT_PACKAGE = "."; //$NON-NLS-1$ > public final static String JAVA_PACKAGE = "java."; //$NON-NLS-1$ >+ public final static byte FLAG_IMPORTSINIT = 0x01; >+ public final static byte FLAG_HASDYNAMICIMPORTS = 0x02; >+ public final static byte FLAG_HASDYNAMICEIMPORTALL = 0x04; >+ public final static byte FLAG_CLOSED = 0x08; > > /* the proxy */ > BundleLoaderProxy proxy; >@@ -44,13 +48,8 @@ > > /* cache of imported packages. Key is packagename, Value is PackageSource */ > KeyedHashSet importedSources; >- boolean importsInit = false; > /* cache of required package sources. Key is packagename, value is PackageSource */ > KeyedHashSet requiredSources; >- /* flag that indicates this bundle has dynamic imports */ >- boolean hasDynamicImports = false; >- /* If true, import all packages dynamically. */ >- boolean dynamicImportPackageAll; > /* If not null, list of package stems to import dynamically. */ > String[] dynamicImportPackageStems; > /* If not null, list of package names to import dynamically. */ >@@ -61,6 +60,8 @@ > BundleLoaderProxy[] requiredBundles; > /* List of indexes into the requiredBundles list of reexported bundles */ > int[] reexportTable; >+ /* loader flags */ >+ byte loaderFlags = 0; > > /** > * Returns the package name from the specified class name. >@@ -172,7 +173,7 @@ > } > > private synchronized void addImportedPackages(ExportPackageDescription[] packages) { >- if (importsInit) >+ if ((loaderFlags & FLAG_IMPORTSINIT) != 0) > return; > if (packages != null && packages.length > 0) { > if (importedSources == null) >@@ -183,7 +184,7 @@ > importedSources.add(source); > } > } >- importsInit = true; >+ loaderFlags |= FLAG_IMPORTSINIT; > } > > final PackageSource createExportPackageSource(ExportPackageDescription export) { >@@ -232,14 +233,11 @@ > * > */ > void close() { >- if (bundle == null) >+ if ((loaderFlags & FLAG_CLOSED) != 0) > return; >- importedSources = null; >- > if (classloader != null) > classloader.close(); >- classloader = null; >- bundle = null; /* This indicates the BundleLoader is destroyed */ >+ loaderFlags |= FLAG_CLOSED; /* This indicates the BundleLoader is destroyed */ > } > > /** >@@ -348,8 +346,6 @@ > } > } > >- if (isClosed()) >- throw new ClassNotFoundException(name); > String pkgName = getPackageName(name); > Class result = null; > // 3) search the imported packages >@@ -377,7 +373,7 @@ > } > > final boolean isClosed() { >- return bundle == null; >+ return (loaderFlags & FLAG_CLOSED) != 0; > } > > /** >@@ -405,8 +401,6 @@ > return result; > } > } >- if (isClosed()) >- return null; > > URL result = null; > // 3) search the imported packages >@@ -447,8 +441,6 @@ > */ > public Enumeration findResources(String name) throws IOException { > // do not delegate to parent because ClassLoader#getResources already did and it is final!! >- if (isClosed()) >- return null; > if ((name.length() > 1) && (name.charAt(0) == '/')) /* if name has a leading slash */ > name = name.substring(1); /* remove leading slash before search */ > String pkgName = getResourcePackageName(name); >@@ -503,8 +495,6 @@ > * @return the absolute path of the native library or null if not found > */ > public String findLibrary(final String name) { >- if (isClosed()) >- return null; > if (System.getSecurityManager() == null) > return findLocalLibrary(name); > return (String) AccessController.doPrivileged(new PrivilegedAction() { >@@ -595,11 +585,11 @@ > return true; > > /* quick shortcut check */ >- if (!hasDynamicImports) >+ if ((loaderFlags & FLAG_HASDYNAMICIMPORTS) == 0) > return false; > > /* "*" shortcut */ >- if (dynamicImportPackageAll) >+ if ((loaderFlags & FLAG_HASDYNAMICEIMPORTALL) != 0) > return true; > > /* match against specific names */ >@@ -673,7 +663,7 @@ > if (packages == null) > return; > >- hasDynamicImports = true; >+ loaderFlags |= FLAG_HASDYNAMICIMPORTS; > // make sure importedPackages is not null; > if (importedSources == null) { > importedSources = new KeyedHashSet(10, false); >@@ -708,7 +698,7 @@ > if (isDynamicallyImported(name)) > continue; > if (name.equals("*")) { /* shortcut *///$NON-NLS-1$ >- dynamicImportPackageAll = true; >+ loaderFlags |= FLAG_HASDYNAMICEIMPORTALL; > return; > } > >@@ -744,16 +734,6 @@ > addDynamicImportPackage((String[]) dynamicImports.toArray(new String[dynamicImports.size()])); > } > >- final void clear() { >- exportedPackages = null; >- requiredBundles = null; >- requiredSources = null; >- reexportTable = null; >- importedSources = null; >- dynamicImportPackages = null; >- dynamicImportPackageStems = null; >- } >- > final void attachFragment(BundleFragment fragment) throws BundleException { > if (classloader == null) > return; >@@ -779,7 +759,7 @@ > } > > private PackageSource findImportedSource(String pkgName) { >- if (!importsInit) >+ if ((loaderFlags & FLAG_IMPORTSINIT) == 0) > addImportedPackages(proxy.getBundleDescription().getResolvedImports()); > return importedSources == null ? null : (PackageSource) importedSources.getByKey(pkgName); > } >Index: defaultAdaptor/src/org/eclipse/osgi/framework/adaptor/core/AbstractFrameworkAdaptor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/adaptor/core/AbstractFrameworkAdaptor.java,v >retrieving revision 1.32 >diff -u -r1.32 AbstractFrameworkAdaptor.java >--- defaultAdaptor/src/org/eclipse/osgi/framework/adaptor/core/AbstractFrameworkAdaptor.java 8 Apr 2005 18:50:55 -0000 1.32 >+++ defaultAdaptor/src/org/eclipse/osgi/framework/adaptor/core/AbstractFrameworkAdaptor.java 13 Apr 2005 18:38:27 -0000 >@@ -202,6 +202,8 @@ > protected abstract void persistNextBundleID(long value) throws IOException; > > public FrameworkLog getFrameworkLog() { >+ if (frameworkLog == null) >+ frameworkLog = createFrameworkLog(); > return frameworkLog; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 88128
:
19872
| 19884