Skip to content

Commit cbd1eeb

Browse files
authored
Merge pull request #575 from jenkinsci/dependabot/maven/org.jvnet.hudson.plugins-analysis-pom-10.2.0
Bump org.jvnet.hudson.plugins:analysis-pom from 8.6.0 to 10.2.0
2 parents c11a16f + f52e26b commit cbd1eeb

File tree

70 files changed

+584
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+584
-554
lines changed

pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.jvnet.hudson.plugins</groupId>
77
<artifactId>analysis-pom</artifactId>
8-
<version>8.6.0</version>
8+
<version>10.2.0</version>
99
<relativePath />
1010
</parent>
1111

@@ -18,17 +18,6 @@
1818
<description>Defines an API for Jenkins to mine and analyze data from a source code repository.</description>
1919
<url>https://github.com/jenkinsci/forensics-api-plugin</url>
2020

21-
<properties>
22-
<revision>2.8.0</revision>
23-
<changelist>-SNAPSHOT</changelist>
24-
25-
<module.name>${project.groupId}.forensics.api</module.name>
26-
27-
<!-- Library Dependencies Versions -->
28-
<testcontainers.version>1.20.4</testcontainers.version>
29-
30-
</properties>
31-
3221
<licenses>
3322
<license>
3423
<name>MIT license</name>
@@ -51,6 +40,17 @@
5140
<tag>${scmTag}</tag>
5241
</scm>
5342

43+
<properties>
44+
<revision>2.8.0</revision>
45+
<changelist>-SNAPSHOT</changelist>
46+
47+
<module.name>${project.groupId}.forensics.api</module.name>
48+
49+
<!-- Library Dependencies Versions -->
50+
<testcontainers.version>1.20.4</testcontainers.version>
51+
52+
</properties>
53+
5454
<dependencies>
5555

5656
<dependency>

src/main/java/io/jenkins/plugins/forensics/blame/Blamer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package io.jenkins.plugins.forensics.blame;
22

3-
import java.io.Serializable;
4-
53
import edu.hm.hafner.util.FilteredLog;
64

5+
import java.io.Serial;
6+
import java.io.Serializable;
7+
78
/**
89
* Obtains SCM blame information for several file locations.
910
*
1011
* @author Lukas Krose
1112
*/
1213
public abstract class Blamer implements Serializable {
14+
@Serial
1315
private static final long serialVersionUID = 1980235877389921937L;
1416

1517
/**
@@ -28,6 +30,7 @@ public abstract class Blamer implements Serializable {
2830
* A blamer that does nothing.
2931
*/
3032
public static class NullBlamer extends Blamer {
33+
@Serial
3134
private static final long serialVersionUID = 6235885974889709821L;
3235

3336
@Override

src/main/java/io/jenkins/plugins/forensics/blame/BlamerFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.jenkins.plugins.forensics.blame;
22

3+
import edu.hm.hafner.util.FilteredLog;
4+
35
import java.util.Collection;
46
import java.util.List;
57
import java.util.Optional;
68

7-
import edu.hm.hafner.util.FilteredLog;
8-
99
import hudson.ExtensionPoint;
1010
import hudson.FilePath;
1111
import hudson.model.Run;
@@ -106,7 +106,7 @@ private static Blamer createNullBlamer(final FilteredLog logger) {
106106

107107
private static Optional<Blamer> findBlamer(final Run<?, ?> run, final FilePath workTree,
108108
final TaskListener listener, final FilteredLog logger) {
109-
SCM scm = new ScmResolver().getScm(run);
109+
var scm = new ScmResolver().getScm(run);
110110

111111
return findAllExtensions().stream()
112112
.map(blamerFactory -> blamerFactory.createBlamer(scm, run, workTree, listener, logger))

src/main/java/io/jenkins/plugins/forensics/blame/Blames.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.jenkins.plugins.forensics.blame;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import java.util.HashMap;
56
import java.util.HashSet;
@@ -15,6 +16,7 @@
1516
* @author Ullrich Hafner
1617
*/
1718
public class Blames implements Serializable {
19+
@Serial
1820
private static final long serialVersionUID = 7L; // release 0.7
1921

2022
private final Map<String, FileBlame> blamesPerFile = new HashMap<>();
@@ -37,7 +39,7 @@ public void add(final FileBlame additionalBlame) {
3739
*/
3840
public void addAll(final Blames other) {
3941
for (String otherFile : other.getFiles()) {
40-
FileBlame otherRequest = other.getBlame(otherFile);
42+
var otherRequest = other.getBlame(otherFile);
4143
merge(otherFile, otherRequest);
4244
}
4345
}
@@ -104,7 +106,7 @@ public FileBlame getBlame(final String fileName) {
104106
if (blamesPerFile.containsKey(fileName)) {
105107
return blamesPerFile.get(fileName);
106108
}
107-
throw new NoSuchElementException(String.format("No blame information for file '%s' stored", fileName));
109+
throw new NoSuchElementException("No blame information for file '%s' stored".formatted(fileName));
108110
}
109111

110112
@Override
@@ -115,7 +117,7 @@ public boolean equals(final Object o) {
115117
if (o == null || getClass() != o.getClass()) {
116118
return false;
117119
}
118-
Blames blames = (Blames) o;
120+
var blames = (Blames) o;
119121
return blamesPerFile.equals(blames.blamesPerFile);
120122
}
121123

src/main/java/io/jenkins/plugins/forensics/blame/FileBlame.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package io.jenkins.plugins.forensics.blame;
22

3+
import edu.hm.hafner.util.PathUtil;
4+
import edu.hm.hafner.util.TreeString;
5+
import edu.hm.hafner.util.TreeStringBuilder;
6+
import edu.umd.cs.findbugs.annotations.CheckForNull;
7+
import edu.umd.cs.findbugs.annotations.NonNull;
8+
9+
import java.io.Serial;
310
import java.io.Serializable;
411
import java.util.HashMap;
512
import java.util.HashSet;
@@ -8,19 +15,14 @@
815
import java.util.Objects;
916
import java.util.Set;
1017

11-
import edu.hm.hafner.util.PathUtil;
12-
import edu.hm.hafner.util.TreeString;
13-
import edu.hm.hafner.util.TreeStringBuilder;
14-
import edu.umd.cs.findbugs.annotations.CheckForNull;
15-
import edu.umd.cs.findbugs.annotations.NonNull;
16-
1718
/**
1819
* Stores the repository blames for several lines of a single file. File names are stored using the absolute path of the
1920
* file.
2021
*
2122
* @author Ullrich Hafner
2223
*/
23-
public class FileBlame implements Iterable<Integer>, Serializable {
24+
public final class FileBlame implements Iterable<Integer>, Serializable {
25+
@Serial
2426
private static final long serialVersionUID = 7L; // release 0.7
2527

2628
static final String EMPTY = "-";
@@ -45,14 +47,16 @@ private FileBlame(final TreeString fileName) {
4547
*
4648
* @return this
4749
*/
48-
protected Object readResolve() {
50+
@Serial
51+
@SuppressWarnings("DataFlowIssue")
52+
private Object readResolve() {
4953
if (timeByLine == null) {
5054
timeByLine = new HashMap<>();
5155
}
5256
if (blamesByLine == null) {
5357
blamesByLine = new HashMap<>();
5458
for (Integer line : lines) {
55-
LineBlame lineBlame = new LineBlame();
59+
var lineBlame = new LineBlame();
5660
lineBlame.setName(nameByLine.get(line));
5761
lineBlame.setEmail(emailByLine.get(line));
5862
lineBlame.setCommit(commitByLine.get(line));
@@ -204,7 +208,7 @@ public void merge(final FileBlame other) {
204208
}
205209
else {
206210
throw new IllegalArgumentException(
207-
String.format("File names must match! This instance: %s, other instance: %s",
211+
"File names must match! This instance: %s, other instance: %s".formatted(
208212
getFileName(), other.getFileName()));
209213
}
210214
}
@@ -222,7 +226,7 @@ public boolean equals(final Object o) {
222226
if (o == null || getClass() != o.getClass()) {
223227
return false;
224228
}
225-
FileBlame integers = (FileBlame) o;
229+
var integers = (FileBlame) o;
226230
return fileName.equals(integers.fileName) && Objects.equals(blamesByLine, integers.blamesByLine);
227231
}
228232

@@ -233,6 +237,7 @@ public int hashCode() {
233237

234238
@SuppressWarnings("PMD.DataClass")
235239
private static class LineBlame implements Serializable {
240+
@Serial
236241
private static final long serialVersionUID = 7L; // release 0.7
237242
private String name = EMPTY;
238243
private String email = EMPTY;
@@ -279,7 +284,7 @@ public boolean equals(final Object o) {
279284
if (o == null || getClass() != o.getClass()) {
280285
return false;
281286
}
282-
LineBlame lineBlame = (LineBlame) o;
287+
var lineBlame = (LineBlame) o;
283288
return addedAt == lineBlame.addedAt
284289
&& name.equals(lineBlame.name)
285290
&& email.equals(lineBlame.email)

src/main/java/io/jenkins/plugins/forensics/blame/FileLocations.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.jenkins.plugins.forensics.blame;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import java.util.Collections;
56
import java.util.HashMap;
@@ -16,6 +17,7 @@
1617
* @author Ullrich Hafner
1718
*/
1819
public class FileLocations implements Serializable {
20+
@Serial
1921
private static final long serialVersionUID = 8063580789984061223L;
2022

2123
private final Map<String, Set<Integer>> linesPerFile = new HashMap<>();
@@ -101,7 +103,7 @@ public Set<Integer> getLines(final String fileName) {
101103
if (containsFile(fileName)) {
102104
return Collections.unmodifiableSet(linesPerFile.get(fileName));
103105
}
104-
throw new NoSuchElementException(String.format("No information for file '%s' stored", fileName));
106+
throw new NoSuchElementException("No information for file '%s' stored".formatted(fileName));
105107
}
106108

107109
@Override
@@ -112,7 +114,7 @@ public boolean equals(final Object o) {
112114
if (o == null || getClass() != o.getClass()) {
113115
return false;
114116
}
115-
FileLocations that = (FileLocations) o;
117+
var that = (FileLocations) o;
116118
return linesPerFile.equals(that.linesPerFile);
117119
}
118120

src/main/java/io/jenkins/plugins/forensics/delta/Change.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.jenkins.plugins.forensics.delta;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import java.util.Objects;
56

@@ -16,6 +17,7 @@
1617
*/
1718
@SuppressWarnings("PMD.DataClass")
1819
public class Change implements Serializable {
20+
@Serial
1921
private static final long serialVersionUID = 1543635877389921937L;
2022

2123
private final ChangeEditType changeEditType;
@@ -89,7 +91,7 @@ public boolean equals(final Object o) {
8991
if (o == null || getClass() != o.getClass()) {
9092
return false;
9193
}
92-
Change change = (Change) o;
94+
var change = (Change) o;
9395
return changedFromLine == change.changedFromLine && changedToLine == change.changedToLine
9496
&& fromLine == change.fromLine && toLine == change.toLine && changeEditType == change.changeEditType;
9597
}

src/main/java/io/jenkins/plugins/forensics/delta/Delta.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.jenkins.plugins.forensics.delta;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import java.util.HashMap;
56
import java.util.Map;
@@ -13,6 +14,7 @@
1314
*/
1415
@SuppressWarnings("PMD.DataClass")
1516
public class Delta implements Serializable {
17+
@Serial
1618
private static final long serialVersionUID = 5641235877389921937L;
1719

1820
static final String ERROR_MESSAGE_UNKNOWN_FILE = "No information about changes for the file with the ID '%s' stored";
@@ -66,7 +68,7 @@ public FileChanges getFileChangesById(final String fileId) {
6668
if (fileChangesMap.containsKey(fileId)) {
6769
return fileChangesMap.get(fileId);
6870
}
69-
throw new NoSuchElementException(String.format(ERROR_MESSAGE_UNKNOWN_FILE, fileId));
71+
throw new NoSuchElementException(ERROR_MESSAGE_UNKNOWN_FILE.formatted(fileId));
7072
}
7173

7274
/**
@@ -92,7 +94,7 @@ public boolean equals(final Object o) {
9294
if (o == null || getClass() != o.getClass()) {
9395
return false;
9496
}
95-
Delta delta = (Delta) o;
97+
var delta = (Delta) o;
9698
return Objects.equals(currentCommit, delta.currentCommit)
9799
&& Objects.equals(referenceCommit, delta.referenceCommit)
98100
&& Objects.equals(fileChangesMap, delta.fileChangesMap);

src/main/java/io/jenkins/plugins/forensics/delta/DeltaCalculator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package io.jenkins.plugins.forensics.delta;
22

3-
import java.io.Serializable;
4-
import java.util.Optional;
5-
63
import org.apache.commons.lang3.StringUtils;
74

85
import edu.hm.hafner.util.FilteredLog;
96

7+
import java.io.Serial;
8+
import java.io.Serializable;
9+
import java.util.Optional;
10+
1011
import hudson.model.Run;
1112

1213
/**
@@ -15,6 +16,7 @@
1516
* @author Florian Orendi
1617
*/
1718
public abstract class DeltaCalculator implements Serializable {
19+
@Serial
1820
private static final long serialVersionUID = 8641535877389921937L;
1921

2022
/**
@@ -57,6 +59,7 @@ public abstract Optional<Delta> calculateDelta(Run<?, ?> build, Run<?, ?> refere
5759
* A delta calculator that does nothing.
5860
*/
5961
public static class NullDeltaCalculator extends DeltaCalculator {
62+
@Serial
6063
private static final long serialVersionUID = 1564285974889709821L;
6164

6265
@Override

src/main/java/io/jenkins/plugins/forensics/delta/DeltaCalculatorFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.jenkins.plugins.forensics.delta;
22

3+
import edu.hm.hafner.util.FilteredLog;
4+
35
import java.util.Collection;
46
import java.util.List;
57
import java.util.Optional;
68

7-
import edu.hm.hafner.util.FilteredLog;
8-
99
import hudson.ExtensionPoint;
1010
import hudson.FilePath;
1111
import hudson.model.Run;
@@ -96,7 +96,7 @@ public static DeltaCalculator findDeltaCalculator(final String scm, final Run<?,
9696
*/
9797
private static Optional<DeltaCalculator> findDeltaCalculator(final Run<?, ?> run, final FilePath workTree,
9898
final TaskListener listener, final FilteredLog logger) {
99-
SCM scm = new ScmResolver().getScm(run);
99+
var scm = new ScmResolver().getScm(run);
100100
return findAllDeltaCalculatorFactoryInstances().stream()
101101
.map(deltaCalculatorFactory -> deltaCalculatorFactory.createDeltaCalculator(scm, run, workTree,
102102
listener, logger))

0 commit comments

Comments
 (0)