Skip to content

Commit

Permalink
Merge pull request #94 from timja/remove-commons-lang3
Browse files Browse the repository at this point in the history
Remove commons-lang3
  • Loading branch information
dwnusbaum authored Apr 13, 2020
2 parents 18e2cbe + 149591e commit c27ef48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@
<artifactId>ivy</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
Expand Down
18 changes: 5 additions & 13 deletions src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URI;
Expand All @@ -60,9 +59,8 @@
import javax.annotation.Nonnull;
import javax.inject.Inject;
import jenkins.model.Jenkins;
import org.apache.commons.lang3.reflect.ConstructorUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
import org.codehaus.groovy.control.MultipleCompilationErrorsException;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.AbstractWhitelist;
import org.jenkinsci.plugins.workflow.cps.CpsCompilationErrorsException;
import org.jenkinsci.plugins.workflow.cps.CpsFlowExecution;
Expand Down Expand Up @@ -265,16 +263,10 @@ public static final class LoadedClasses extends GroovyObjectSupport implements S
@Override public Object invokeMethod(String name, Object _args) {
Class<?> c = loadClass(prefix + clazz);
Object[] args = _args instanceof Object[] ? (Object[]) _args : new Object[] {_args}; // TODO why does Groovy not just pass an Object[] to begin with?!
try {
if (name.equals("new")) {
return ConstructorUtils.invokeConstructor(c, args);
} else {
return MethodUtils.invokeStaticMethod(c, name, args);
}
} catch (InvocationTargetException x) {
throw new GroovyRuntimeException(x.getCause());
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException x) {
throw new GroovyRuntimeException(x);
if (name.equals("new")) {
return InvokerHelper.invokeConstructorOf(c, args);
} else {
return InvokerHelper.invokeStaticMethod(c, name, args);
}
}

Expand Down

0 comments on commit c27ef48

Please sign in to comment.