Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi.services/src/org/osgi/service')
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Driver.java6
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverLocator.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverSelector.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Match.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/package-info.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/device/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventConstants.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventProperties.java14
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/event/TopicPermission.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/log/LogEntry.java8
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java16
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java15
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/ProvisioningService.java6
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/package-info.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPAction.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPDevice.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPEventListener.java2
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPException.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPStateVariable.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/package-info.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/Role.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/User.java4
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminEvent.java8
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminPermission.java35
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/package-info.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/packageinfo1
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/BasicEnvelope.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/Wire.java6
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdmin.java6
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdminEvent.java8
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WirePermission.java35
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/package-info.java5
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/packageinfo1
37 files changed, 147 insertions, 99 deletions
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Driver.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Driver.java
index db46dfadf..d15f3a264 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Driver.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Driver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ public interface Driver {
* @throws java.lang.Exception if this Driver service cannot examine the
* Device service
*/
- public int match(ServiceReference reference) throws Exception;
+ public int match(ServiceReference<?> reference) throws Exception;
/**
* Attaches this Driver service to the Device service represented by the
@@ -104,5 +104,5 @@ public interface Driver {
* @throws java.lang.Exception if the driver cannot attach to the given
* device and does not know of a more suitable driver
*/
- public String attach(ServiceReference reference) throws Exception;
+ public String attach(ServiceReference<?> reference) throws Exception;
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverLocator.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverLocator.java
index fdbe1a5d8..78eb7d03b 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverLocator.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverLocator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public interface DriverLocator {
* {@code null} if this Driver Locator service does not know of any
* such drivers
*/
- public String[] findDrivers(Dictionary props);
+ public String[] findDrivers(Dictionary<String, ?> props);
/**
* Get an {@code InputStream} from which the driver bundle providing a
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverSelector.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverSelector.java
index 179ecc7fc..41d24b1bc 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverSelector.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/DriverSelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,5 +50,5 @@ public interface DriverSelector {
* @return index into the array of {@code Match} objects, or
* {@code SELECT_NONE} if no Driver service should be attached
*/
- public int select(ServiceReference reference, Match[] matches);
+ public int select(ServiceReference<?> reference, Match[] matches);
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Match.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Match.java
index d16251848..e1218a1e2 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Match.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/Match.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public interface Match {
*
* @return {@code ServiceReference} object to a Driver service.
*/
- public ServiceReference getDriver();
+ public ServiceReference<?> getDriver();
/**
* Return the match value of this object.
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/package-info.java
index 92de050fb..78617d061 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,10 @@
* <p>
* {@code Import-Package: org.osgi.service.device; version="[1.1,1.2)"}
*
- * @version 1.1
* @author $Id$
*/
+@Version("1.1")
package org.osgi.service.device;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/packageinfo
deleted file mode 100644
index 3987f9c4e..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/device/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.1
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventConstants.java
index d002775d3..b9345200f 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventConstants.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2005, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2005, 2014). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,7 +237,7 @@ public interface EventConstants {
* This constant was released with an incorrectly spelled name. It has been
* replaced by {@link #EXCEPTION_CLASS}
*
- * @deprecated As of 1.1, replaced by EXCEPTION_CLASS
+ * @deprecated As of 1.1. Replaced by {@link #EXCEPTION_CLASS}.
*/
public static final String EXECPTION_CLASS = "exception.class";
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventProperties.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventProperties.java
index 548895a00..1ecc2e9ea 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventProperties.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/EventProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -109,6 +109,7 @@ public class EventProperties implements Map<String, Object> {
*
* @throws UnsupportedOperationException if called.
*/
+ @Override
public void clear() {
properties.clear();
}
@@ -119,6 +120,7 @@ public class EventProperties implements Map<String, Object> {
* @param name The property name.
* @return {@code true} If the property is present, {@code false} otherwise.
*/
+ @Override
public boolean containsKey(Object name) {
return properties.containsKey(name);
}
@@ -129,6 +131,7 @@ public class EventProperties implements Map<String, Object> {
* @param value The property value.
* @return {@code true} If the value is present, {@code false} otherwise.
*/
+ @Override
public boolean containsValue(Object value) {
return properties.containsValue(value);
}
@@ -138,6 +141,7 @@ public class EventProperties implements Map<String, Object> {
*
* @return A set containing the property name/value pairs.
*/
+ @Override
public Set<java.util.Map.Entry<String, Object>> entrySet() {
return properties.entrySet();
}
@@ -148,6 +152,7 @@ public class EventProperties implements Map<String, Object> {
* @param name The name of the specified property.
* @return The value of the specified property.
*/
+ @Override
public Object get(Object name) {
return properties.get(name);
}
@@ -158,6 +163,7 @@ public class EventProperties implements Map<String, Object> {
* @return {@code true} If this properties is empty, {@code false}
* otherwise.
*/
+ @Override
public boolean isEmpty() {
return properties.isEmpty();
}
@@ -167,6 +173,7 @@ public class EventProperties implements Map<String, Object> {
*
* @return The names of the properties.
*/
+ @Override
public Set<String> keySet() {
return properties.keySet();
}
@@ -176,6 +183,7 @@ public class EventProperties implements Map<String, Object> {
*
* @throws UnsupportedOperationException if called.
*/
+ @Override
public Object put(String key, Object value) {
return properties.put(key, value);
}
@@ -185,6 +193,7 @@ public class EventProperties implements Map<String, Object> {
*
* @throws UnsupportedOperationException if called.
*/
+ @Override
public void putAll(Map<? extends String, ? extends Object> map) {
properties.putAll(map);
}
@@ -194,6 +203,7 @@ public class EventProperties implements Map<String, Object> {
*
* @throws UnsupportedOperationException if called.
*/
+ @Override
public Object remove(Object key) {
return properties.remove(key);
}
@@ -203,6 +213,7 @@ public class EventProperties implements Map<String, Object> {
*
* @return The number of properties.
*/
+ @Override
public int size() {
return properties.size();
}
@@ -212,6 +223,7 @@ public class EventProperties implements Map<String, Object> {
*
* @return The values of the properties.
*/
+ @Override
public Collection<Object> values() {
return properties.values();
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/TopicPermission.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/TopicPermission.java
index dbe0829e7..a315cdc5c 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/TopicPermission.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/TopicPermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2005, 2015). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2005, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -289,7 +289,7 @@ public final class TopicPermission extends Permission {
public String getActions() {
String result = actions;
if (result == null) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
boolean comma = false;
int mask = getActionsMask();
if ((mask & ACTION_PUBLISH) == ACTION_PUBLISH) {
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo
deleted file mode 100644
index 6435862fd..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/event/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.3.1
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/LogEntry.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/LogEntry.java
index 6b3ee59f7..9dca75876 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/LogEntry.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/LogEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2016). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2017). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,11 +68,11 @@ public interface LogEntry {
int getLevel();
/**
- * Returns the human readable message associated with this {@code LogEntry}
+ * Returns the formatted message associated with this {@code LogEntry}
* object.
*
- * @return {@code String} containing the message associated with this
- * {@code LogEntry} object.
+ * @return {@code String} containing the formatted message associated with
+ * this {@code LogEntry} object.
*/
String getMessage();
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java
index 3a507c14a..c5c96a364 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2005, 2015). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2005, 2017). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,17 +55,27 @@ public interface MetaTypeService {
/**
* Capability name for meta type document processors.
- *
* <p>
* Used in {@code Provide-Capability} and {@code Require-Capability}
* manifest headers with the {@code osgi.extender} namespace. For example:
*
* <pre>
* Require-Capability: osgi.extender;
- * filter:="(&amp;(osgi.extender=osgi.metatype)(version&gt;=1.3)(!(version&gt;=2.0)))"
+ * filter:="(&amp;(osgi.extender=osgi.metatype)(version&gt;=1.4)(!(version&gt;=2.0)))"
* </pre>
*
* @since 1.3
*/
public static final String METATYPE_CAPABILITY_NAME = "osgi.metatype";
+
+ /**
+ * Compile time constant for the Specification Version of MetaType Service.
+ * <p>
+ * Used in {@code Version} and {@code Requirement} annotations. The value of
+ * this compile time constant will change when the specification version of
+ * MetaType Service is updated.
+ *
+ * @since 1.4
+ */
+ public static final String METATYPE_SPECIFICATION_VERSION = "1.4.0";
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java
index ca1a06007..c55119ecb 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2017). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,28 +15,27 @@
*/
/**
- * Metatype Package Version 1.3.
- *
+ * Metatype Package Version 1.4.
* <p>
* Bundles wishing to use this package must list the package in the
* Import-Package header of the bundle's manifest. This package has two types of
* users: the consumers that use the API in this package and the providers that
* implement the API in this package.
- *
* <p>
* Example import for consumers using the API in this package:
* <p>
- * {@code Import-Package: org.osgi.service.metatype; version="[1.3,2.0)"}
+ * {@code Import-Package: org.osgi.service.metatype; version="[1.4,2.0)"}
* <p>
* Example import for providers implementing the API in this package:
* <p>
- * {@code Import-Package: org.osgi.service.metatype; version="[1.3,1.4)"}
+ * {@code Import-Package: org.osgi.service.metatype; version="[1.4,1.5)"}
*
* @author $Id$
*/
-@Version("1.3")
+@Version(METATYPE_SPECIFICATION_VERSION)
package org.osgi.service.metatype;
-import org.osgi.annotation.versioning.Version;
+import static org.osgi.service.metatype.MetaTypeService.METATYPE_SPECIFICATION_VERSION;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo
deleted file mode 100644
index 0117a56c1..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.3
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/ProvisioningService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/ProvisioningService.java
index 475106113..7fb7e78e0 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/ProvisioningService.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/ProvisioningService.java
@@ -166,7 +166,7 @@ public interface ProvisioningService {
*
* @return A reference to the Provisioning Dictionary.
*/
- public Dictionary getInformation();
+ public Dictionary<String, Object> getInformation();
/**
* Replaces the Provisioning Information dictionary with the key/value pairs
@@ -178,7 +178,7 @@ public interface ProvisioningService {
* keys are values that are of an invalid type will be silently
* ignored.
*/
- public void setInformation(Dictionary info);
+ public void setInformation(Dictionary<String, ?> info);
/**
* Adds the key/value pairs contained in {@code info} to the Provisioning
@@ -189,7 +189,7 @@ public interface ProvisioningService {
* the Provisioning Information dictionary. Any keys are values that
* are of an invalid type will be silently ignored.
*/
- public void addInformation(Dictionary info);
+ public void addInformation(Dictionary<String, ?> info);
/**
* Processes the {@code ZipInputStream} and extracts information to add to
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/package-info.java
index d47e07a89..8d2cafd1a 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,10 @@
* <p>
* {@code Import-Package: org.osgi.service.provisioning; version="[1.2,1.3)"}
*
- * @version 1.2
* @author $Id$
*/
+@Version("1.2")
package org.osgi.service.provisioning;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/packageinfo
deleted file mode 100644
index ef7df68cb..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/provisioning/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.2
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPAction.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPAction.java
index f1ba100ae..1dcd11587 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPAction.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -138,5 +138,5 @@ public interface UPnPAction {
*
* @see UPnPStateVariable
*/
- Dictionary invoke(Dictionary args) throws Exception;
+ Dictionary<String, Object> invoke(Dictionary<String, ?> args) throws Exception;
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPDevice.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPDevice.java
index a09c1c2f3..fe7d6d7d5 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPDevice.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPDevice.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -287,5 +287,5 @@ public interface UPnPDevice {
* Strings
*
*/
- Dictionary getDescriptions(String locale);
+ Dictionary<String, String> getDescriptions(String locale);
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPEventListener.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPEventListener.java
index 80582d96d..fab5adc95 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPEventListener.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPEventListener.java
@@ -81,5 +81,5 @@ public interface UPnPEventListener {
*
*
*/
- void notifyUPnPEvent(String deviceId, String serviceId, Dictionary events);
+ void notifyUPnPEvent(String deviceId, String serviceId, Dictionary<String, ?> events);
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPException.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPException.java
index ffd3b84b0..c37703795 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPException.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2005, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2005, 2014). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -107,7 +107,7 @@ public class UPnPException extends Exception {
*
* @return The UPnPErrorCode defined by a UPnP Forum working committee or
* specified by a UPnP vendor.
- * @deprecated As of version 1.2, replaced by {@link #getUPnPErrorCode()}
+ * @deprecated As of 1.2. Replaced by {@link #getUPnPErrorCode()}.
*/
public int getUPnPError_Code() {
return getUPnPErrorCode();
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPStateVariable.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPStateVariable.java
index 1ebafb56d..f15242294 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPStateVariable.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/UPnPStateVariable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -285,7 +285,7 @@ public interface UPnPStateVariable {
*
* @return A class object corresponding to the Java type of this argument.
*/
- Class getJavaDataType();
+ Class<?> getJavaDataType();
/**
* Returns the UPnP type of this state variable. Valid types are defined as
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/package-info.java
index 141651627..15372d222 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,10 @@
* <p>
* {@code Import-Package: org.osgi.service.upnp; version="[1.2,1.3)"}
*
- * @version 1.2
* @author $Id$
*/
+@Version("1.2")
package org.osgi.service.upnp;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/packageinfo
deleted file mode 100644
index ef7df68cb..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/upnp/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.2
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/Role.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/Role.java
index c366d5a63..aff70c8ad 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/Role.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/Role.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,5 +113,5 @@ public interface Role {
* @return {@code Dictionary} containing the properties of this {@code Role}
* object.
*/
- public Dictionary getProperties();
+ public Dictionary<String, Object> getProperties();
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/User.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/User.java
index 0520ec2dd..4a13bb52e 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/User.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/User.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public interface User extends Role {
* @return {@code Dictionary} object containing the credentials of this
* {@code User} object.
*/
- public Dictionary getCredentials();
+ public Dictionary<String, Object> getCredentials();
/**
* Checks to see if this {@code User} object has a credential with the
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminEvent.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminEvent.java
index 606618cc7..3750d209c 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminEvent.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import org.osgi.framework.ServiceReference;
* @author $Id$
*/
public class UserAdminEvent {
- private ServiceReference ref;
+ private ServiceReference<UserAdmin> ref;
private int type;
private Role role;
/**
@@ -71,7 +71,7 @@ public class UserAdminEvent {
* @param type The event type.
* @param role The {@code Role} object on which this event occurred.
*/
- public UserAdminEvent(ServiceReference ref, int type, Role role) {
+ public UserAdminEvent(ServiceReference<UserAdmin> ref, int type, Role role) {
this.ref = ref;
this.type = type;
this.role = role;
@@ -83,7 +83,7 @@ public class UserAdminEvent {
*
* @return The User Admin service's {@code ServiceReference} object.
*/
- public ServiceReference getServiceReference() {
+ public ServiceReference<UserAdmin> getServiceReference() {
return ref;
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminPermission.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminPermission.java
index 536a2ac22..b950fbd87 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminPermission.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/UserAdminPermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2001, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2001, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,11 @@ import java.io.IOException;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
/**
* Permission to configure and access the {@link Role} objects managed by a User
@@ -323,6 +326,7 @@ public final class UserAdminPermission extends BasicPermission {
* @return {@code true} if the specified permission is implied by this
* object; {@code false} otherwise.
*/
+ @Override
public boolean implies(Permission p) {
if (p instanceof UserAdminPermission) {
UserAdminPermission requested = (UserAdminPermission) p;
@@ -345,10 +349,11 @@ public final class UserAdminPermission extends BasicPermission {
*
* @return the canonical string representation of the actions.
*/
+ @Override
public String getActions() {
String result = actions;
if (result == null) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
boolean comma = false;
int mask = getActionsMask();
if ((mask & ACTION_CHANGE_CREDENTIAL) == ACTION_CHANGE_CREDENTIAL) {
@@ -378,6 +383,7 @@ public final class UserAdminPermission extends BasicPermission {
* @return a new {@code PermissionCollection} object suitable for storing
* {@code UserAdminPermission} objects.
*/
+ @Override
public PermissionCollection newPermissionCollection() {
return new UserAdminPermissionCollection();
}
@@ -393,6 +399,7 @@ public final class UserAdminPermission extends BasicPermission {
* object, and has the same name and actions as this
* {@code UserAdminPermission} object.
*/
+ @Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@@ -411,6 +418,7 @@ public final class UserAdminPermission extends BasicPermission {
*
* @return A hash code value for this object.
*/
+ @Override
public int hashCode() {
int h = 31 * 17 + getName().hashCode();
h = 31 * h + getActions().hashCode();
@@ -446,8 +454,9 @@ public final class UserAdminPermission extends BasicPermission {
* {@code UserAdminPermission} object.
* @see "org.osgi.service.permissionadmin.PermissionInfo.getEncoded()"
*/
+ @Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append('(');
sb.append(getClass().getName());
sb.append(" \"");
@@ -475,7 +484,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
* @serial
* @GuardedBy this
*/
- private final Hashtable permissions;
+ private final Hashtable<String, UserAdminPermission> permissions;
/**
* Boolean saying if "*" is in the collection.
*
@@ -488,7 +497,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
* Creates an empty {@code UserAdminPermissionCollection} object.
*/
public UserAdminPermissionCollection() {
- permissions = new Hashtable();
+ permissions = new Hashtable<>();
all_allowed = false;
}
@@ -503,6 +512,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
* @throws SecurityException If this {@code UserAdminPermissionCollection}
* object has been marked readonly
*/
+ @Override
public void add(Permission permission) {
if (!(permission instanceof UserAdminPermission))
throw new IllegalArgumentException("Invalid permission: " + permission);
@@ -512,7 +522,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
final UserAdminPermission uap = (UserAdminPermission) permission;
final String name = uap.getName();
synchronized (this) {
- final UserAdminPermission existing = (UserAdminPermission) permissions.get(name);
+ final UserAdminPermission existing = permissions.get(name);
if (existing != null) {
int oldMask = existing.getActionsMask();
int newMask = uap.getActionsMask();
@@ -539,6 +549,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
* @return true if the given permission is implied by this
* {@code PermissionCollection}, false otherwise.
*/
+ @Override
public boolean implies(Permission permission) {
if (!(permission instanceof UserAdminPermission)) {
return false;
@@ -552,7 +563,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
// Short circuit if the "*" Permission was added.
// desired can only be ACTION_NONE when name is "admin".
if (all_allowed && (desired != UserAdminPermission.ACTION_NONE)) {
- x = (UserAdminPermission) permissions.get("*");
+ x = permissions.get("*");
if (x != null) {
effective |= x.getActionsMask();
if ((effective & desired) == desired) {
@@ -564,7 +575,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
// Check for full match first. Then work our way up the
// name looking for matches on a.b.*
- x = (UserAdminPermission) permissions.get(name);
+ x = permissions.get(name);
}
if (x != null) {
// we have a direct hit!
@@ -579,7 +590,7 @@ final class UserAdminPermissionCollection extends PermissionCollection {
while ((last = name.lastIndexOf(".", offset)) != -1) {
name = name.substring(0, last + 1) + "*";
synchronized (this) {
- x = (UserAdminPermission) permissions.get(name);
+ x = permissions.get(name);
}
if (x != null) {
effective |= x.getActionsMask();
@@ -600,7 +611,9 @@ final class UserAdminPermissionCollection extends PermissionCollection {
*
* @return an enumeration of all the {@code UserAdminPermission} objects.
*/
- public Enumeration elements() {
- return permissions.elements();
+ @Override
+ public Enumeration<Permission> elements() {
+ List<Permission> all = new ArrayList<Permission>(permissions.values());
+ return Collections.enumeration(all);
}
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/package-info.java
index b79edb198..408a5172f 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,10 @@
* <p>
* {@code Import-Package: org.osgi.service.useradmin; version="[1.1,1.2)"}
*
- * @version 1.1
* @author $Id$
*/
+@Version("1.1")
package org.osgi.service.useradmin;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/packageinfo
deleted file mode 100644
index 3987f9c4e..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/useradmin/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.1
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/BasicEnvelope.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/BasicEnvelope.java
index e7f7111ce..2c6074365 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/BasicEnvelope.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/BasicEnvelope.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ public class BasicEnvelope implements Envelope {
/**
* @see org.osgi.service.wireadmin.Envelope#getValue()
*/
+ @Override
public Object getValue() {
return value;
}
@@ -52,6 +53,7 @@ public class BasicEnvelope implements Envelope {
/**
* @see org.osgi.service.wireadmin.Envelope#getIdentification()
*/
+ @Override
public Object getIdentification() {
return identification;
}
@@ -59,6 +61,7 @@ public class BasicEnvelope implements Envelope {
/**
* @see org.osgi.service.wireadmin.Envelope#getScope()
*/
+ @Override
public String getScope() {
return scope;
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/Wire.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/Wire.java
index de75c27d5..f1c12931b 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/Wire.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/Wire.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -118,7 +118,7 @@ public interface Wire {
* {@link WireConstants#WIREADMIN_CONSUMER_FLAVORS} property or the
* value of the property is not of type {@code Class[]}.
*/
- public Class[] getFlavors();
+ public Class<?>[] getFlavors();
/**
* Update the value.
@@ -216,7 +216,7 @@ public interface Wire {
* @return The properties for this {@code Wire} object. The returned
* {@code Dictionary} must be read only.
*/
- public Dictionary getProperties();
+ public Dictionary<String, Object> getProperties();
/**
* Return the calculated scope of this {@code Wire} object.
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdmin.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdmin.java
index 783de096c..47b38d0f1 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdmin.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdmin.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ public interface WireAdmin {
* @throws java.lang.IllegalArgumentException If {@code properties} contains
* invalid wire types or case variants of the same key name.
*/
- public Wire createWire(String producerPID, String consumerPID, Dictionary properties);
+ public Wire createWire(String producerPID, String consumerPID, Dictionary<String, ?> properties);
/**
* Delete a {@code Wire} object.
@@ -132,7 +132,7 @@ public interface WireAdmin {
* @throws java.lang.IllegalArgumentException If {@code properties} contains
* invalid wire types or case variants of the same key name.
*/
- public void updateWire(Wire wire, Dictionary properties);
+ public void updateWire(Wire wire, Dictionary<String, ?> properties);
/**
* Return the {@code Wire} objects that match the given {@code filter}.
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdminEvent.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdminEvent.java
index 665e72cdd..9b407189c 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdminEvent.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WireAdminEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class WireAdminEvent {
/**
* The WireAdmin service which created this event.
*/
- private final ServiceReference reference;
+ private final ServiceReference<WireAdmin> reference;
/**
* The {@code Wire} object associated with this event.
*/
@@ -205,7 +205,7 @@ public class WireAdminEvent {
* @param exception An exception associated with this event. This may be
* {@code null} if no exception is associated with this event.
*/
- public WireAdminEvent(ServiceReference reference, int type, Wire wire, Throwable exception) {
+ public WireAdminEvent(ServiceReference<WireAdmin> reference, int type, Wire wire, Throwable exception) {
this.reference = reference;
this.wire = wire;
this.type = type;
@@ -219,7 +219,7 @@ public class WireAdminEvent {
* @return The {@code ServiceReference} object for the Wire Admin service
* that created this event.
*/
- public ServiceReference getServiceReference() {
+ public ServiceReference<WireAdmin> getServiceReference() {
return reference;
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WirePermission.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WirePermission.java
index ecf1b5fa8..53e2f6000 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WirePermission.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/WirePermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2002, 2015). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2002, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,11 @@ import java.io.IOException;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
/**
* Permission for the scope of a {@code Wire} object. When a {@code Envelope}
@@ -190,6 +193,7 @@ final public class WirePermission extends BasicPermission {
* @return {@code true} if the specified permission is implied by this
* object; {@code false} otherwise.
*/
+ @Override
public boolean implies(Permission p) {
if (p instanceof WirePermission) {
WirePermission requested = (WirePermission) p;
@@ -206,10 +210,11 @@ final public class WirePermission extends BasicPermission {
*
* @return The canonical string representation of the actions.
*/
+ @Override
public String getActions() {
String result = actions;
if (result == null) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
boolean comma = false;
int mask = getActionsMask();
if ((mask & ACTION_PRODUCE) == ACTION_PRODUCE) {
@@ -233,6 +238,7 @@ final public class WirePermission extends BasicPermission {
* @return A new {@code PermissionCollection} object suitable for storing
* {@code WirePermission} objects.
*/
+ @Override
public PermissionCollection newPermissionCollection() {
return new WirePermissionCollection();
}
@@ -248,6 +254,7 @@ final public class WirePermission extends BasicPermission {
* name and actions as this {@code WirePermission} object;
* {@code false} otherwise.
*/
+ @Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@@ -264,6 +271,7 @@ final public class WirePermission extends BasicPermission {
*
* @return Hash code value for this object.
*/
+ @Override
public int hashCode() {
int h = 31 * 17 + getName().hashCode();
h = 31 * h + getActions().hashCode();
@@ -278,8 +286,9 @@ final public class WirePermission extends BasicPermission {
*
* @return information about this {@code Permission} object.
*/
+ @Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append('(');
sb.append(getClass().getName());
sb.append(" \"");
@@ -330,7 +339,7 @@ final class WirePermissionCollection extends PermissionCollection {
* @GuardedBy this
* @serial
*/
- private final Hashtable permissions;
+ private final Hashtable<String, WirePermission>permissions;
/**
* Boolean saying if "*" is in the collection.
*
@@ -344,7 +353,7 @@ final class WirePermissionCollection extends PermissionCollection {
*
*/
public WirePermissionCollection() {
- permissions = new Hashtable();
+ permissions = new Hashtable<>();
all_allowed = false;
}
@@ -359,6 +368,7 @@ final class WirePermissionCollection extends PermissionCollection {
* @throws SecurityException If this PermissionCollection has been marked
* read-only.
*/
+ @Override
public void add(Permission permission) {
if (!(permission instanceof WirePermission)) {
throw new IllegalArgumentException("invalid permission: " + permission);
@@ -369,7 +379,7 @@ final class WirePermissionCollection extends PermissionCollection {
WirePermission wp = (WirePermission) permission;
String name = wp.getName();
synchronized (this) {
- WirePermission existing = (WirePermission) permissions.get(name);
+ WirePermission existing = permissions.get(name);
if (existing != null) {
int oldMask = existing.getActionsMask();
int newMask = wp.getActionsMask();
@@ -396,6 +406,7 @@ final class WirePermissionCollection extends PermissionCollection {
* @return {@code true} if {@code permission} is a proper subset of a
* permission in the set; {@code false} otherwise.
*/
+ @Override
public boolean implies(Permission permission) {
if (!(permission instanceof WirePermission)) {
return false;
@@ -408,7 +419,7 @@ final class WirePermissionCollection extends PermissionCollection {
synchronized (this) {
// short circuit if the "*" Permission was added
if (all_allowed) {
- x = (WirePermission) permissions.get("*");
+ x = permissions.get("*");
if (x != null) {
effective |= x.getActionsMask();
if ((effective & desired) == desired)
@@ -418,7 +429,7 @@ final class WirePermissionCollection extends PermissionCollection {
// strategy:
// Check for full match first. Then work our way up the
// name looking for matches on a.b.*
- x = (WirePermission) permissions.get(name);
+ x = permissions.get(name);
}
if (x != null) {
// we have a direct hit!
@@ -433,7 +444,7 @@ final class WirePermissionCollection extends PermissionCollection {
while ((last = name.lastIndexOf(".", offset)) != -1) {
name = name.substring(0, last + 1) + "*";
synchronized (this) {
- x = (WirePermission) permissions.get(name);
+ x = permissions.get(name);
}
if (x != null) {
effective |= x.getActionsMask();
@@ -453,7 +464,9 @@ final class WirePermissionCollection extends PermissionCollection {
*
* @return Enumeration of all the Permission objects.
*/
- public Enumeration elements() {
- return permissions.elements();
+ @Override
+ public Enumeration<Permission> elements() {
+ List<Permission> all = new ArrayList<Permission>(permissions.values());
+ return Collections.enumeration(all);
}
}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/package-info.java
index b5af96bb0..6058a3d18 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2010, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,10 @@
* <p>
* {@code Import-Package: org.osgi.service.wireadmin; version="[1.0,1.1)"}
*
- * @version 1.0.1
* @author $Id$
*/
+@Version("1.0.1")
package org.osgi.service.wireadmin;
+import org.osgi.annotation.versioning.Version;
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/packageinfo
deleted file mode 100644
index b3d1f97f7..000000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/wireadmin/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.0.1

Back to the top