diff options
author | Thomas Watson | 2013-05-07 19:32:11 +0000 |
---|---|---|
committer | Thomas Watson | 2013-05-07 19:34:01 +0000 |
commit | d1ccf7f8e41e3ae9cbb008c289b4d9bf945fc18d (patch) | |
tree | 82a7fbe2ceac54ac46b6d54ba91cde0e4635f8cf | |
parent | 1b98dcc1af83209eb0583409a0b9bddc45212d21 (diff) | |
download | rt.equinox.framework-d1ccf7f8e41e3ae9cbb008c289b4d9bf945fc18d.tar.gz rt.equinox.framework-d1ccf7f8e41e3ae9cbb008c289b4d9bf945fc18d.tar.xz rt.equinox.framework-d1ccf7f8e41e3ae9cbb008c289b4d9bf945fc18d.zip |
Consolidate message properties files.
12 files changed, 142 insertions, 176 deletions
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 ffc8b7df7..796b066b3 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 @@ -11,6 +11,8 @@ *******************************************************************************/ package org.eclipse.core.runtime.adaptor; +import org.eclipse.osgi.framework.internal.core.Msg; + import java.io.*; import java.lang.reflect.Method; import java.net.*; @@ -213,7 +215,7 @@ public class EclipseStarter { */ public static Object run(String[] args, Runnable endSplashHandler) throws Exception { if (running) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ALREADY_RUNNING); boolean startupFailed = true; try { startup(args, endSplashHandler); @@ -226,7 +228,7 @@ public class EclipseStarter { if (endSplashHandler != null) endSplashHandler.run(); // may use startupFailed to understand where the error happened - FrameworkLogEntry logEntry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, startupFailed ? EclipseAdaptorMsg.ECLIPSE_STARTUP_STARTUP_ERROR : EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null); + FrameworkLogEntry logEntry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, startupFailed ? Msg.ECLIPSE_STARTUP_STARTUP_ERROR : Msg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null); if (log != null) log.log(logEntry); else @@ -241,7 +243,7 @@ public class EclipseStarter { if (!Boolean.valueOf(getProperty(PROP_NOSHUTDOWN)).booleanValue()) shutdown(); } catch (Throwable e) { - FrameworkLogEntry logEntry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, EclipseAdaptorMsg.ECLIPSE_STARTUP_SHUTDOWN_ERROR, 1, e, null); + FrameworkLogEntry logEntry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, Msg.ECLIPSE_STARTUP_SHUTDOWN_ERROR, 1, e, null); if (log != null) log.log(logEntry); else @@ -252,7 +254,7 @@ public class EclipseStarter { // we only get here if an error happened if (getProperty(PROP_EXITCODE) == null) { setProperty(PROP_EXITCODE, "13"); //$NON-NLS-1$ - setProperty(PROP_EXITDATA, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_CHECK_LOG, log == null ? null : log.getFile().getPath())); + setProperty(PROP_EXITDATA, NLS.bind(Msg.ECLIPSE_STARTUP_ERROR_CHECK_LOG, log == null ? null : log.getFile().getPath())); } return null; } @@ -278,7 +280,7 @@ public class EclipseStarter { */ public static BundleContext startup(String[] args, Runnable endSplashHandler) throws Exception { if (running) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ALREADY_RUNNING); processCommandLine(args); finalizeProperties(); framework = new Equinox(configuration); @@ -353,7 +355,7 @@ public class EclipseStarter { */ public static Object run(Object argument) throws Exception { if (!running) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_NOT_RUNNING); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_NOT_RUNNING); // if we are just initializing, do not run the application just return. if (initialize) return new Integer(0); @@ -427,14 +429,14 @@ public class EclipseStarter { if (bundles[i].getState() != Bundle.ACTIVE) { if (bundles[i].getState() == Bundle.INSTALLED) { // Log that the bundle is not resolved - log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED, bundles[i].getLocation()), 0, null, null)); + log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED, bundles[i].getLocation()), 0, null, null)); continue; } // check that the startlevel allows the bundle to be active (111550) FrameworkStartLevel fwStartLevel = context.getBundle().adapt(FrameworkStartLevel.class); BundleStartLevel bundleStartLevel = bundles[i].adapt(BundleStartLevel.class); if (fwStartLevel != null && (bundleStartLevel.getStartLevel() <= fwStartLevel.getStartLevel())) { - log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE, bundles[i]), 0, null, null)); + log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE, bundles[i]), 0, null, null)); } } } @@ -614,7 +616,7 @@ public class EclipseStarter { try { URL location = searchForBundle(name, syspath); if (location == null) { - FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_BUNDLE_NOT_FOUND, installEntries[i]), 0, null, null); + FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_BUNDLE_NOT_FOUND, installEntries[i]), 0, null, null); log.log(entry); // skip this entry continue; @@ -932,7 +934,7 @@ public class EclipseStarter { curInitBundles[i].uninstall(); toRefresh.add(curInitBundles[i]); } catch (BundleException e) { - FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_UNINSTALL, curInitBundles[i].getLocation()), 0, e, null); + FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_UNINSTALL, curInitBundles[i].getLocation()), 0, e, null); log.log(entry); } } @@ -970,10 +972,10 @@ public class EclipseStarter { if ((osgiBundle.getState() & Bundle.INSTALLED) != 0) toRefresh.add(osgiBundle); } catch (BundleException e) { - FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null); + FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null); log.log(entry); } catch (IOException e) { - FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null); + FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null); log.log(entry); } } @@ -1031,7 +1033,7 @@ public class EclipseStarter { } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved - FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); + FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } @@ -1336,7 +1338,7 @@ public class EclipseStarter { */ static void internalAddFrameworkShutdownHandler(Runnable handler) { if (running) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ALREADY_RUNNING); if (shutdownHandlers == null) shutdownHandlers = new ArrayList<Runnable>(); @@ -1354,7 +1356,7 @@ public class EclipseStarter { */ static void internalRemoveFrameworkShutdownHandler(Runnable handler) { if (running) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ALREADY_RUNNING); if (shutdownHandlers != null) shutdownHandlers.remove(handler); 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 d4dc9072f..7d7e1158e 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2013 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 @@ -14,11 +14,11 @@ 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.Msg; 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.*; import org.osgi.framework.*; @@ -72,7 +72,7 @@ public class EclipseAppLauncher implements ApplicationLauncher { // here we assume that launch has been called by runtime before we started // TODO this may be a bad assumption but it works for now because we register the app launcher as a service and runtime synchronously calls launch on the service if (failOnNoDefault && runnable == null) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION); Object result = null; boolean doRelaunch; do { @@ -82,7 +82,7 @@ public class EclipseAppLauncher implements ApplicationLauncher { if (!relaunch || (context.getBundle().getState() & Bundle.ACTIVE) == 0) throw e; if (log != null) - log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null)); + log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, Msg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null)); } doRelaunch = (relaunch && (context.getBundle().getState() & Bundle.ACTIVE) != 0); } while (doRelaunch); @@ -151,6 +151,6 @@ public class EclipseAppLauncher implements ApplicationLauncher { launch.invoke(defaultApp, new Object[] {null}); return start(argument); } - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION); + throw new IllegalStateException(Msg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION); } } 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 b504f8b2f..e24b89d80 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 @@ -21,6 +21,8 @@ import static org.osgi.framework.Constants.SUPPORTS_FRAMEWORK_EXTENSION; import static org.osgi.framework.Constants.SUPPORTS_FRAMEWORK_FRAGMENT; import static org.osgi.framework.Constants.SUPPORTS_FRAMEWORK_REQUIREBUNDLE; +import org.eclipse.osgi.framework.internal.core.Msg; + import java.io.*; import java.lang.reflect.Method; import java.net.*; @@ -29,7 +31,6 @@ import java.util.*; import org.eclipse.osgi.internal.debug.Debug; import org.eclipse.osgi.internal.debug.FrameworkDebugOptions; import org.eclipse.osgi.internal.hookregistry.HookRegistry; -import org.eclipse.osgi.internal.location.EclipseAdaptorMsg; import org.eclipse.osgi.internal.location.EquinoxLocations; import org.eclipse.osgi.service.debug.DebugOptions; import org.eclipse.osgi.service.environment.Constants; @@ -576,7 +577,7 @@ public class EquinoxConfiguration implements EnvironmentInfo { if (configuration.get(PROP_FRAMEWORK) == null || configuration.get(EquinoxLocations.PROP_INSTALL_AREA) == null) { CodeSource cs = EquinoxConfiguration.class.getProtectionDomain().getCodeSource(); if (cs == null) - throw new IllegalArgumentException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_PROPS_NOT_SET, PROP_FRAMEWORK + ", " + EquinoxLocations.PROP_INSTALL_AREA)); //$NON-NLS-1$ + throw new IllegalArgumentException(NLS.bind(Msg.ECLIPSE_STARTUP_PROPS_NOT_SET, PROP_FRAMEWORK + ", " + EquinoxLocations.PROP_INSTALL_AREA)); //$NON-NLS-1$ URL url = cs.getLocation(); // allow props to be preset if (configuration.get(PROP_FRAMEWORK) == null) { @@ -692,7 +693,7 @@ public class EquinoxConfiguration implements EnvironmentInfo { break; default : // if the user passed us in a bogus value then log a message and use the default - System.err.println(NLS.bind(EclipseAdaptorMsg.error_badNL, nlValue)); + System.err.println(NLS.bind(Msg.error_badNL, nlValue)); userLocale = Locale.getDefault(); break; } 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 86a496c35..0f37b447c 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 @@ -11,6 +11,8 @@ package org.eclipse.osgi.internal.hooks; +import org.eclipse.osgi.framework.internal.core.Msg; + import java.security.AccessController; import java.util.*; import org.eclipse.osgi.container.*; @@ -22,7 +24,6 @@ import org.eclipse.osgi.framework.util.SecureAction; import org.eclipse.osgi.internal.framework.EquinoxContainer; import org.eclipse.osgi.internal.hookregistry.ClassLoaderHook; import org.eclipse.osgi.internal.loader.classpath.ClasspathManager; -import org.eclipse.osgi.internal.location.EclipseAdaptorMsg; import org.eclipse.osgi.util.NLS; import org.osgi.framework.*; @@ -108,11 +109,11 @@ public class EclipseLazyStarter extends ClassLoaderHook { } catch (BundleException e) { Bundle bundle = managers[i].getGeneration().getRevision().getBundle(); if (e.getType() == BundleException.STATECHANGE_ERROR) { - String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP, new Object[] {Thread.currentThread(), name, null, bundle, new Long(System.currentTimeMillis() - startTime)}); + String message = NLS.bind(Msg.ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP, new Object[] {Thread.currentThread(), name, null, bundle, new Long(System.currentTimeMillis() - startTime)}); container.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, message, e); continue; } - String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_ACTIVATION, bundle.getSymbolicName(), Long.toString(bundle.getBundleId())); + String message = NLS.bind(Msg.ECLIPSE_CLASSLOADER_ACTIVATION, bundle.getSymbolicName(), Long.toString(bundle.getBundleId())); ClassNotFoundException error = new ClassNotFoundException(message, e); errors.put(managers[i], error); if (container.getConfiguration().throwErrorOnFailedStart) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java index 253095398..c994abdf2 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -13,7 +13,7 @@ package org.eclipse.osgi.storage.url; import java.io.IOException; import java.net.URL; import java.net.URLConnection; -import org.eclipse.osgi.internal.location.EclipseAdaptorMsg; +import org.eclipse.osgi.framework.internal.core.Msg; import org.eclipse.osgi.service.urlconversion.URLConverter; import org.eclipse.osgi.util.NLS; @@ -37,7 +37,7 @@ public class BundleURLConverter implements URLConverter { * was a problem extracting the file to disk. See bug 259241. **/ if (result == null) - throw new IOException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_PLUGIN_EXTRACTION_PROBLEM, url)); + throw new IOException(NLS.bind(Msg.ECLIPSE_PLUGIN_EXTRACTION_PROBLEM, url)); return result; } return url; diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/ExternalMessages.properties b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/ExternalMessages.properties index add5e3a54..91e9cadab 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/ExternalMessages.properties +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/ExternalMessages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2003, 2011 IBM Corporation and others. +# Copyright (c) 2003, 2013 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 @@ -48,3 +48,45 @@ HEADER_DIRECTIVE_DUPLICATES=Duplicate directives are not permitted \"{0}\" HEADER_ATTRIBUTE_DUPLICATES=Duplicate attributes are not permitted \"{0}\" HEADER_EXTENSION_ERROR=Extension bundle is not a fragment to the system bundle \"{0}\" +#EclipseStarter messages +ECLIPSE_STARTUP_BUNDLE_NOT_FOUND=Bundle {0} not found. +ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED=Bundle {0} was not resolved. +ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE=Bundle {0} is not active. +ECLIPSE_STARTUP_ERROR_NO_APPLICATION=Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini). +#Don't use double quotes in the ECLIPSE_STARTUP_ERROR_CHECK_LOG. (See bug 86085) +ECLIPSE_STARTUP_ERROR_CHECK_LOG=An error has occurred. See the log file\n{0}. +ECLIPSE_STARTUP_ALREADY_RUNNING=Platform already running +ECLIPSE_STARTUP_NOT_RUNNING=Platform not running +ECLIPSE_STARTUP_STARTUP_ERROR=Startup error +ECLIPSE_STARTUP_APP_ERROR=Application error +ECLIPSE_STARTUP_SHUTDOWN_ERROR=Shutdown error +ECLIPSE_STARTUP_FAILED_INSTALL=Error installing bundle: {0} +ECLIPSE_STARTUP_FAILED_UNINSTALL=Error uninstalling bundle: {0} +ECLIPSE_STARTUP_FAILED_START=Error starting bundle: {0} +ECLIPSE_STARTUP_PROPS_NOT_SET=Cannot start without the following system properties set: {0} + +#Classloader messages +ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP=While loading class "{1}", thread "{0}" timed out waiting ({4}ms) for thread "{2}" to finish starting bundle "{3}". To avoid deadlock, thread "{0}" is proceeding but "{1}" may not be fully initialized. +ECLIPSE_CLASSLOADER_ACTIVATION=An error occurred while automatically activating bundle {0} ({1}). + +#Location message +ECLIPSE_CANNOT_CHANGE_LOCATION = Cannot change the location once it is set. + +#NL Problem +error_badNL=Bad value: \"{0}\" for NL. Using system default. + +#FileMananger messages +fileManager_cannotLock = Unable to create lock manager. +fileManager_updateFailed = File update failed on one or more files. +fileManager_illegalInReadOnlyMode = Cannot perform operation while in read-only mode. +fileManager_notOpen = Manager is not opened. + +#Location messages +location_cannotLockNIO = An error occurred while locking file \"{0}\": \"{1}\". A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location, or disable file locking by passing {2} as a VM argument. +location_cannotLock = An error occurred while locking file \"{0}\". +location_folderReadOnly = The folder \"{0}\" is read-only. +location_notSet = The location has not been set. +location_notFileProtocol = Unable to lock the location. The set location is not a file URL: {0} +location_noLockFile = The lock file has not been set. + +ECLIPSE_PLUGIN_EXTRACTION_PROBLEM = The URL \"{0}\" could not be extracted probably due to insufficient permissions or insufficient disk space. diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/Msg.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/Msg.java index e27634b34..4f66a9e2a 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/Msg.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/core/Msg.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -63,4 +63,34 @@ public class Msg extends NLS { // initialize resource bundles NLS.initializeMessages(BUNDLE_NAME, Msg.class); } + + public static String ECLIPSE_CANNOT_CHANGE_LOCATION; + public static String fileManager_cannotLock; + public static String fileManager_updateFailed; + public static String fileManager_illegalInReadOnlyMode; + public static String fileManager_notOpen; + public static String ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP; + public static String ECLIPSE_CLASSLOADER_ACTIVATION; + public static String ECLIPSE_STARTUP_ALREADY_RUNNING; + public static String ECLIPSE_STARTUP_STARTUP_ERROR; + public static String ECLIPSE_STARTUP_SHUTDOWN_ERROR; + public static String ECLIPSE_STARTUP_ERROR_CHECK_LOG; + public static String ECLIPSE_STARTUP_NOT_RUNNING; + public static String ECLIPSE_STARTUP_ERROR_NO_APPLICATION; + public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE; + public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED; + public static String ECLIPSE_STARTUP_BUNDLE_NOT_FOUND; + public static String ECLIPSE_STARTUP_FAILED_UNINSTALL; + public static String ECLIPSE_STARTUP_FAILED_INSTALL; + public static String ECLIPSE_STARTUP_FAILED_START; + public static String ECLIPSE_STARTUP_APP_ERROR; + public static String ECLIPSE_STARTUP_PROPS_NOT_SET; + public static String error_badNL; + public static String location_cannotLock; + public static String location_cannotLockNIO; + public static String location_folderReadOnly; + public static String location_notSet; + public static String location_notFileProtocol; + public static String location_noLockFile; + public static String ECLIPSE_PLUGIN_EXTRACTION_PROBLEM; } diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/BasicLocation.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/BasicLocation.java index f8c2e35e8..6cd3e9f77 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/BasicLocation.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/BasicLocation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -13,6 +13,7 @@ package org.eclipse.osgi.internal.location; import java.io.File; import java.io.IOException; import java.net.URL; +import org.eclipse.osgi.framework.internal.core.Msg; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.osgi.util.NLS; @@ -125,7 +126,7 @@ public class BasicLocation implements Location { public synchronized boolean set(URL value, boolean lock, String lockFilePath) throws IllegalStateException, IOException { if (location != null) - throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_CANNOT_CHANGE_LOCATION); + throw new IllegalStateException(Msg.ECLIPSE_CANNOT_CHANGE_LOCATION); File file = null; if (value.getProtocol().equalsIgnoreCase("file")) { //$NON-NLS-1$ try { @@ -163,7 +164,7 @@ public class BasicLocation implements Location { public synchronized boolean lock() throws IOException { if (!isSet()) - throw new IOException(EclipseAdaptorMsg.location_notSet); + throw new IOException(Msg.location_notSet); return lock(lockFile, location); } @@ -178,18 +179,18 @@ public class BasicLocation implements Location { */ private boolean lock(File lock, URL locationValue) throws IOException { if (isReadOnly) - throw new IOException(NLS.bind(EclipseAdaptorMsg.location_folderReadOnly, lock)); + throw new IOException(NLS.bind(Msg.location_folderReadOnly, lock)); if (lock == null) { if (locationValue != null && !"file".equalsIgnoreCase(locationValue.getProtocol())) //$NON-NLS-1$ - throw new IOException(NLS.bind(EclipseAdaptorMsg.location_notFileProtocol, locationValue)); - throw new IllegalStateException(EclipseAdaptorMsg.location_noLockFile); // this is really unexpected + throw new IOException(NLS.bind(Msg.location_notFileProtocol, locationValue)); + throw new IllegalStateException(Msg.location_noLockFile); // this is really unexpected } if (isLocked()) return false; File parentFile = new File(lock.getParent()); if (!parentFile.exists()) if (!parentFile.mkdirs()) - throw new IOException(NLS.bind(EclipseAdaptorMsg.location_folderReadOnly, parentFile)); + throw new IOException(NLS.bind(Msg.location_folderReadOnly, parentFile)); setLocker(lock); if (locker == null) @@ -240,7 +241,7 @@ public class BasicLocation implements Location { public URL getDataArea(String filename) throws IOException { URL base = getURL(); if (base == null) - throw new IOException(EclipseAdaptorMsg.location_notSet); + throw new IOException(Msg.location_notSet); String prefix = base.toExternalForm(); if (prefix.length() > 0 && prefix.charAt(prefix.length() - 1) != '/') prefix += '/'; diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMessages.properties b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMessages.properties deleted file mode 100644 index ce29cd962..000000000 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMessages.properties +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2011 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -#External Messages for EN locale - -#EclipseStarter messages -ECLIPSE_STARTUP_BUNDLE_NOT_FOUND=Bundle {0} not found. -ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED=Bundle {0} was not resolved. -ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE=Bundle {0} is not active. -ECLIPSE_STARTUP_ERROR_NO_APPLICATION=Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini). -#Don't use double quotes in the ECLIPSE_STARTUP_ERROR_CHECK_LOG. (See bug 86085) -ECLIPSE_STARTUP_ERROR_CHECK_LOG=An error has occurred. See the log file\n{0}. -ECLIPSE_STARTUP_ALREADY_RUNNING=Platform already running -ECLIPSE_STARTUP_NOT_RUNNING=Platform not running -ECLIPSE_STARTUP_STARTUP_ERROR=Startup error -ECLIPSE_STARTUP_APP_ERROR=Application error -ECLIPSE_STARTUP_SHUTDOWN_ERROR=Shutdown error -ECLIPSE_STARTUP_FAILED_INSTALL=Error installing bundle: {0} -ECLIPSE_STARTUP_FAILED_UNINSTALL=Error uninstalling bundle: {0} -ECLIPSE_STARTUP_FAILED_START=Error starting bundle: {0} -ECLIPSE_STARTUP_PROPS_NOT_SET=Cannot start without the following system properties set: {0} - -#Classloader messages -ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP=While loading class "{1}", thread "{0}" timed out waiting ({4}ms) for thread "{2}" to finish starting bundle "{3}". To avoid deadlock, thread "{0}" is proceeding but "{1}" may not be fully initialized. -ECLIPSE_CLASSLOADER_ACTIVATION=An error occurred while automatically activating bundle {0} ({1}). - -#Location message -ECLIPSE_CANNOT_CHANGE_LOCATION = Cannot change the location once it is set. - -#NL Problem -error_badNL=Bad value: \"{0}\" for NL. Using system default. - -#FileMananger messages -fileManager_cannotLock = Unable to create lock manager. -fileManager_updateFailed = File update failed on one or more files. -fileManager_illegalInReadOnlyMode = Cannot perform operation while in read-only mode. -fileManager_notOpen = Manager is not opened. - -#Location messages -location_cannotLockNIO = An error occurred while locking file \"{0}\": \"{1}\". A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location, or disable file locking by passing {2} as a VM argument. -location_cannotLock = An error occurred while locking file \"{0}\". -location_folderReadOnly = The folder \"{0}\" is read-only. -location_notSet = The location has not been set. -location_notFileProtocol = Unable to lock the location. The set location is not a file URL: {0} -location_noLockFile = The lock file has not been set. - -ECLIPSE_PLUGIN_EXTRACTION_PROBLEM = The URL \"{0}\" could not be extracted probably due to insufficient permissions or insufficient disk space. diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMsg.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMsg.java deleted file mode 100644 index 2131d1ec3..000000000 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/EclipseAdaptorMsg.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2011 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.osgi.internal.location; - -import org.eclipse.osgi.util.NLS; - -public class EclipseAdaptorMsg extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.osgi.internal.location.EclipseAdaptorMessages"; //$NON-NLS-1$ - - public static String ECLIPSE_CANNOT_CHANGE_LOCATION; - - public static String fileManager_cannotLock; - public static String fileManager_updateFailed; - public static String fileManager_illegalInReadOnlyMode; - public static String fileManager_notOpen; - - public static String ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP; - public static String ECLIPSE_CLASSLOADER_ACTIVATION; - - public static String ECLIPSE_STARTUP_ALREADY_RUNNING; - public static String ECLIPSE_STARTUP_STARTUP_ERROR; - public static String ECLIPSE_STARTUP_SHUTDOWN_ERROR; - public static String ECLIPSE_STARTUP_ERROR_CHECK_LOG; - public static String ECLIPSE_STARTUP_NOT_RUNNING; - public static String ECLIPSE_STARTUP_ERROR_NO_APPLICATION; - public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE; - public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED; - public static String ECLIPSE_STARTUP_BUNDLE_NOT_FOUND; - public static String ECLIPSE_STARTUP_FAILED_UNINSTALL; - public static String ECLIPSE_STARTUP_FAILED_INSTALL; - public static String ECLIPSE_STARTUP_FAILED_START; - public static String ECLIPSE_STARTUP_APP_ERROR; - public static String ECLIPSE_STARTUP_PROPS_NOT_SET; - - public static String error_badNL; - - public static String location_cannotLock; - public static String location_cannotLockNIO; - public static String location_folderReadOnly; - public static String location_notSet; - public static String location_notFileProtocol; - public static String location_noLockFile; - - public static String ECLIPSE_PLUGIN_EXTRACTION_PROBLEM; - - static { - // initialize resource bundles - NLS.initializeMessages(BUNDLE_NAME, EclipseAdaptorMsg.class); - } - -} diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/Locker_JavaNio.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/Locker_JavaNio.java index d6319fe5f..1ac9bd4a5 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/Locker_JavaNio.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/Locker_JavaNio.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -15,6 +15,7 @@ package org.eclipse.osgi.internal.location; import java.io.*; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; +import org.eclipse.osgi.framework.internal.core.Msg; import org.eclipse.osgi.util.NLS; /** @@ -42,9 +43,9 @@ public class Locker_JavaNio implements Locker { } catch (IOException ioe) { // print exception if debugging if (debug) - System.out.println(NLS.bind(EclipseAdaptorMsg.location_cannotLock, lockFile)); + System.out.println(NLS.bind(Msg.location_cannotLock, lockFile)); // produce a more specific message for clients - String specificMessage = NLS.bind(EclipseAdaptorMsg.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + BasicLocation.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$ + String specificMessage = NLS.bind(Msg.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + BasicLocation.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$ throw new IOException(specificMessage); } catch (OverlappingFileLockException e) { // handle it as null result @@ -92,9 +93,9 @@ public class Locker_JavaNio implements Locker { tempLock = temp.getChannel().tryLock(0, 1, false); } catch (IOException ioe) { if (debug) - System.out.println(NLS.bind(EclipseAdaptorMsg.location_cannotLock, lockFile)); + System.out.println(NLS.bind(Msg.location_cannotLock, lockFile)); // produce a more specific message for clients - String specificMessage = NLS.bind(EclipseAdaptorMsg.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + BasicLocation.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$ + String specificMessage = NLS.bind(Msg.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + BasicLocation.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$ throw new IOException(specificMessage); } if (tempLock != null) { diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java index f975dfe95..c09511280 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -13,9 +13,11 @@ package org.eclipse.osgi.storagemanager; import java.io.*; import java.security.AccessController; import java.util.*; +import org.eclipse.osgi.framework.internal.core.Msg; import org.eclipse.osgi.framework.internal.reliablefile.*; import org.eclipse.osgi.framework.util.SecureAction; -import org.eclipse.osgi.internal.location.*; +import org.eclipse.osgi.internal.location.BasicLocation; +import org.eclipse.osgi.internal.location.Locker; /** * Storage managers provide a facility for tracking the state of a group of files having @@ -214,11 +216,11 @@ public final class StorageManager { */ private void add(String managedFile, int fileType) throws IOException { if (!open) - throw new IOException(EclipseAdaptorMsg.fileManager_notOpen); + throw new IOException(Msg.fileManager_notOpen); if (readOnly) - throw new IOException(EclipseAdaptorMsg.fileManager_illegalInReadOnlyMode); + throw new IOException(Msg.fileManager_illegalInReadOnlyMode); if (!lock(true)) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); try { updateTable(); Entry entry = (Entry) table.get(managedFile); @@ -285,11 +287,11 @@ public final class StorageManager { */ public void update(String[] managedFiles, String[] sources) throws IOException { if (!open) - throw new IOException(EclipseAdaptorMsg.fileManager_notOpen); + throw new IOException(Msg.fileManager_notOpen); if (readOnly) - throw new IOException(EclipseAdaptorMsg.fileManager_illegalInReadOnlyMode); + throw new IOException(Msg.fileManager_illegalInReadOnlyMode); if (!lock(true)) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); try { updateTable(); int[] originalReadIDs = new int[managedFiles.length]; @@ -305,7 +307,7 @@ public final class StorageManager { Entry entry = (Entry) table.get(managedFiles[i]); entry.setReadId(originalReadIDs[i]); } - throw new IOException(EclipseAdaptorMsg.fileManager_updateFailed); + throw new IOException(Msg.fileManager_updateFailed); } save(); //save only if no errors } finally { @@ -384,7 +386,7 @@ public final class StorageManager { if (locker == null) { locker = BasicLocation.createLocker(lockFile, lockMode, false); if (locker == null) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); } boolean locked = locker.lock(); if (locked || !wait) @@ -423,7 +425,7 @@ public final class StorageManager { */ public File lookup(String managedFile, boolean add) throws IOException { if (!open) - throw new IOException(EclipseAdaptorMsg.fileManager_notOpen); + throw new IOException(Msg.fileManager_notOpen); Entry entry = (Entry) table.get(managedFile); if (entry == null) { if (add) { @@ -463,13 +465,13 @@ public final class StorageManager { */ public void remove(String managedFile) throws IOException { if (!open) - throw new IOException(EclipseAdaptorMsg.fileManager_notOpen); + throw new IOException(Msg.fileManager_notOpen); if (readOnly) - throw new IOException(EclipseAdaptorMsg.fileManager_illegalInReadOnlyMode); + throw new IOException(Msg.fileManager_illegalInReadOnlyMode); // The removal needs to be done eagerly, so the value is effectively removed from the disktable. // Otherwise, an updateTable() caused by an update(,) could cause the file to readded to the local table. if (!lock(true)) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); try { updateTable(); table.remove(managedFile); @@ -601,7 +603,7 @@ public final class StorageManager { return; //Lock first, so someone else can not start while we're in the middle of cleanup if (doLock && !lock(true)) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); try { //Iterate through the temp files and delete them all, except the one representing this storage manager. String[] files = managerRoot.list(); @@ -696,12 +698,12 @@ public final class StorageManager { if (!readOnly) { managerRoot.mkdirs(); if (!managerRoot.exists()) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); if (openCleanup) cleanup(true); boolean locked = lock(wait); if (!locked && wait) - throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); + throw new IOException(Msg.fileManager_cannotLock); } try { @@ -726,7 +728,7 @@ public final class StorageManager { */ public File createTempFile(String file) throws IOException { if (readOnly) - throw new IOException(EclipseAdaptorMsg.fileManager_illegalInReadOnlyMode); + throw new IOException(Msg.fileManager_illegalInReadOnlyMode); File tmpFile = File.createTempFile(file, ReliableFile.tmpExt, base); // bug 350106: do not use deleteOnExit() If clients really want that the // they can call it themselves. |