Skip to content

Commit b0f5737

Browse files
Exclude static fields from the builder required ones (#3933)
Co-authored-by: aws-sdk-java-automation <[email protected]>
1 parent 24b79b3 commit b0f5737

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"contributor": "sugmanue",
4+
"type": "bugfix",
5+
"description": "Exclude static fields from the required fields validation done by the ToBuilderIsCorrect class"
6+
}

build-tools/src/main/java/software/amazon/awssdk/buildtools/findbugs/ToBuilderIsCorrect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public boolean shouldVisit(JavaClass obj) {
190190

191191
@Override
192192
public void visit(Field obj) {
193-
if (isBuilder) {
193+
if (isBuilder && !obj.isStatic()) {
194194
builderFields.computeIfAbsent(getDottedClassName(), c -> new ArrayList<>()).add(obj.getName());
195195
}
196196
}

0 commit comments

Comments
 (0)