From 9df67b64a7ed314a3d3b3f9501af18d9db04e6c7 Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Wed, 13 Sep 2023 01:33:46 +0200 Subject: [PATCH] Extract more parameters --- .../pipeline_steps_doc_generator/ToAsciiDoc.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java b/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java index b9a8d1f..d53b8c4 100644 --- a/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java +++ b/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java @@ -75,7 +75,7 @@ public ToAsciiDoc(HyperLocalPluginManager pluginManager) { .getByPlugin().entrySet()) { ExtensionList descriptors = ExtensionList.lookup(Descriptor.class); for (Descriptor d: descriptors) { - if (d.getClass().getName() == entry.getKey()) { + if (entry.getKey().equals(d.getClass().getName())) { map.put(d.clazz.getName(), entry.getValue()); } } @@ -403,7 +403,7 @@ public String generatePluginHelp( Map> byPlugin, boolean isDeprecated, boolean genHeader) { - Main.isUnitTest = true; + setUnitTest(); // TODO: if condition StringBuilder whole9yards = new StringBuilder(); @@ -427,9 +427,13 @@ public String generatePluginHelp( return whole9yards.toString(); } + private static void setUnitTest() { + Main.isUnitTest = true; + } + public String generateDirectiveHelp( String directiveName, Map> descsByPlugin, boolean genHeader) { - Main.isUnitTest = true; + setUnitTest(); StringBuilder whole9yards = new StringBuilder(); if (genHeader) { whole9yards.append(generateHeader(directiveName));