From 8c755989381ba1e936b4a7359621df3b3d5e5c06 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sat, 8 Feb 2025 22:19:05 -0500 Subject: [PATCH] Define method parameters and use node instead of def --- .../codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy index 5a8daca7..06453dcd 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2005-2024 the original author or authors. + * Copyright 2005-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -383,7 +383,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { if (outputFile.exists()) { - def xml = new XmlParser().parse(outputFile) + Node xml = new XmlParser().parse(outputFile) def bugs = xml.BugInstance int bugCount = bugs.size() @@ -452,7 +452,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { !sourceFiles.isEmpty() } - private void printBugs(total, bugs) { + private void printBugs(int total, def bugs) { for (i in 0..total - 1) { def bug = bugs[i] log.error(bug.LongMessage.text() + SpotBugsInfo.BLANK + bug.SourceLine.'@classname' + SpotBugsInfo.BLANK + bug.SourceLine.Message.text() + SpotBugsInfo.BLANK + bug.'@type')