Skip to content

Commit 4df7988

Browse files
chore: bump spotbugs 4.10.2.0 and related fixes (#3458)
* chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.8.3 to 4.10.2.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.9.8.3...spotbugs-maven-plugin-4.10.2.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.10.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * bump: 4.10.2.0 and related fixes Signed-off-by: Attila Mészáros <a_meszaros@apple.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Attila Mészáros <a_meszaros@apple.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent f1237ba commit 4df7988

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

migration/src/main/java/io/javaoperatorsdk/operator/migration/RemoveMethodDeclaration.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ public J.ClassDeclaration visitClassDeclaration(
5959
J.ClassDeclaration classDecl, ExecutionContext ctx) {
6060
J.ClassDeclaration cd = super.visitClassDeclaration(classDecl, ctx);
6161

62-
if (cd.getType() == null || !typeMatchesOrImplements(cd.getType())) {
62+
JavaType.FullyQualified type = cd.getType();
63+
if (type == null || !typeMatchesOrImplements(type)) {
6364
return cd;
6465
}
6566

6667
// Mutate the type info in place to remove the method from the declared methods list,
6768
// so all AST nodes sharing this type reference stay consistent.
68-
var type = cd.getType();
6969
if (type instanceof JavaType.Class classType) {
7070
var updatedMethods =
7171
classType.getMethods().stream().filter(m -> !m.getName().equals(methodName)).toList();
@@ -90,11 +90,16 @@ public J.MethodDeclaration visitMethodDeclaration(
9090
}
9191

9292
J.ClassDeclaration classDecl = getCursor().firstEnclosing(J.ClassDeclaration.class);
93-
if (classDecl == null || classDecl.getType() == null) {
93+
if (classDecl == null) {
9494
return super.visitMethodDeclaration(method, ctx);
9595
}
9696

97-
if (typeMatchesOrImplements(classDecl.getType())) {
97+
JavaType.FullyQualified type = classDecl.getType();
98+
if (type == null) {
99+
return super.visitMethodDeclaration(method, ctx);
100+
}
101+
102+
if (typeMatchesOrImplements(type)) {
98103
//noinspection DataFlowIssue
99104
return null;
100105
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<git-commit-id-maven-plugin.version>10.0.0</git-commit-id-maven-plugin.version>
104104
<jib-maven-plugin.version>3.5.1</jib-maven-plugin.version>
105105
<spotless.version>3.8.0</spotless.version>
106-
<spotbugs-maven-plugin.version>4.9.8.3</spotbugs-maven-plugin.version>
106+
<spotbugs-maven-plugin.version>4.10.2.0</spotbugs-maven-plugin.version>
107107
</properties>
108108

109109
<dependencyManagement>

0 commit comments

Comments
 (0)