Commit c8cce0ca authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 4.11

parent 3d722388
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.app; singleton:=true
Bundle-Version: 1.4.0.qualifier
Bundle-Version: 1.4.100.qualifier
Bundle-Vendor: %providerName
Bundle-Activator: org.eclipse.equinox.internal.app.Activator
Bundle-Localization: plugin
......
......@@ -14,12 +14,12 @@
<parent>
<artifactId>rt.equinox.bundles</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
<version>4.10.0-SNAPSHOT</version>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
......
......@@ -37,6 +37,7 @@ public interface IApplicationContext {
* while launching or running an application then the launcher will set this property
* automatically in order to display a message to the end user. An application may
* set this property for the following reasons:
* </p>
* <ul>
* <li>To provide the command line arguments to relaunch the eclipse platform. See
* {@link IApplication#EXIT_RELAUNCH}</li>
......@@ -47,7 +48,6 @@ public interface IApplicationContext {
* set to the empty <code>String</code>. This is useful for
* headless applications where error dialogs must never be displayed.</li>
* </ul>
* </p>
* @since 1.3
*/
public static final String EXIT_DATA_PROPERTY = "eclipse.exitdata"; //$NON-NLS-1$
......
......@@ -10,8 +10,7 @@ Provides core support for Eclipse application model.
Package Specification</h2>
<p>
This package specifies API for defining Eclipse applications.
<p>
</p>
@since 1.0
<p>
</body>
</html>
......@@ -14,7 +14,7 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
<version>4.10.0-SNAPSHOT</version>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
......
......@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.bidi;singleton:=true
Bundle-Version: 1.1.200.qualifier
Bundle-Version: 1.1.300.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ActivationPolicy: lazy
......
......@@ -14,11 +14,11 @@
<parent>
<artifactId>rt.equinox.bundles</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
<version>4.10.0-SNAPSHOT</version>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.bidi</artifactId>
<version>1.1.200-SNAPSHOT</version>
<version>1.1.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
......@@ -23,7 +23,7 @@ import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler;
* ensure correct presentation, or to remove those characters to
* restore the original text
* (for more explanations, please see the
* {@link org.eclipse.equinox.bidi package documentation</a>}.
* {@link org.eclipse.equinox.bidi package documentation}.
* <p>
* This class can be used without OSGi running (but only the structured text types declared
* in {@link StructuredTextTypeHandlerFactory} are available in that mode).
......@@ -70,9 +70,9 @@ public final class StructuredTextProcessor {
* Each segment has the Unicode Bidi Algorithm applied to it,
* but as a whole, the string is oriented left to right.
* </p><p>
* For example, a file path such as <tt>d:\myfolder\FOLDER\MYFILE.java</tt>
* For example, a file path such as <code>d:\myfolder\FOLDER\MYFILE.java</code>
* (where capital letters indicate RTL text) should render as
* <tt>d:\myfolder\REDLOF\ELIFYM.java</tt>.
* <code>d:\myfolder\REDLOF\ELIFYM.java</code>.
* </p>
*
* @param str the <i>lean</i> text to process
......
......@@ -19,11 +19,11 @@ import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler;
* Provides advanced methods for processing bidirectional text with
* a specific structure to ensure proper presentation.
* For a general introduction to structured text, see the
* {@link <a href="../package-summary.html">org.eclipse.equinox.bidi
* package documentation</a>}.
* {@link org.eclipse.equinox.bidi
* package documentation}.
* For details about when the advanced methods are needed, see
* {@link <a href="package-summary.html">this
* package documentation</a>}.
* {@link org.eclipse.equinox.bidi.advanced this
* package documentation}.
* <p>
* Identifiers for several common handlers are included in
* {@link org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory}. For handlers
......@@ -63,17 +63,17 @@ import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler;
* </p><p>
* The following code shows how to transform a certain type of structured text
* (directory and file paths) in order to obtain the <i>full</i>
* text corresponding to the given <i>lean</i> text.
* text corresponding to the given <i>lean</i> text.</p>
* <pre>
* IStructuredTextExpert expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.FILE);
* String leanText = "D:\\\u05d0\u05d1\\\u05d2\\\u05d3.ext";
* String fullText = expert.leanToFullText(leanText);
* System.out.println("full text = " + fullText);
* </pre>
* </p><p>
* <p>
* The following code shows how to transform successive lines of Java
* code in order to obtain the <i>full</i>
* text corresponding to the <i>lean</i> text of each line.
* text corresponding to the <i>lean</i> text of each line.</p>
* <pre>
* IStructuredTextExpert expert = StructuredTextExpertFactory.getStatefulExpert(StructuredTextTypeHandlerFactory.JAVA);
* String leanText = "int i = 3; // first Java statement";
......@@ -83,7 +83,7 @@ import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler;
* fullText = expert.leanToFullText(leanText,);
* System.out.println("full text = " + fullText);
* </pre>
* </p>
*
*/
public interface IStructuredTextExpert {
......
......@@ -153,15 +153,15 @@ public class StructuredTextEnvironment {
* will be displayed.
* <p>
* The orientation value is one of the following:
* </p>
* <ul>
* <li>{@link #ORIENT_LTR ORIENT_LTR},</li>
* <li>{@link #ORIENT_LTR ORIENT_RTL},</li>
* <li>{@link #ORIENT_CONTEXTUAL_LTR ORIENT_CONTEXTUAL_LTR},</li>
* <li>{@link #ORIENT_CONTEXTUAL_RTL ORIENT_CONTEXTUAL_RTL},</li>
* <li>{@link #ORIENT_UNKNOWN ORIENT_UNKNOWN}, or</li>
* <li>{@link #ORIENT_IGNORE ORIENT_IGNORE}</li>.
* <li>{@link #ORIENT_IGNORE ORIENT_IGNORE}</li>
* </ul>
* </p>
*/
public int getOrientation() {
return orientation;
......
......@@ -9,10 +9,10 @@ In particular, the user should use the methods in the
in the following cases:</p>
<ul>
<li>The structured type handler to use is not one of those
predefined in {@link <a href="../StructuredTextTypeHandlerFactory.html">
StructuredTextTypeHandlerFactory</a>}.</li>
<li>A non-default {@link <a href="StructuredTextEnvironment.html">
environment</a>} needs to be specified.</li>
predefined in <a href="../StructuredTextTypeHandlerFactory.html">
StructuredTextTypeHandlerFactory</a>.</li>
<li>A non-default <a href="StructuredTextEnvironment.html">
environment</a> needs to be specified.</li>
<li>A call to a method processing a piece of text may create a state
which affects the processing of the next piece of text.</li>
<li>The user needs to manage the offsets where directional formatting
......@@ -20,9 +20,9 @@ in the following cases:</p>
</ul>
<p>
Note that the basic functions are provided in package
{@link <a href="../package-summary.html">
org.eclipse.equinox.bidi</a>} and its
{@link <a href="../StructuredTextProcessor.html">StructuredTextProcessor</a>} class.
<a href="../package-summary.html">
org.eclipse.equinox.bidi</a> and its
<a href="../StructuredTextProcessor.html">StructuredTextProcessor</a> class.
</p><p>
To access the more sophisticated methods for processing structured text,
the user should proceed as follows:</p>
......
......@@ -40,13 +40,13 @@ In this package, text without directional formatting characters is
called <b><i>lean</i></b> text while the text with added directional
formatting characters is called <b><i>full</i></b> text.
</p><p>
The class {@link
<a href="StructuredTextProcessor.html"><b>StructuredTextProcessor</b></a>}
The class
<a href="StructuredTextProcessor.html"><b>StructuredTextProcessor</b></a>
is the main tool for processing structured text. It facilitates
handling several types of structured text, each type being handled
by a specific
{@link <a href="custom/StructuredTextTypeHandler.html">
<b><i>type handler</i></b></a>} :</p>
<a href="./custom/StructuredTextTypeHandler.html">
<b><i>type handler</i></b></a> :</p>
<ul>
<li>comma delimited list</li>
<li>e-mail address</li>
......@@ -60,8 +60,9 @@ by a specific
</ul>
<p>
For each of these types, an identifier is defined in
{@link <a href="StructuredTextTypeHandlerFactory.html">
<b><i>StructuredTextTypeHandlerFactory</i></b></a>} :</p>
<a href="StructuredTextTypeHandlerFactory.html">
<b><i>StructuredTextTypeHandlerFactory</i></b></a> :</p>
<p>
These identifiers can be used as argument in some methods of
<b>StructuredTextProcessor</b> to specify the type of handler to apply.
</p><p>
......@@ -72,8 +73,8 @@ manner, when the following conditions are satisfied:
<li>There exists an appropriate handler for the type of the
structured text.</li>
<li>There is no need to specify non-default conditions related
to the {@link <a href="advanced/StructuredTextEnvironment.html">
environment</a>}.</li>
to the <a href="advanced/StructuredTextEnvironment.html">
environment</a>.</li>
<li>The only operations needed are to transform <i>lean</i> text
into <i>full</i> text or vice versa.</li>
<li>There is no interdependence between the processing of a
......@@ -83,13 +84,13 @@ manner, when the following conditions are satisfied:
<p>
When their needs go beyond the conditions above,
users can use classes in the
{@link <a href="advanced/package-summary.html">
org.eclipse.equinox.bidi.advanced</a>} package.
<a href="advanced/package-summary.html">
org.eclipse.equinox.bidi.advanced</a>}package.
</p><p>
Developers who want to develop new handlers to support types of
structured text not currently supported can use components
of the package {@link <a href="custom/package-summary.html">
org.eclipse.equinox.bidi.custom</a>}.
of the package <a href="custom/package-summary.html">
org.eclipse.equinox.bidi.custom</a>.
The source code of packages org.eclipse.equinox.bidi.* can serve as example of
how to develop processors for currently unsupported types of structured text.
</p><p>
......
......@@ -14,7 +14,7 @@
<parent>
<artifactId>rt.equinox.bundles</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
<version>4.10.0-SNAPSHOT</version>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
......
......@@ -4,10 +4,10 @@ Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.cm
Bundle-Version: 1.3.100.qualifier
Bundle-Version: 1.4.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.cm.Activator
Import-Package: org.osgi.framework;version="1.7.0",
org.osgi.service.cm;version="[1.5,1.6)",
org.osgi.service.cm;version="[1.6,1.7)",
org.osgi.service.log;version="1.3.0",
org.osgi.service.event;version="1.0"; resolution:=optional,
org.osgi.util.tracker;version="1.3.1"
......@@ -15,5 +15,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Provide-Capability:
osgi.service;
objectClass:List<String>="org.osgi.service.cm.ConfigurationAdmin";
uses:="org.osgi.service.cm"
uses:="org.osgi.service.cm",
osgi.implementation;
osgi.implementation="osgi.cm";
uses:="org.osgi.service.cm";
version:Version="1.6"
Automatic-Module-Name: org.eclipse.equinox.cm
......@@ -14,11 +14,11 @@
<parent>
<artifactId>rt.equinox.bundles</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
<version>4.10.0-SNAPSHOT</version>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>1.3.100-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
/*******************************************************************************
* Copyright (c) 2005, 2018 Cognos Incorporated, IBM Corporation and others.
* Copyright (c) 2005, 2019 Cognos Incorporated, IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
......@@ -28,6 +28,7 @@ import org.osgi.service.cm.ConfigurationPermission;
public class ConfigurationAdminFactory implements ServiceFactory<ConfigurationAdmin>, BundleListener {
static private final Permission allConfigurationPermission = new ConfigurationPermission("*", ConfigurationPermission.CONFIGURE); //$NON-NLS-1$
static private final Permission allAttributePermission = new ConfigurationPermission("*", ConfigurationPermission.ATTRIBUTE); //$NON-NLS-1$
private final EventDispatcher eventDispatcher;
private final PluginManager pluginManager;
private final LogTracker log;
......@@ -105,6 +106,17 @@ public class ConfigurationAdminFactory implements ServiceFactory<ConfigurationAd
return true;
}
public void checkAttributePermission(String location) throws SecurityException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
if (location == null) {
sm.checkPermission(allAttributePermission);
} else {
sm.checkPermission(new ConfigurationPermission(location, ConfigurationPermission.ATTRIBUTE));
}
}
}
void log(int level, String message) {
log.log(level, message);
}
......@@ -139,7 +151,7 @@ public class ConfigurationAdminFactory implements ServiceFactory<ConfigurationAd
}
}
void modifyConfiguration(ServiceReference<?> reference, Dictionary<String, Object> properties) {
pluginManager.modifyConfiguration(reference, properties);
Dictionary<String, Object> modifyConfiguration(ServiceReference<?> reference, ConfigurationImpl config) {
return pluginManager.modifyConfiguration(reference, config);
}
}
\ No newline at end of file
/*******************************************************************************
* Copyright (c) 2005, 2018 Cognos Incorporated, IBM Corporation and others..
* Copyright (c) 2005, 2019 Cognos Incorporated, IBM Corporation and others..
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
......@@ -39,32 +39,41 @@ class ConfigurationAdminImpl implements ConfigurationAdmin {
@Override
public Configuration createFactoryConfiguration(String factoryPid) {
return internalGetConfiguration(factoryPid, bundleLocation, true, true);
return internalGetConfiguration(factoryPid, bundleLocation, true, true, null);
}
@Override
public Configuration createFactoryConfiguration(String factoryPid, String location) {
return internalGetConfiguration(factoryPid, location, true, false);
return internalGetConfiguration(factoryPid, location, true, false, null);
}
@Override
public Configuration getConfiguration(String pid) {
return internalGetConfiguration(pid, bundleLocation, false, true);
return internalGetConfiguration(pid, bundleLocation, false, true, null);
}
@Override
public Configuration getConfiguration(String pid, String location) {
return internalGetConfiguration(pid, location, false, false);
return internalGetConfiguration(pid, location, false, false, null);
}
@Override
public Configuration getFactoryConfiguration(String factoryPid, String name) {
return internalGetConfiguration(factoryPid, bundleLocation, true, true, name);
}
@Override
public Configuration getFactoryConfiguration(String factoryPid, String name, String location) {
return internalGetConfiguration(factoryPid, location, true, false, name);
}
private Configuration internalGetConfiguration(String pid, String location, boolean factory, boolean bind) {
private Configuration internalGetConfiguration(String pid, String location, boolean factory, boolean bind, String name) {
checkPID(pid);
this.configurationAdminFactory.checkConfigurePermission(location, bundleLocation);
ConfigurationImpl config;
if (factory) {
config = configurationStore.createFactoryConfiguration(pid, location, bind);
config = configurationStore.getFactoryConfiguration(pid, location, bind, name);
} else {
config = configurationStore.getConfiguration(pid, location, bind);
}
......
......@@ -146,8 +146,8 @@ public class ConfigurationDictionary extends Dictionary<String, Object> implemen
Object copyOfArray = Array.newInstance(value.getClass().getComponentType(), arrayLength);
System.arraycopy(value, 0, copyOfArray, 0, arrayLength);
result.configurationProperties.put(key, copyOfArray);
} else if (value instanceof Vector)
result.configurationProperties.put(key, ((Vector<?>) value).clone());
} else if (value instanceof Collection)
result.configurationProperties.put(key, new ArrayList<>((Collection<?>) value));
else
result.configurationProperties.put(key, value);
}
......
/*******************************************************************************
* Copyright (c) 2005, 2018 Cognos Incorporated, IBM Corporation and others.
* Copyright (c) 2005, 2019 Cognos Incorporated, IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
......@@ -177,8 +177,18 @@ class ConfigurationStore {
return config;
}
public synchronized ConfigurationImpl createFactoryConfiguration(String factoryPid, String location, boolean bind) {
String pid = factoryPid + "-" + new Date().getTime() + "-" + createdPidCount++; //$NON-NLS-1$ //$NON-NLS-2$
public synchronized ConfigurationImpl getFactoryConfiguration(String factoryPid, String location, boolean bind, String name) {
String pid;
if (name == null) {
pid = factoryPid + "-" + new Date().getTime() + "-" + createdPidCount++; //$NON-NLS-1$ //$NON-NLS-2$
} else {
pid = factoryPid + "~" + name; //$NON-NLS-1$
ConfigurationImpl config = configurations.get(pid);
if (config != null) {
return config;
}
}
ConfigurationImpl config = new ConfigurationImpl(configurationAdminFactory, this, factoryPid, pid, location, bind);
configurations.put(pid, config);
return config;
......
......@@ -74,8 +74,7 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory,
ManagedServiceFactory serviceFactory = getService(ref);
if (hasLocPermission && serviceFactory != null) {
if (isMultiple || config.bind(ConfigurationAdminImpl.getLocation(ref.getBundle()))) {
Dictionary<String, Object> properties = config.getProperties();
configurationAdminFactory.modifyConfiguration(ref, properties);
Dictionary<String, Object> properties = configurationAdminFactory.modifyConfiguration(ref, config);
asynchUpdated(serviceFactory, config.getPid(), properties);
}
}
......@@ -120,8 +119,7 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory,
if (delete) {
asynchDeleted(serviceFactory, config.getPid());
} else if (update) {
Dictionary<String, Object> properties = config.getProperties();
configurationAdminFactory.modifyConfiguration(ref, properties);
Dictionary<String, Object> properties = configurationAdminFactory.modifyConfiguration(ref, config);
asynchUpdated(serviceFactory, config.getPid(), properties);
}
// do not break on !isMultiple since we need to check if the other refs apply no matter what
......@@ -218,8 +216,7 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory,
boolean hasLocPermission = configurationAdminFactory.checkTargetPermission(location, reference);
if (hasLocPermission) {
if (shouldBind && configs[i].bind(ConfigurationAdminImpl.getLocation(reference.getBundle())) || !shouldBind) {
Dictionary<String, Object> properties = configs[i].getProperties();
configurationAdminFactory.modifyConfiguration(reference, properties);
Dictionary<String, Object> properties = configurationAdminFactory.modifyConfiguration(reference, configs[i]);
asynchUpdated(serviceFactory, configs[i].getPid(), properties);
foundConfig = true;
} else {
......