Skip to content

Commit

Permalink
Merge pull request jenkinsci#35 from kinow/fix-JENKINS-61243
Browse files Browse the repository at this point in the history
[JENKINS-61243]: log (fine) if failed to add a parameter definition in Utils class, but don't blow exception; keep working on other params and eval the parameter definition
  • Loading branch information
kinow authored May 16, 2020
2 parents 4e19144 + ce0a8a9 commit dc6c3f6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ via [@tupilabs](https://twitter.com/tupilabs)
2. [JENKINS-61751](https://issues.jenkins-ci.org/browse/JENKINS-61751): let :disabled and :deleted at the same (thanks to @ivarmu)
3. [JENKINS-62317](https://issues.jenkins-ci.org/browse/JENKINS-62317): Upgrade dependencies pre 2.3 release (Jenkins LTS 2.204 now, Java 8, script-security 1.72, antisamy-markup-formatter 2.0, no more powermockito in tests, fixing spot bugs issues)
4. [JENKINS-39742](https://issues.jenkins-ci.org/browse/JENKINS-39742): Active Choice Plugin should honor ParameterDefinition serializability (was: Active Choice Plugin in Pipelines throw NotSerializableException)
5. [JENKINS-61243](https://issues.jenkins-ci.org/browse/JENKINS-61243): Artifactory plugin to fail active-choice plugin
##### Version 2.2 (2019/09/13)
Expand Down
22 changes: 21 additions & 1 deletion src/main/java/org/biouno/unochoice/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -71,6 +73,8 @@
*/
public class Utils {

protected static final Logger LOGGER = Logger.getLogger(Utils.class.getName());

private Utils() {}

/**
Expand Down Expand Up @@ -313,10 +317,26 @@ private static boolean isParameterDefinitionOf(@Nonnull String parameterUUID, @N
try {
propertyDescriptors = Introspector.getBeanInfo(buildWrapper.getClass()).getPropertyDescriptors();
} catch (IntrospectionException e) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
String.format("Introspector.getBeanInfo failed for build wrapper class: [%s]",
buildWrapper.getClass()
.getCanonicalName()),
e);
}
continue;
}
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
addParameterDefinitionsTo(value, buildWrapper, propertyDescriptor);
try {
addParameterDefinitionsTo(value, buildWrapper, propertyDescriptor);
} catch (RuntimeException e) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
String.format("Failed to add parameter [%s] to the ParameterDefinition list",
propertyDescriptor.getName()),
e);
}
}
}
if (!value.isEmpty()) {
result.put(buildWrapper, value);
Expand Down

0 comments on commit dc6c3f6

Please sign in to comment.