mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 12:02:20 +00:00
Remove pre Java 7 reflection's based invocations
Simplify the code now the minimum version is Java 7.
This commit is contained in:
1 parent
b17e04c9dc
commit
99c43c8ccd
6 files changed
+49
-150
No files matched your search
@@ -59,6 +59,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -206,17 +207,8 @@ public class ClassicPluginStrategy implements PluginStrategy {
|
||||
if (libs != null)
|
||||
paths.addAll(Arrays.asList(libs));
|
||||
|
||||
try {
|
||||
Class pathJDK7 = Class.forName("java.nio.file.Path");
|
||||
Object toPath = File.class.getMethod("toPath").invoke(expandDir);
|
||||
URI uri = (URI) pathJDK7.getMethod("toUri").invoke(toPath);
|
||||
baseResourceURL = expandDir.toPath().toUri().toURL();
|
||||
|
||||
baseResourceURL = uri.toURL();
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
||||
throw new Error(e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
baseResourceURL = expandDir.toURI().toURL();
|
||||
}
|
||||
}
|
||||
File disableFile = new File(archive.getPath() + ".disabled");
|
||||
if (disableFile.exists()) {
|
||||
|
||||
Reference in new issue
Block a user