diff --git a/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/JobCollector.java b/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/JobCollector.java index f72f6db..63e5de1 100644 --- a/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/JobCollector.java +++ b/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/JobCollector.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; @@ -48,7 +49,7 @@ public Map getJobsPerPlugin() } } } catch(Exception e){ - LOGGER.warning("Exception caught: " + e ); + LOGGER.log(Level.WARNING, "Exception caught: " + e , e); } } @@ -68,9 +69,9 @@ public Map getJobsPerPlugin() addItem(item, plugin); } } catch(Exception e){ - LOGGER.warning("Exception caught in job " + item.getFullName() + ": " + e ); + LOGGER.log(Level.WARNING, "Exception caught in job " + item.getFullName() + ": " + e , e); } catch (Throwable e){ - LOGGER.severe("Exception caught in job " + item.getFullName() + ": " + e ); + LOGGER.log(Level.SEVERE,"Exception caught in job " + item.getFullName() + ": " + e, e); } } } diff --git a/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/PipelineLastBuildAnalyzer.java b/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/PipelineLastBuildAnalyzer.java index 604e1a2..3e660bc 100644 --- a/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/PipelineLastBuildAnalyzer.java +++ b/src/main/java/org/jenkinsci/plugins/pluginusage/analyzer/PipelineLastBuildAnalyzer.java @@ -98,7 +98,9 @@ private void coreStepProcess(Set plugins, FlowNode f) { if (describable != null) { final Descriptor descriptor = SymbolLookup.get() .findDescriptor(Describable.class, describable.getSymbol()); - plugins.add(getPluginFromClass(descriptor.clazz)); + if (descriptor != null){ + plugins.add(getPluginFromClass(descriptor.clazz)); + } } } }