Skip to content

Commit cc9f467

Browse files
committed
Logging improvement
1 parent 46879d3 commit cc9f467

File tree

1 file changed

+3
-3
lines changed
  • pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition

1 file changed

+3
-3
lines changed

pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/Upgrade.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@
108108
}
109109

110110
private static boolean isOld(FlowExecutionOwner owner) throws Exception {
111-
var rootDir = owner.getRootDir();
112111
var factory = SAXParserFactory.newDefaultInstance();
113112
// TODO XMLUtils does not support SAX parsing:
114113
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
115114
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
116115
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
117116
var parser = factory.newSAXParser();
118117
var old = new AtomicBoolean();
119-
parser.parse(new File(rootDir, "build.xml"), new DefaultHandler() {
118+
var buildXml = new File(owner.getRootDir(), "build.xml");
119+
parser.parse(buildXml, new DefaultHandler() {
120120
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
121121
var plugin = attributes.getValue("plugin");
122122
if (plugin != null) {
123123
int at = plugin.indexOf('@');
124124
if (at != -1 && plugin.substring(0, at).equals("pipeline-model-definition")) {
125125
var version = new VersionNumber(plugin.substring(at + 1));
126-
LOGGER.fine(() -> "got " + version + " off " + qName);
126+
LOGGER.fine(() -> "got " + version + " off " + qName + " in " + buildXml);
127127
if (version.isOlderThan(new VersionNumber("2.2234"))) {
128128
old.set(true);
129129
}

0 commit comments

Comments
 (0)