From 46bbe510ebe38841c223851557ff6fdadf76a719 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 14 Aug 2012 10:12:17 -0500 Subject: Remove remaining uses of FrameworkProperties --- .../core/runtime/adaptor/EclipseStarter.java | 6 +- .../internal/adaptor/DefaultStartupMonitor.java | 12 +- .../internal/adaptor/EclipseAppLauncher.java | 8 +- .../framework/internal/core/ConsoleManager.java | 16 +- .../internal/framework/EquinoxConfiguration.java | 16 ++ .../osgi/internal/hooks/EclipseLazyStarter.java | 8 +- .../osgi/internal/loader/ModuleClassLoader.java | 29 +-- .../osgi/internal/log/EquinoxLogWriter.java | 8 +- .../internal/url/URLStreamHandlerFactoryImpl.java | 3 +- .../src/org/eclipse/osgi/storage/Storage.java | 15 +- .../osgi/storage/bundlefile/MRUBundleFileList.java | 18 +- .../osgi/storage/url/reference/Handler.java | 14 +- .../url/reference/ReferenceURLConnection.java | 24 +-- .../internal/core/FrameworkProperties.java | 234 --------------------- .../internal/reliablefile/ReliableFile.java | 7 +- .../eclipse/osgi/framework/util/SecureAction.java | 39 +--- .../osgi/internal/debug/EclipseDebugTrace.java | 4 +- .../osgi/internal/debug/FrameworkDebugOptions.java | 4 + .../supplement/src/org/eclipse/osgi/util/NLS.java | 6 +- 19 files changed, 108 insertions(+), 363 deletions(-) delete mode 100644 bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/FrameworkProperties.java (limited to 'bundles/org.eclipse.osgi') diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java index 0b8e408b3..a89a7e77e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java @@ -297,7 +297,7 @@ public class EclipseStarter { registerFrameworkShutdownHandlers(); publishSplashScreen(endSplashHandler); - consoleMgr = ConsoleManager.startConsole(context); + consoleMgr = ConsoleManager.startConsole(context, equinoxConfig); Bundle[] startBundles = loadBasicBundles(); @@ -360,7 +360,7 @@ public class EclipseStarter { if (appLauncher == null) { boolean launchDefault = Boolean.valueOf(getProperty(PROP_APPLICATION_LAUNCHDEFAULT, "true")).booleanValue(); //$NON-NLS-1$ // create the ApplicationLauncher and register it as a service - appLauncher = new EclipseAppLauncher(context, Boolean.valueOf(getProperty(PROP_ALLOW_APPRELAUNCH)).booleanValue(), launchDefault, log); + appLauncher = new EclipseAppLauncher(context, Boolean.valueOf(getProperty(PROP_ALLOW_APPRELAUNCH)).booleanValue(), launchDefault, log, equinoxConfig); appLauncherRegistration = context.registerService(ApplicationLauncher.class.getName(), appLauncher, null); // must start the launcher AFTER service restration because this method // blocks and runs the application on the current thread. This method @@ -458,7 +458,7 @@ public class EclipseStarter { try { Dictionary monitorProps = new Hashtable(); monitorProps.put(Constants.SERVICE_RANKING, new Integer(Integer.MIN_VALUE)); - defaultMonitorRegistration = context.registerService(StartupMonitor.class.getName(), new DefaultStartupMonitor(endSplashHandler), monitorProps); + defaultMonitorRegistration = context.registerService(StartupMonitor.class.getName(), new DefaultStartupMonitor(endSplashHandler, equinoxConfig), monitorProps); } catch (IllegalStateException e) { //splash handler did not provide the necessary methods, ignore it } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java index 63abe9fe3..95e58a2e7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java @@ -12,13 +12,14 @@ package org.eclipse.core.runtime.internal.adaptor; import java.lang.reflect.Method; import org.eclipse.core.runtime.adaptor.EclipseStarter; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.osgi.service.runnable.StartupMonitor; public class DefaultStartupMonitor implements StartupMonitor { - private Method updateMethod = null; - private Runnable splashHandler = null; + private final Method updateMethod; + private final Runnable splashHandler; + private final EquinoxConfiguration equinoxConfig; /** * Create a new startup monitor using the given splash handler. The splash handle must @@ -27,8 +28,9 @@ public class DefaultStartupMonitor implements StartupMonitor { * @param splashHandler * @throws IllegalStateException */ - public DefaultStartupMonitor(Runnable splashHandler) throws IllegalStateException { + public DefaultStartupMonitor(Runnable splashHandler, EquinoxConfiguration equinoxConfig) throws IllegalStateException { this.splashHandler = splashHandler; + this.equinoxConfig = equinoxConfig; try { updateMethod = splashHandler.getClass().getMethod("updateSplash", (Class[]) null); //$NON-NLS-1$ @@ -57,7 +59,7 @@ public class DefaultStartupMonitor implements StartupMonitor { public void applicationRunning() { if (EclipseStarter.debug) { - String timeString = FrameworkProperties.getProperty("eclipse.startTime"); //$NON-NLS-1$ + String timeString = equinoxConfig.getConfiguration("eclipse.startTime"); //$NON-NLS-1$ long time = timeString == null ? 0L : Long.parseLong(timeString); System.out.println("Application Started: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java index 7bd75b156..d4dc9072f 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java @@ -14,9 +14,9 @@ package org.eclipse.core.runtime.internal.adaptor; import java.lang.reflect.Method; import java.util.Map; import org.eclipse.core.runtime.adaptor.EclipseStarter; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.framework.log.FrameworkLogEntry; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.osgi.internal.framework.EquinoxContainer; import org.eclipse.osgi.internal.location.EclipseAdaptorMsg; import org.eclipse.osgi.service.runnable.*; @@ -31,12 +31,14 @@ public class EclipseAppLauncher implements ApplicationLauncher { private boolean relaunch = false; private boolean failOnNoDefault = false; private FrameworkLog log; + private final EquinoxConfiguration equinoxConfig; - public EclipseAppLauncher(BundleContext context, boolean relaunch, boolean failOnNoDefault, FrameworkLog log) { + public EclipseAppLauncher(BundleContext context, boolean relaunch, boolean failOnNoDefault, FrameworkLog log, EquinoxConfiguration equinoxConfig) { this.context = context; this.relaunch = relaunch; this.failOnNoDefault = failOnNoDefault; this.log = log; + this.equinoxConfig = equinoxConfig; findRunnableService(); } @@ -98,7 +100,7 @@ public class EclipseAppLauncher implements ApplicationLauncher { // this must happen after we have acquired an application (by acquiring waitForAppLock above). runningLock.acquire(); if (EclipseStarter.debug) { - String timeString = FrameworkProperties.getProperty("eclipse.startTime"); //$NON-NLS-1$ + String timeString = equinoxConfig.getConfiguration("eclipse.startTime"); //$NON-NLS-1$ long time = timeString == null ? 0L : Long.parseLong(timeString); System.out.println("Starting application: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/internal/core/ConsoleManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/internal/core/ConsoleManager.java index 17d72d2d2..f832f7a72 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/internal/core/ConsoleManager.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/internal/core/ConsoleManager.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.osgi.framework.internal.core; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.osgi.framework.*; import org.osgi.service.packageadmin.PackageAdmin; @@ -20,35 +21,38 @@ public class ConsoleManager { public static final String PROP_CONSOLE_ENABLED = "osgi.console.enable.builtin"; //$NON-NLS-1$ private final BundleContext context; + private final EquinoxConfiguration equinoxConfig; private final String consoleBundle; private final String consolePort; - public ConsoleManager(BundleContext context, String consolePropValue) { + public ConsoleManager(BundleContext context, EquinoxConfiguration equinoxConfig) { + this.equinoxConfig = equinoxConfig; String port = null; + String consolePropValue = equinoxConfig.getConfiguration(PROP_CONSOLE); if (consolePropValue != null) { int index = consolePropValue.lastIndexOf(":"); //$NON-NLS-1$ port = consolePropValue.substring(index + 1); } this.consolePort = port != null ? port.trim() : port; - String enabled = FrameworkProperties.getProperty(PROP_CONSOLE_ENABLED, CONSOLE_BUNDLE); + String enabled = equinoxConfig.getConfiguration(PROP_CONSOLE_ENABLED, CONSOLE_BUNDLE); this.context = context; if (!"true".equals(enabled) || "none".equals(consolePort)) { //$NON-NLS-1$ //$NON-NLS-2$ this.consoleBundle = "false".equals(enabled) ? CONSOLE_BUNDLE : enabled; //$NON-NLS-1$ if (consolePort == null || consolePort.length() > 0) { // no -console was specified or it has specified none or a port for telnet; // need to make sure the gogo shell does not create an interactive console on standard in/out - FrameworkProperties.setProperty("gosh.args", "--nointeractive"); //$NON-NLS-1$//$NON-NLS-2$ + equinoxConfig.setProperty("gosh.args", "--nointeractive"); //$NON-NLS-1$//$NON-NLS-2$ } else { // Need to make sure we don't shutdown the framework if no console is around (bug 362412) - FrameworkProperties.setProperty("gosh.args", "--noshutdown"); //$NON-NLS-1$//$NON-NLS-2$ + equinoxConfig.setProperty("gosh.args", "--noshutdown"); //$NON-NLS-1$//$NON-NLS-2$ } return; } this.consoleBundle = "unknown"; //$NON-NLS-1$ } - public static ConsoleManager startConsole(BundleContext context) { - ConsoleManager consoleManager = new ConsoleManager(context, FrameworkProperties.getProperty(PROP_CONSOLE)); + public static ConsoleManager startConsole(BundleContext context, EquinoxConfiguration equinoxConfig) { + ConsoleManager consoleManager = new ConsoleManager(context, equinoxConfig); return consoleManager; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java index e41c9e066..f76b8fb09 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java @@ -91,6 +91,11 @@ public class EquinoxConfiguration implements EnvironmentInfo { public static final int BSN_VERSION_MULTIPLE = 2; public static final int BSN_VERSION_MANAGED = 3; + public final boolean throwErrorOnFailedStart; + + public final boolean CLASS_CERTIFICATE; + public final boolean PARALLEL_CAPABLE; + // JVM os.arch property name public static final String PROP_JVM_OS_ARCH = "os.arch"; //$NON-NLS-1$ // JVM os.name property name @@ -128,6 +133,7 @@ public class EquinoxConfiguration implements EnvironmentInfo { public static final String PROP_CONTEXT_BOOTDELEGATION = "osgi.context.bootdelegation"; //$NON-NLS-1$ public static final String PROP_COMPATIBILITY_BOOTDELEGATION = "osgi.compatibility.bootdelegation"; //$NON-NLS-1$ + public static final String PROP_COMPATIBILITY_ERROR_FAILED_START = "osgi.compatibility.errorOnFailedStart"; //$NON-NLS-1$ public static final String PROP_OSGI_OS = "osgi.os"; //$NON-NLS-1$ public static final String PROP_OSGI_WS = "osgi.ws"; //$NON-NLS-1$ @@ -155,6 +161,11 @@ public class EquinoxConfiguration implements EnvironmentInfo { public static final String PROP_BUNDLE_SETTCCL = "eclipse.bundle.setTCCL"; //$NON-NLS-1$ public static final String PROP_EQUINOX_SECURITY = "eclipse.security"; //$NON-NLS-1$ + public static final String PROP_FILE_LIMIT = "osgi.bundlefile.limit"; //$NON-NLS-1$ + + public final static String PROP_CLASS_CERTIFICATE_SUPPORT = "osgi.support.class.certificate"; //$NON-NLS-1$ + public final static String PROP_CLASS_LOADER_TYPE = "osgi.classloader.type"; //$NON-NLS-1$ + public final static String CLASS_LOADER_TYPE_PARALLEL = "parallel"; //$NON-NLS-1$ EquinoxConfiguration(Map initialConfig, HookRegistry hookRegistry) { this.hookRegistry = hookRegistry; @@ -306,6 +317,11 @@ public class EquinoxConfiguration implements EnvironmentInfo { } BUNDLE_SET_TCCL = "true".equals(getConfiguration("eclipse.bundle.setTCCL", "true")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + throwErrorOnFailedStart = "true".equals(getConfiguration(PROP_COMPATIBILITY_ERROR_FAILED_START, "true")); //$NON-NLS-1$//$NON-NLS-2$ + + CLASS_CERTIFICATE = Boolean.valueOf(getConfiguration(PROP_CLASS_CERTIFICATE_SUPPORT, "true")).booleanValue(); //$NON-NLS-1$ + PARALLEL_CAPABLE = CLASS_LOADER_TYPE_PARALLEL.equals(getConfiguration(PROP_CLASS_LOADER_TYPE, CLASS_LOADER_TYPE_PARALLEL)); } public Map asMap() { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/EclipseLazyStarter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/EclipseLazyStarter.java index 34d85ed7a..9458ef49b 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/EclipseLazyStarter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/EclipseLazyStarter.java @@ -17,7 +17,6 @@ import org.eclipse.osgi.container.Module.StartOptions; import org.eclipse.osgi.container.Module.State; import org.eclipse.osgi.container.namespaces.EquinoxModuleDataNamespace; import org.eclipse.osgi.framework.adaptor.StatusException; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; import org.eclipse.osgi.framework.log.FrameworkLogEntry; import org.eclipse.osgi.internal.framework.EquinoxContainer; import org.eclipse.osgi.internal.hookregistry.ClassLoaderHook; @@ -27,7 +26,6 @@ import org.eclipse.osgi.util.NLS; import org.osgi.framework.*; public class EclipseLazyStarter extends ClassLoaderHook { - private static final boolean throwErrorOnFailedStart = "true".equals(FrameworkProperties.getProperty("osgi.compatibility.errorOnFailedStart", "true")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ private static final EnumSet alreadyActive = EnumSet.of(State.ACTIVE, State.STOPPING, State.UNINSTALLED); // holds the current activation trigger class and the ClasspathManagers that need to be activated private final ThreadLocal> activationStack = new ThreadLocal>(); @@ -91,7 +89,7 @@ public class EclipseLazyStarter extends ClassLoaderHook { return; for (int i = managers.length - 1; i >= 0; i--) { if (errors.get(managers[i]) != null) { - if (throwErrorOnFailedStart) + if (container.getConfiguration().throwErrorOnFailedStart) throw errors.get(managers[i]); continue; } @@ -119,7 +117,7 @@ public class EclipseLazyStarter extends ClassLoaderHook { String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_ACTIVATION, bundle.getSymbolicName(), Long.toString(bundle.getBundleId())); TerminatingClassNotFoundException error = new TerminatingClassNotFoundException(message, e); errors.put(managers[i], error); - if (throwErrorOnFailedStart) { + if (container.getConfiguration().throwErrorOnFailedStart) { container.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, message, e, null); throw error; } @@ -133,7 +131,7 @@ public class EclipseLazyStarter extends ClassLoaderHook { // Don't activate non-starting bundles if (State.RESOLVED.equals(module.getState())) { // handle the resolved case where a previous error occurred - if (throwErrorOnFailedStart) { + if (container.getConfiguration().throwErrorOnFailedStart) { TerminatingClassNotFoundException error = errors.get(manager); if (error != null) throw error; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java index af73ccc71..92c754af7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java @@ -18,7 +18,6 @@ import java.net.URL; import java.security.*; import java.security.cert.Certificate; import java.util.*; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.osgi.internal.loader.classpath.ClasspathEntry; import org.eclipse.osgi.internal.loader.classpath.ClasspathManager; @@ -36,34 +35,26 @@ public class ModuleClassLoader extends ClassLoader implements BundleReference { * A PermissionCollection for AllPermissions; shared across all ProtectionDomains when security is disabled */ protected static final PermissionCollection ALLPERMISSIONS; - private final static String CLASS_CERTIFICATE_SUPPORT = "osgi.support.class.certificate"; //$NON-NLS-1$ - private final static String CLASS_LOADER_TYPE = "osgi.classloader.type"; //$NON-NLS-1$ - private final static String CLASS_LOADER_TYPE_PARALLEL = "parallel"; //$NON-NLS-1$ - private static final boolean CLASS_CERTIFICATE; - private static final boolean PARALLEL_CAPABLE; + private static final boolean REGISTERED_AS_PARALLEL; @SuppressWarnings("unchecked") private static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST); static { - CLASS_CERTIFICATE = Boolean.valueOf(FrameworkProperties.getProperty(CLASS_CERTIFICATE_SUPPORT, "true")).booleanValue(); //$NON-NLS-1$ AllPermission allPerm = new AllPermission(); ALLPERMISSIONS = allPerm.newPermissionCollection(); if (ALLPERMISSIONS != null) ALLPERMISSIONS.add(allPerm); - boolean typeParallel = CLASS_LOADER_TYPE_PARALLEL.equals(FrameworkProperties.getProperty(CLASS_LOADER_TYPE, CLASS_LOADER_TYPE_PARALLEL)); - boolean parallelCapable = false; + boolean registeredAsParallel; try { - if (typeParallel) { - Method parallelCapableMetod = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable", (Class[]) null); //$NON-NLS-1$ - parallelCapableMetod.setAccessible(true); - parallelCapable = ((Boolean) parallelCapableMetod.invoke(null, (Object[]) null)).booleanValue(); - } + Method parallelCapableMetod = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable", (Class[]) null); //$NON-NLS-1$ + parallelCapableMetod.setAccessible(true); + registeredAsParallel = ((Boolean) parallelCapableMetod.invoke(null, (Object[]) null)).booleanValue(); } catch (Throwable e) { // must do everything to avoid failing in clinit - parallelCapable = false; + registeredAsParallel = false; } - PARALLEL_CAPABLE = parallelCapable; + REGISTERED_AS_PARALLEL = registeredAsParallel; } private final EquinoxConfiguration configuration; @@ -223,7 +214,7 @@ public class ModuleClassLoader extends ClassLoader implements BundleReference { * @return a ProtectionDomain which uses specified BundleFile and the permissions of the baseDomain */ @SuppressWarnings("deprecation") - public static ProtectionDomain createProtectionDomain(BundleFile bundlefile, ProtectionDomain baseDomain) { + public ProtectionDomain createProtectionDomain(BundleFile bundlefile, ProtectionDomain baseDomain) { // create a protection domain which knows about the codesource for this classpath entry (bug 89904) try { // use the permissions supplied by the domain passed in from the framework @@ -242,7 +233,7 @@ public class ModuleClassLoader extends ClassLoader implements BundleReference { wrapper = wrapper.getNext(); signedContent = wrapper == null ? null : (SignedContent) wrapper.getWrapped(); } - if (CLASS_CERTIFICATE && signedContent != null && signedContent.isSigned()) { + if (configuration.CLASS_CERTIFICATE && signedContent != null && signedContent.isSigned()) { SignerInfo[] signers = signedContent.getSignerInfos(); if (signers.length > 0) certs = signers[0].getCertificateChain(); @@ -263,7 +254,7 @@ public class ModuleClassLoader extends ClassLoader implements BundleReference { } public boolean isParallelCapable() { - return PARALLEL_CAPABLE; + return REGISTERED_AS_PARALLEL || configuration.PARALLEL_CAPABLE; } public List findEntries(String path, String filePattern, int options) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java index d30f3db1f..f75ec6544 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java @@ -628,7 +628,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { * Reads the PROP_LOG_SIZE_MAX and PROP_LOG_FILE_MAX properties. */ private void readLogProperties() { - String newMaxLogSize = secureAction.getProperty(PROP_LOG_SIZE_MAX); + String newMaxLogSize = environmentInfo.getConfiguration(PROP_LOG_SIZE_MAX); if (newMaxLogSize != null) { maxLogSize = Integer.parseInt(newMaxLogSize); if (maxLogSize != 0 && maxLogSize < LOG_SIZE_MIN) { @@ -638,7 +638,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { } } - String newMaxLogFiles = secureAction.getProperty(PROP_LOG_FILE_MAX); + String newMaxLogFiles = environmentInfo.getConfiguration(PROP_LOG_FILE_MAX); if (newMaxLogFiles != null) { maxLogFiles = Integer.parseInt(newMaxLogFiles); if (maxLogFiles < 1) { @@ -647,7 +647,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { } } - String newLogLevel = secureAction.getProperty(PROP_LOG_LEVEL); + String newLogLevel = environmentInfo.getConfiguration(PROP_LOG_LEVEL); if (newLogLevel != null) { if (newLogLevel.equals("ERROR")) //$NON-NLS-1$ logLevel = FrameworkLogEntry.ERROR; @@ -659,7 +659,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { logLevel = FrameworkLogEntry.OK; // OK (0) means log everything } - includeCommandLine = "true".equals(secureAction.getProperty(PROP_LOG_INCLUDE_COMMAND_LINE, "true")); //$NON-NLS-1$//$NON-NLS-2$ + includeCommandLine = "true".equals(environmentInfo.getConfiguration(PROP_LOG_INCLUDE_COMMAND_LINE, "true")); //$NON-NLS-1$//$NON-NLS-2$ } /** diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java index 3ea4552fe..9edcfdba3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java @@ -19,6 +19,7 @@ import org.eclipse.osgi.framework.internal.core.Msg; import org.eclipse.osgi.framework.log.FrameworkLogEntry; import org.eclipse.osgi.framework.util.SecureAction; import org.eclipse.osgi.internal.framework.EquinoxContainer; +import org.eclipse.osgi.internal.location.EquinoxLocations; import org.eclipse.osgi.storage.url.BundleResourceHandler; import org.eclipse.osgi.util.NLS; import org.osgi.framework.BundleContext; @@ -140,7 +141,7 @@ public class URLStreamHandlerFactoryImpl extends MultiplexingFactory implements } else if (BundleResourceHandler.OSGI_RESOURCE_URL_PROTOCOL.equals(protocol)) { return new org.eclipse.osgi.storage.url.bundleresource.Handler(container.getStorage().getModuleContainer(), null); } else if (PROTOCOL_REFERENCE.equals(protocol)) { - return new org.eclipse.osgi.storage.url.reference.Handler(); + return new org.eclipse.osgi.storage.url.reference.Handler(container.getConfiguration().getConfiguration(EquinoxLocations.PROP_INSTALL_AREA)); } return null; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java index 48054b3c0..7f4248752 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java @@ -70,10 +70,11 @@ public class Storage { private final Object saveMonitor = new Object(); private long lastSavedTimestamp = -1; private final LockSet idLocks = new LockSet(false); - private final MRUBundleFileList mruList = new MRUBundleFileList(); + private final MRUBundleFileList mruList; private final FrameworkExtensionInstaller extensionInstaller; public Storage(EquinoxContainer container) throws IOException, BundleException { + mruList = new MRUBundleFileList(getBundleFileLimit(container.getConfiguration())); equinoxContainer = container; extensionInstaller = new FrameworkExtensionInstaller(container.getConfiguration()); @@ -137,6 +138,18 @@ public class Storage { this.moduleContainer.setInitialModuleStates(); } + private int getBundleFileLimit(EquinoxConfiguration configuration) { + int propValue = 100; // enable to 100 open files by default + try { + String prop = configuration.getConfiguration(EquinoxConfiguration.PROP_FILE_LIMIT); + if (prop != null) + propValue = Integer.parseInt(prop); + } catch (NumberFormatException e) { + // use default of 100 + } + return propValue; + } + private void installExtensions() { Module systemModule = moduleContainer.getModule(0); ModuleRevision systemRevision = systemModule == null ? null : systemModule.getCurrentRevision(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java index 142372396..f3488fdcc 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java @@ -23,21 +23,9 @@ import org.eclipse.osgi.framework.eventmgr.*; * @since 3.2 */ public class MRUBundleFileList implements EventDispatcher { - private static final String PROP_FILE_LIMIT = "osgi.bundlefile.limit"; //$NON-NLS-1$ private static final int MIN = 10; - private static final int PROP_FILE_LIMIT_VALUE; private static final ThreadLocal closingBundleFile = new ThreadLocal(); - static { - int propValue = 100; // enable to 100 open files by default - try { - String prop = BundleFile.secureAction.getProperty(PROP_FILE_LIMIT); - if (prop != null) - propValue = Integer.parseInt(prop); - } catch (NumberFormatException e) { - //MRU will be disabled - } - PROP_FILE_LIMIT_VALUE = propValue; - } + // list of open bundle files final private BundleFile[] bundleFileList; // list of open bundle files use stamps @@ -53,10 +41,6 @@ public class MRUBundleFileList implements EventDispatcher MIN this.fileLimit = fileLimit; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java index 8535953da..19d6ad890 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java @@ -28,11 +28,23 @@ import java.net.*; */ public class Handler extends URLStreamHandler { + private final String installPath; + + public Handler(String installURL) { + super(); + if (installURL != null && installURL.startsWith("file:")) { //$NON-NLS-1$ + // this is the safest way to create a File object off a file: URL + this.installPath = installURL.substring(5); + } else { + this.installPath = null; + } + } + /** * @throws IOException */ protected URLConnection openConnection(URL url) throws IOException { - return new ReferenceURLConnection(url); + return new ReferenceURLConnection(url, installPath); } protected void parseURL(URL url, String str, int start, int end) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java index 374f42d47..a5fdd2168 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java @@ -11,22 +11,23 @@ package org.eclipse.osgi.storage.url.reference; -import org.eclipse.osgi.framework.util.FilePath; - import java.io.*; import java.net.URL; import java.net.URLConnection; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; +import org.eclipse.osgi.framework.util.FilePath; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; /** * URLConnection for the reference protocol. */ public class ReferenceURLConnection extends URLConnection { - protected URL reference; + private final String installPath; + private URL reference; - protected ReferenceURLConnection(URL url) { + protected ReferenceURLConnection(URL url, String installPath) { super(url); + this.installPath = installPath; } @SuppressWarnings("deprecation") @@ -40,7 +41,6 @@ public class ReferenceURLConnection extends URLConnection { URL ref; if (!file.isAbsolute()) { - String installPath = getInstallPath(); if (installPath != null) file = makeAbsolute(installPath, file); } @@ -48,7 +48,7 @@ public class ReferenceURLConnection extends URLConnection { // Pre-check if file exists, if not, and it contains escape characters, // try decoding the absolute path generated by makeAbsolute if (!file.exists() && path.indexOf('%') >= 0) { - String decodePath = FrameworkProperties.decode(file.getAbsolutePath()); + String decodePath = EquinoxConfiguration.decode(file.getAbsolutePath()); File f = new File(decodePath); if (f.exists()) file = f; @@ -103,16 +103,6 @@ public class ReferenceURLConnection extends URLConnection { return new ReferenceInputStream(reference); } - private String getInstallPath() { - String installURL = FrameworkProperties.getProperty("osgi.install.area"); //$NON-NLS-1$ - if (installURL == null) - return null; - if (!installURL.startsWith("file:")) //$NON-NLS-1$ - return null; - // this is the safest way to create a File object off a file: URL - return installURL.substring(5); - } - private static File makeAbsolute(String base, File relative) { if (relative.isAbsolute()) return relative; diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/FrameworkProperties.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/FrameworkProperties.java deleted file mode 100644 index c44045758..000000000 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/FrameworkProperties.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2011 Cognos Incorporated, IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - *******************************************************************************/ -package org.eclipse.osgi.framework.internal.core; - -import org.eclipse.osgi.internal.location.EclipseAdaptorMsg; - -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLDecoder; -import java.security.CodeSource; -import java.util.*; -import org.eclipse.osgi.util.NLS; - -/* - * This class should be used in ALL places in the framework implementation to get "system" properties. - * The static methods on this class should be used instead of the System#getProperty, System#setProperty etc methods. - */ -public class FrameworkProperties { - - /**@GuardedBy FrameworkProperties.class*/ - private static Properties properties; - - // A flag of some sort will have to be supported. - // Many existing plugins get framework propeties directly from System instead of BundleContext. - // Note that the OSGi TCK is one example where this property MUST be set to false because many TCK bundles set and read system properties. - private static final String USING_SYSTEM_PROPERTIES_KEY = "osgi.framework.useSystemProperties"; //$NON-NLS-1$ - private static final String PROP_FRAMEWORK = "osgi.framework"; //$NON-NLS-1$ - private static final String PROP_INSTALL_AREA = "osgi.install.area"; //$NON-NLS-1$ - - public static Properties getProperties() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPropertiesAccess(); - return internalGetProperties(null); - } - - public static String getProperty(String key) { - return getProperty(key, null); - } - - public static String getProperty(String key, String defaultValue) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPropertyAccess(key); - return internalGetProperties(null).getProperty(key, defaultValue); - } - - public static String setProperty(String key, String value) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new PropertyPermission(key, "write")); //$NON-NLS-1$ - return (String) internalGetProperties(null).put(key, value); - } - - public static String clearProperty(String key) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new PropertyPermission(key, "write")); //$NON-NLS-1$ - return (String) internalGetProperties(null).remove(key); - } - - private static synchronized Properties internalGetProperties(String usingSystemProperties) { - if (properties == null) { - Properties systemProperties = System.getProperties(); - if (usingSystemProperties == null) - usingSystemProperties = systemProperties.getProperty(USING_SYSTEM_PROPERTIES_KEY); - if (usingSystemProperties == null || usingSystemProperties.equalsIgnoreCase(Boolean.TRUE.toString())) { - properties = systemProperties; - } else { - // use systemProperties for a snapshot - // also see requirements in Bundlecontext.getProperty(...)) - properties = new Properties(); - // snapshot of System properties for uses of getProperties who expect to see framework properties set as System properties - // we need to do this for all system properties because the properties object is used to back - // BundleContext#getProperty method which expects all system properties to be available - synchronized (systemProperties) { - // bug 360198 - must synchronize on systemProperties to avoid concurrent modification exception - properties.putAll(systemProperties); - } - } - } - return properties; - } - - public static synchronized void setProperties(Map input) { - if (input == null) { - // just use internal props; note that this will reuse a previous set of properties if they were set - internalGetProperties("false"); //$NON-NLS-1$ - return; - } - properties = null; - Properties toSet = internalGetProperties("false"); //$NON-NLS-1$ - for (Iterator keys = input.keySet().iterator(); keys.hasNext();) { - String key = keys.next(); - Object value = input.get(key); - if (value instanceof String) { - toSet.setProperty(key, (String) value); - continue; - } - value = input.get(key); - if (value != null) - toSet.put(key, value); - else - toSet.remove(key); - } - } - - public static synchronized boolean inUse() { - return properties != null; - } - - public static void initializeProperties() { - // initialize some framework properties that must always be set - if (getProperty(PROP_FRAMEWORK) == null || getProperty(PROP_INSTALL_AREA) == null) { - CodeSource cs = FrameworkProperties.class.getProtectionDomain().getCodeSource(); - if (cs == null) - throw new IllegalArgumentException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_PROPS_NOT_SET, PROP_FRAMEWORK + ", " + PROP_INSTALL_AREA)); //$NON-NLS-1$ - URL url = cs.getLocation(); - // allow props to be preset - if (getProperty(PROP_FRAMEWORK) == null) - setProperty(PROP_FRAMEWORK, url.toExternalForm()); - if (getProperty(PROP_INSTALL_AREA) == null) { - String filePart = url.getFile(); - setProperty(PROP_INSTALL_AREA, filePart.substring(0, filePart.lastIndexOf('/'))); - } - } - // always decode these properties - setProperty(PROP_FRAMEWORK, decode(getProperty(PROP_FRAMEWORK))); - setProperty(PROP_INSTALL_AREA, decode(getProperty(PROP_INSTALL_AREA))); - } - - public static String decode(String urlString) { - //try to use Java 1.4 method if available - try { - Class clazz = URLDecoder.class; - Method method = clazz.getDeclaredMethod("decode", new Class[] {String.class, String.class}); //$NON-NLS-1$ - //first encode '+' characters, because URLDecoder incorrectly converts - //them to spaces on certain class library implementations. - if (urlString.indexOf('+') >= 0) { - int len = urlString.length(); - StringBuffer buf = new StringBuffer(len); - for (int i = 0; i < len; i++) { - char c = urlString.charAt(i); - if (c == '+') - buf.append("%2B"); //$NON-NLS-1$ - else - buf.append(c); - } - urlString = buf.toString(); - } - Object result = method.invoke(null, new Object[] {urlString, "UTF-8"}); //$NON-NLS-1$ - if (result != null) - return (String) result; - } catch (Exception e) { - //JDK 1.4 method not found -- fall through and decode by hand - } - //decode URL by hand - boolean replaced = false; - byte[] encodedBytes = urlString.getBytes(); - int encodedLength = encodedBytes.length; - byte[] decodedBytes = new byte[encodedLength]; - int decodedLength = 0; - for (int i = 0; i < encodedLength; i++) { - byte b = encodedBytes[i]; - if (b == '%') { - byte enc1 = encodedBytes[++i]; - byte enc2 = encodedBytes[++i]; - b = (byte) ((hexToByte(enc1) << 4) + hexToByte(enc2)); - replaced = true; - } - decodedBytes[decodedLength++] = b; - } - if (!replaced) - return urlString; - try { - return new String(decodedBytes, 0, decodedLength, "UTF-8"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e) { - //use default encoding - return new String(decodedBytes, 0, decodedLength); - } - } - - private static int hexToByte(byte b) { - switch (b) { - case '0' : - return 0; - case '1' : - return 1; - case '2' : - return 2; - case '3' : - return 3; - case '4' : - return 4; - case '5' : - return 5; - case '6' : - return 6; - case '7' : - return 7; - case '8' : - return 8; - case '9' : - return 9; - case 'A' : - case 'a' : - return 10; - case 'B' : - case 'b' : - return 11; - case 'C' : - case 'c' : - return 12; - case 'D' : - case 'd' : - return 13; - case 'E' : - case 'e' : - return 14; - case 'F' : - case 'f' : - return 15; - default : - throw new IllegalArgumentException("Switch error decoding URL"); //$NON-NLS-1$ - } - } -} diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java index ccc07f32a..6db71a435 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java @@ -15,7 +15,6 @@ import java.io.*; import java.util.*; import java.util.zip.CRC32; import java.util.zip.Checksum; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; /** * ReliableFile class used by ReliableFileInputStream and ReliableOutputStream. @@ -92,7 +91,7 @@ public class ReliableFile { private static final Object lastGenerationLock = new Object(); static { - String prop = FrameworkProperties.getProperty(PROP_MAX_BUFFER); + String prop = System.getProperty(PROP_MAX_BUFFER); int tmpMaxInput = 128 * 1024; //128k if (prop != null) { try { @@ -103,7 +102,7 @@ public class ReliableFile { maxInputStreamBuffer = tmpMaxInput; int tmpDefaultMax = 2; - prop = FrameworkProperties.getProperty(PROP_MAX_GENERATIONS); + prop = System.getProperty(PROP_MAX_GENERATIONS); if (prop != null) { try { tmpDefaultMax = Integer.parseInt(prop); @@ -112,7 +111,7 @@ public class ReliableFile { } defaultMaxGenerations = tmpDefaultMax; - prop = FrameworkProperties.getProperty(PROP_OSGI_LOCKING); + prop = System.getProperty(PROP_OSGI_LOCKING); boolean tmpFileSharing = true; if (prop != null) { if (prop.equals("none")) { //$NON-NLS-1$ diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java index de679602c..7db659307 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java @@ -14,10 +14,8 @@ package org.eclipse.osgi.framework.util; import java.io.*; import java.net.*; import java.security.*; -import java.util.Properties; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; import org.osgi.framework.*; import org.osgi.util.tracker.ServiceTracker; @@ -70,43 +68,10 @@ public class SecureAction { */ public String getProperty(final String property) { if (System.getSecurityManager() == null) - return FrameworkProperties.getProperty(property); + return System.getProperty(property); return AccessController.doPrivileged(new PrivilegedAction() { public String run() { - return FrameworkProperties.getProperty(property); - } - }, controlContext); - } - - /** - * Returns a system property. Same as calling - * System.getProperty(String,String). - * @param property the property key. - * @param def the default value if the property key does not exist. - * @return the value of the property or the def value if the property - * does not exist. - */ - public String getProperty(final String property, final String def) { - if (System.getSecurityManager() == null) - return FrameworkProperties.getProperty(property, def); - return AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - return FrameworkProperties.getProperty(property, def); - } - }, controlContext); - } - - /** - * Returns the system properties. Same as calling - * System.getProperties(). - * @return the system properties. - */ - public Properties getProperties() { - if (System.getSecurityManager() == null) - return FrameworkProperties.getProperties(); - return AccessController.doPrivileged(new PrivilegedAction() { - public Properties run() { - return FrameworkProperties.getProperties(); + return System.getProperty(property); } }, controlContext); } diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java index bf1610eac..09cc632d4 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java @@ -369,7 +369,7 @@ class EclipseDebugTrace implements DebugTrace { */ private void readLogProperties() { - String newMaxTraceFileSize = secureAction.getProperty(PROP_TRACE_SIZE_MAX); + String newMaxTraceFileSize = debugOptions.getConfiguration().getConfiguration(PROP_TRACE_SIZE_MAX); if (newMaxTraceFileSize != null) { maxTraceFileSize = Integer.parseInt(newMaxTraceFileSize); if (maxTraceFileSize != 0 && maxTraceFileSize < DEFAULT_TRACE_FILE_MIN_SIZE) { @@ -379,7 +379,7 @@ class EclipseDebugTrace implements DebugTrace { } } - String newMaxLogFiles = secureAction.getProperty(PROP_TRACE_FILE_MAX); + String newMaxLogFiles = debugOptions.getConfiguration().getConfiguration(PROP_TRACE_FILE_MAX); if (newMaxLogFiles != null) { maxTraceFiles = Integer.parseInt(newMaxLogFiles); if (maxTraceFiles < 1) { diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java index f5142eb98..71fe5a28a 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java @@ -434,6 +434,10 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom return this.verboseDebug; } + EquinoxConfiguration getConfiguration() { + return this.environmentInfo; + } + /* * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#setVerbose(boolean) diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java index c69e6ce6b..31a9c0a4c 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.osgi.util; -import org.eclipse.osgi.internal.debug.Debug; - import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; @@ -19,9 +17,9 @@ import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; -import org.eclipse.osgi.framework.internal.core.FrameworkProperties; import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.framework.log.FrameworkLogEntry; +import org.eclipse.osgi.internal.debug.Debug; /** * Common superclass for all message bundle classes. Provides convenience @@ -58,7 +56,7 @@ public abstract class NLS { private static String[] nlSuffixes; private static final String PROP_WARNINGS = "osgi.nls.warnings"; //$NON-NLS-1$ private static final String IGNORE = "ignore"; //$NON-NLS-1$ - private static final boolean ignoreWarnings = IGNORE.equals(FrameworkProperties.getProperty(PROP_WARNINGS)); + private static final boolean ignoreWarnings = IGNORE.equals(System.getProperty(PROP_WARNINGS)); /* * NOTE do not change the name of this field; it is set by the Framework using reflection -- cgit v1.2.3