Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2020-08-10 07:47:05 +0000
committerAlexander Kurtakov2020-08-10 07:47:25 +0000
commit41a375dc75c68ea0ec68aa0b3df3b1f80ec375ec (patch)
tree70ea905df1668b0d5095f6edc364154deadd7c5b
parente10a5967b8c196d706f3d708b1e7803bfef5afa2 (diff)
downloadrt.equinox.bundles-41a375dc75c68ea0ec68aa0b3df3b1f80ec375ec.tar.gz
rt.equinox.bundles-41a375dc75c68ea0ec68aa0b3df3b1f80ec375ec.tar.xz
rt.equinox.bundles-41a375dc75c68ea0ec68aa0b3df3b1f80ec375ec.zip
Bug 565934 - Move equinox.device to Java 8
Bump the BREE. Fix some warnings and silence the rest in the maven build - still visible in the workbench. Change-Id: Ieaaa2a92499102ffbdec908d85497928b5b662aa Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.device/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.device/.settings/org.eclipse.jdt.core.prefs42
-rw-r--r--bundles/org.eclipse.equinox.device/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.device/pom.xml5
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java22
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java6
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java36
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/SecureAction.java9
8 files changed, 68 insertions, 59 deletions
diff --git a/bundles/org.eclipse.equinox.device/.classpath b/bundles/org.eclipse.equinox.device/.classpath
index c2ce266a6..eca7bdba8 100644
--- a/bundles/org.eclipse.equinox.device/.classpath
+++ b/bundles/org.eclipse.equinox.device/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.device/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.device/.settings/org.eclipse.jdt.core.prefs
index 40015b838..995ca622e 100644
--- a/bundles/org.eclipse.equinox.device/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.device/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Wed Feb 27 09:54:36 CST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,24 +6,24 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -71,23 +70,28 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -157,11 +161,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -191,6 +196,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -214,12 +221,16 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -265,6 +276,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -300,8 +313,11 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -324,6 +340,10 @@ org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.device/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.device/META-INF/MANIFEST.MF
index 5b6e643e8..68ea16da3 100644
--- a/bundles/org.eclipse.equinox.device/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.device/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
-Bundle-Version: 1.0.900.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.equinox.device.Activator
Bundle-SymbolicName: org.eclipse.equinox.device
Bundle-Vendor: %bundleVendor
@@ -12,6 +12,5 @@ Import-Package: org.osgi.framework;version="1.2",
org.osgi.util.tracker,
org.eclipse.osgi.util
Export-Package: org.eclipse.equinox.device; x-internal:=true
-Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
- J2SE-1.3
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.equinox.device
diff --git a/bundles/org.eclipse.equinox.device/pom.xml b/bundles/org.eclipse.equinox.device/pom.xml
index bbf650730..a66d2929a 100644
--- a/bundles/org.eclipse.equinox.device/pom.xml
+++ b/bundles/org.eclipse.equinox.device/pom.xml
@@ -19,6 +19,9 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.device</artifactId>
- <version>1.0.900-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
+ <properties>
+ <code.ignoredWarnings>-warn:-deprecation,raw,unchecked,discouraged,warningToken</code.ignoredWarnings>
+ </properties>
</project>
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
index 4bf3b4bab..f4ea3c279 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
@@ -39,7 +39,7 @@ public class DeviceTracker extends ServiceTracker {
protected LogTracker log;
/** Device services properties */
- protected Dictionary properties;
+ protected Dictionary<String, ?> properties;
/** if false the algorithm must terminate */
protected volatile boolean running;
@@ -264,12 +264,12 @@ public class DeviceTracker extends ServiceTracker {
* Readonly Dictionary for device properties.
*
*/
- static class Properties extends Hashtable {
+ static class Properties extends Hashtable<String, Object> {
private static final long serialVersionUID = -8489170394007899809L;
/**
* keys in original case.
*/
- protected Vector keys;
+ protected Vector<String> keys;
/**
* Create a properties object for the service.
@@ -284,7 +284,7 @@ public class DeviceTracker extends ServiceTracker {
if (props != null) {
int size = props.length;
- keys = new Vector(size);
+ keys = new Vector<>(size);
for (int i = 0; i < size; i++) {
String key = props[i];
@@ -297,14 +297,14 @@ public class DeviceTracker extends ServiceTracker {
}
}
} else {
- keys = new Vector(0);
+ keys = new Vector<>(0);
}
}
/**
* Override keys to support case-preserving of keys.
*/
- public Enumeration keys() {
+ public Enumeration<String> keys() {
return (keys.elements());
}
@@ -313,12 +313,8 @@ public class DeviceTracker extends ServiceTracker {
*
* @param key header name.
*/
- public Object get(Object key) {
- if (key instanceof String) {
- return (super.get(((String) key).toLowerCase()));
- }
-
- return (null);
+ public Object get(String key) {
+ return (super.get(key.toLowerCase()));
}
/**
@@ -328,7 +324,7 @@ public class DeviceTracker extends ServiceTracker {
* @param value header value.
* @throws UnsupportedOperationException
*/
- public Object put(Object key, Object value) {
+ public Object put(String key, Object value) {
throw new UnsupportedOperationException();
}
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
index f98c219b9..0951c3502 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
@@ -36,7 +36,7 @@ public class DriverLocatorTracker extends ServiceTracker {
protected LogTracker log;
/** List of bundles to be uninstalled. */
- protected Vector bundles;
+ protected Vector<Bundle> bundles;
/**
* Create the DriverLocatorTracker.
@@ -49,7 +49,7 @@ public class DriverLocatorTracker extends ServiceTracker {
this.manager = manager;
log = manager.log;
- bundles = new Vector(10, 10);
+ bundles = new Vector<>(10, 10);
if (Activator.DEBUG) {
log.log(LogService.LOG_DEBUG, "DriverLocatorTracker constructor"); //$NON-NLS-1$
@@ -119,7 +119,7 @@ public class DriverLocatorTracker extends ServiceTracker {
* @param locators Array of DriverLocator objects
* @param drivers Dictionary of drivers with key=DRIVER_ID, value=Driver object
*/
- public void loadDrivers(Dictionary properties, DriverTracker drivers) {
+ public void loadDrivers(Dictionary<String, ?> properties, DriverTracker drivers) {
if (Activator.DEBUG) {
log.log(LogService.LOG_DEBUG, Thread.currentThread().getName() + ": DriverLocatorTracker loadDrivers called"); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
index 0f050be02..b56ca7a62 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
@@ -36,18 +36,18 @@ public class DriverTracker extends ServiceTracker {
protected LogTracker log;
/** Dictionary mapping DRIVER_ID strings <==> Driver ServiceReferences */
- protected Hashtable drivers;
+ protected Hashtable<Object, Object> drivers;
/** DeviceManager object. */
protected Activator manager;
/** Dictionary mapping Driver ID String =>
* Hashtable (Device ServiceReference => cached Match objects) */
- protected Hashtable matches;
+ protected Hashtable<String, Hashtable<ServiceReference, Match>> matches;
/** Dictionary mapping Driver ID String =>
* Hashtable (Device ServiceReference => cached referral String) */
- protected Hashtable referrals;
+ protected Hashtable<String, Hashtable<ServiceReference, String>> referrals;
/**
* Create the DriverTracker.
@@ -61,9 +61,9 @@ public class DriverTracker extends ServiceTracker {
this.manager = manager;
log = manager.log;
- drivers = new Hashtable(37);
- matches = new Hashtable(37);
- referrals = new Hashtable(37);
+ drivers = new Hashtable<>(37);
+ matches = new Hashtable<>(37);
+ referrals = new Hashtable<>(37);
if (Activator.DEBUG) {
log.log(LogService.LOG_DEBUG, this + " constructor"); //$NON-NLS-1$
@@ -210,11 +210,7 @@ public class DriverTracker extends ServiceTracker {
if (driver_id == null) {
log.log(reference, LogService.LOG_WARNING, DeviceMsg.Driver_service_has_no_DRIVER_ID);
- driver_id = (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return reference.getBundle().getLocation();
- }
- });
+ driver_id = AccessController.doPrivileged((PrivilegedAction<String>) () -> reference.getBundle().getLocation());
}
return (driver_id);
@@ -245,7 +241,7 @@ public class DriverTracker extends ServiceTracker {
if (references != null) {
int size = references.length;
- Vector successfulMatches = new Vector(size);
+ Vector<Match> successfulMatches = new Vector<>(size);
for (int i = 0; i < size; i++) {
ServiceReference driver = references[i];
@@ -309,22 +305,22 @@ public class DriverTracker extends ServiceTracker {
public Match getMatch(ServiceReference driver, ServiceReference device) {
String driverid = getDriverID(driver);
- Hashtable driverMatches = (Hashtable) matches.get(driverid);
+ Hashtable<ServiceReference, Match> driverMatches = matches.get(driverid);
if (driverMatches == null) {
return null;
}
- return (Match) driverMatches.get(device);
+ return driverMatches.get(device);
}
public void storeMatch(ServiceReference driver, ServiceReference device, Match match) {
String driverid = getDriverID(driver);
- Hashtable driverMatches = (Hashtable) matches.get(driverid);
+ Hashtable<ServiceReference, Match> driverMatches = matches.get(driverid);
if (driverMatches == null) {
- driverMatches = new Hashtable(37);
+ driverMatches = new Hashtable<>(37);
matches.put(driverid, driverMatches);
}
@@ -388,22 +384,22 @@ public class DriverTracker extends ServiceTracker {
public String getReferral(ServiceReference driver, ServiceReference device) {
String driverid = getDriverID(driver);
- Hashtable driverReferrals = (Hashtable) referrals.get(driverid);
+ Hashtable<ServiceReference, String> driverReferrals = referrals.get(driverid);
if (driverReferrals == null) {
return null;
}
- return (String) driverReferrals.get(device);
+ return driverReferrals.get(device);
}
public void storeReferral(ServiceReference driver, ServiceReference device, String referral) {
String driverid = getDriverID(driver);
- Hashtable driverReferrals = (Hashtable) referrals.get(driverid);
+ Hashtable<ServiceReference, String> driverReferrals = referrals.get(driverid);
if (driverReferrals == null) {
- driverReferrals = new Hashtable(37);
+ driverReferrals = new Hashtable<>(37);
referrals.put(driverid, driverReferrals);
}
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/SecureAction.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/SecureAction.java
index c27c376f5..105f256cf 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/SecureAction.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/SecureAction.java
@@ -42,12 +42,7 @@ public class SecureAction {
public Thread createThread(final Runnable target, final String name) {
if (System.getSecurityManager() == null)
return new Thread(target, name);
- return (Thread) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Thread(target, name);
- }
- }, controlContext);
+ return AccessController.doPrivileged((PrivilegedAction<Thread>) () -> new Thread(target, name), controlContext);
}
-
-
+
}

Back to the top