Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: component field visibility public #13

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

@Replicate
public class DisplayComponent implements Component<DisplayComponent> {
private Vector3i monitorSize = new Vector3i();
private Side front;
private String mode;
private List<String> data = Lists.newArrayList();
public Vector3i monitorSize = new Vector3i();
public Side front;
public String mode;
public List<String> data = Lists.newArrayList();

Check warning on line 19 in src/main/java/org/terasology/computer/display/component/DisplayComponent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

PA_PUBLIC_PRIMITIVE_ATTRIBUTE

LOW: Primitive field org.terasology.computer.display.component.DisplayComponent.data is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility.
Raw output
no message found

public DisplayComponent() {
}

public DisplayComponent(Vector3ic monitorSize, Side front, String mode, List<String> data) {
this.monitorSize.set(monitorSize);
this.front = front;

Check warning on line 26 in src/main/java/org/terasology/computer/display/component/DisplayComponent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

PA_PUBLIC_PRIMITIVE_ATTRIBUTE

LOW: Primitive field org.terasology.computer.display.component.DisplayComponent.front is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility.
Raw output
no message found
this.mode = mode;

Check warning on line 27 in src/main/java/org/terasology/computer/display/component/DisplayComponent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

PA_PUBLIC_PRIMITIVE_ATTRIBUTE

LOW: Primitive field org.terasology.computer.display.component.DisplayComponent.mode is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility.
Raw output
no message found
this.data.addAll(data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
import java.util.List;

public class DisplayDataHolderComponent implements Component<DisplayDataHolderComponent> {
private Vector3i monitorSize = new Vector3i();
private Side front;
private String mode;
private List<String> data = Lists.newArrayList();
public Vector3i monitorSize = new Vector3i();
public Side front;
public String mode;
public List<String> data = Lists.newArrayList();

public DisplayDataHolderComponent() {
}

public DisplayDataHolderComponent(Vector3ic monitorSize, Side front, String mode, List<String> data) {
this.monitorSize.set(monitorSize);
this.front = front;

Check warning on line 24 in src/main/java/org/terasology/computer/display/component/DisplayDataHolderComponent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

PA_PUBLIC_PRIMITIVE_ATTRIBUTE

LOW: Primitive field org.terasology.computer.display.component.DisplayDataHolderComponent.front is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility.
Raw output
no message found
this.mode = mode;

Check warning on line 25 in src/main/java/org/terasology/computer/display/component/DisplayDataHolderComponent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

PA_PUBLIC_PRIMITIVE_ATTRIBUTE

LOW: Primitive field org.terasology.computer.display.component.DisplayDataHolderComponent.mode is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility.
Raw output
no message found
this.data.addAll(data);
}

Expand Down