Skip to content

Commit

Permalink
Use the DescribableModel.of method to avoid extra object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
svanoort committed Apr 11, 2018
1 parent 5778fc9 commit bf26059
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -136,7 +136,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.7</version>
<version>1.14</version>
</dependency>
</dependencies>
</project>
Expand Up @@ -292,9 +292,9 @@ public boolean isUnmodifiedArguments() {
StepDescriptor d = ((StepNode) n).getDescriptor();
if (d != null) {
try {
return resolve(new DescribableModel<>(d.clazz), args).getArguments();
return resolve(DescribableModel.of(d.clazz), args).getArguments();
} catch (Exception x) { // all sorts of things could go wrong here
LOGGER.log(Level.FINE, "coult not resolve " + args + " for " + d.clazz.getName(), x);
LOGGER.log(Level.FINE, "could not resolve " + args + " for " + d.clazz.getName(), x);
// TODO this does not handle NotStoredReason’s well
// more robust to recursively traverse the tree and use e.g. DescribableModel.resolveClass to populate details
// (without actually attempting to instantiate any of the classes)
Expand Down

0 comments on commit bf26059

Please sign in to comment.