diff options
Diffstat (limited to 'bundles/org.eclipse.osgi.util/src/org/osgi')
5 files changed, 17 insertions, 17 deletions
diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/DeferredPromiseImpl.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/DeferredPromiseImpl.java index dcd40c58a..3969a37c6 100644 --- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/DeferredPromiseImpl.java +++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/DeferredPromiseImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2014, 2018). All Rights Reserved. + * Copyright (c) OSGi Alliance (2014, 2021). 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. @@ -141,12 +141,12 @@ final class DeferredPromiseImpl<T> extends PromiseImpl<T> { Result<T> collect() { // ensure latch open before reading state if (!isDone()) { - return new Result<T>(new AssertionError("promise not resolved")); + return new Result<>(new AssertionError("promise not resolved")); } if (fail == null) { - return new Result<T>(value); + return new Result<>(value); } - return new Result<T>(fail); + return new Result<>(fail); } @Override diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/FailedPromiseImpl.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/FailedPromiseImpl.java index dd5b6094d..9bec4b56c 100644 --- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/FailedPromiseImpl.java +++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/FailedPromiseImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2017). All Rights Reserved. + * Copyright (c) OSGi Alliance (2017, 2021). 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. @@ -81,7 +81,7 @@ final class FailedPromiseImpl<T> extends PromiseImpl<T> { */ @Override Result<T> collect() { - return new Result<T>(fail); + return new Result<>(fail); } @Override diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseImpl.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseImpl.java index 299222bcf..b8c475de1 100644 --- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseImpl.java +++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2014, 2018). All Rights Reserved. + * Copyright (c) OSGi Alliance (2014, 2021). 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. @@ -392,17 +392,17 @@ abstract class PromiseImpl<T> implements Promise<T> { return impl.collect(); } if (!promise.isDone()) { - return new Result<R>(new AssertionError("promise not resolved")); + return new Result<>(new AssertionError("promise not resolved")); } final boolean interrupted = Thread.interrupted(); try { Throwable fail = promise.getFailure(); if (fail == null) { - return new Result<R>(promise.getValue()); + return new Result<>(promise.getValue()); } - return new Result<R>(fail); + return new Result<>(fail); } catch (Throwable e) { - return new Result<R>(e); // propagate new exception + return new Result<>(e); // propagate new exception } finally { if (interrupted) { // restore interrupt status Thread.currentThread().interrupt(); diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/ResolvedPromiseImpl.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/ResolvedPromiseImpl.java index e5fa47a9a..70fbc3f39 100644 --- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/ResolvedPromiseImpl.java +++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/ResolvedPromiseImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2017). All Rights Reserved. + * Copyright (c) OSGi Alliance (2017, 2021). 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. @@ -78,7 +78,7 @@ final class ResolvedPromiseImpl<T> extends PromiseImpl<T> { */ @Override Result<T> collect() { - return new Result<T>(value); + return new Result<>(value); } @Override diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/xml/XMLParserActivator.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/xml/XMLParserActivator.java index a7e84c4ac..cad340e74 100644 --- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/xml/XMLParserActivator.java +++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/xml/XMLParserActivator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2002, 2017). All Rights Reserved. + * Copyright (c) OSGi Alliance (2002, 2021). 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. @@ -191,7 +191,7 @@ public class XMLParserActivator implements BundleActivator, ServiceFactory<Objec if (parserUrl == null) { return Collections.emptyList(); } - List<String> v = new ArrayList<String>(1); + List<String> v = new ArrayList<>(1); String parserFactoryClassName = null; InputStream is = parserUrl.openStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); @@ -234,7 +234,7 @@ public class XMLParserActivator implements BundleActivator, ServiceFactory<Objec // this class will operate as a service factory and give each // service requestor it's own SaxParserFactory SAXParserFactory factory = (SAXParserFactory) getFactory(parserFactoryClassName); - Hashtable<String, Object> properties = new Hashtable<String, Object>(7); + Hashtable<String, Object> properties = new Hashtable<>(7); // figure out the default properties of the parser setDefaultSAXProperties(factory, properties, index); // store the parser factory class name in the properties so that @@ -333,7 +333,7 @@ public class XMLParserActivator implements BundleActivator, ServiceFactory<Objec // this class will operate as a service factory and give each // service requestor it's own DocumentBuilderFactory DocumentBuilderFactory factory = (DocumentBuilderFactory) getFactory(parserFactoryClassName); - Hashtable<String, Object> properties = new Hashtable<String, Object>(7); + Hashtable<String, Object> properties = new Hashtable<>(7); // figure out the default properties of the parser setDefaultDOMProperties(factory, properties, index); // store the parser factory class name in the properties so that |