Unverified Commit cae38758 authored by Lukas Jungmann's avatar Lukas Jungmann Committed by GitHub
Browse files

fix cpright (#213)

Signed-off-by: default avatarLukas Jungmann <lukas.jungmann@oracle.com>
parent eb47bcb0
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
......
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
......
[//]: # " Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. "
[//]: # " Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. "
[//]: # " "
[//]: # " This program and the accompanying materials are made available under the "
[//]: # " terms of the Eclipse Distribution License v. 1.0, which is available at "
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
......@@ -243,4 +243,4 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
</plugin>
</plugins>
</build>
</project>
</project>
\ No newline at end of file
/*
* Copyright (c) 2003, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
......
/*
* Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
......@@ -48,16 +48,18 @@ class ServiceLoaderUtil {
return null;
}
static Object lookupUsingOSGiServiceLoader(String factoryId, Logger logger) {
static <T> T lookupUsingOSGiServiceLoader(String factoryId, Logger logger) {
try {
// Use reflection to avoid having any dependency on ServiceLoader class
Class<?> serviceClass = Class.forName(factoryId);
@SuppressWarnings("unchecked")
Class<? extends T> serviceClass = (Class<? extends T>) Class.forName(factoryId);
Class<?> target = Class.forName(OSGI_SERVICE_LOADER_CLASS_NAME);
Method m = target.getMethod(OSGI_SERVICE_LOADER_METHOD_NAME, Class.class);
Iterator<?> iter = ((Iterable) m.invoke(null, serviceClass)).iterator();
@SuppressWarnings("unchecked")
Iterator<? extends T> iter = ((Iterable<? extends T>) m.invoke(null, serviceClass)).iterator();
if (iter.hasNext()) {
Object next = iter.next();
T next = iter.next();
logger.log(Level.FINE, "Found implementation using OSGi facility; returning object [{0}].",
next.getClass().getName());
return next;
......@@ -67,9 +69,9 @@ class ServiceLoaderUtil {
} catch (IllegalAccessException |
InvocationTargetException |
ClassNotFoundException |
NoSuchMethodException ignored) {
NoSuchMethodException ex) {
logger.log(Level.FINE, "Unable to find from OSGi: [" + factoryId + "]", ignored);
logger.log(Level.FINE, "Unable to find from OSGi: [" + factoryId + "]", ex);
return null;
}
}
......@@ -86,9 +88,9 @@ class ServiceLoaderUtil {
} catch (IllegalAccessException |
InvocationTargetException |
ClassNotFoundException |
NoSuchMethodException ignored) {
NoSuchMethodException ex) {
logger.log(Level.FINE, ignored, () -> "Unable to find from OSGi: [" + factoryId + "]");
logger.log(Level.FINE, ex, () -> "Unable to find from OSGi: [" + factoryId + "]");
return null;
}
}
......
// Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Distribution License v. 1.0, which is available at
......
// Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Distribution License v. 1.0, which is available at
......
<!--
Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
......@@ -130,5 +130,4 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0"?>
<!--
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
......@@ -70,7 +70,7 @@
<properties>
<copyright.exclude>${config.dir}/copyright-exclude</copyright.exclude>
<copyright.ignoreyear>false</copyright.ignoreyear>
<copyright.ignoreyear>true</copyright.ignoreyear>
<copyright.scmonly>true</copyright.scmonly>
<copyright.templatefile>${config.dir}/edl-copyright.txt</copyright.templatefile>
<copyright.update>false</copyright.update>
......@@ -242,5 +242,4 @@
</modules>
</profile>
</profiles>
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment