Skip to content

Commit

Permalink
Remove superfluous assignments in clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
bwRavencl committed Oct 11, 2024
1 parent 8af0822 commit eba03aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 1 addition & 3 deletions src/main/java/de/bwravencl/controllerbuddy/input/Mode.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public final class Mode implements Cloneable {

private UUID uuid;
private final UUID uuid;
private String description;
private Map<Integer, List<IAction<Float>>> axisToActionsMap = new HashMap<>();
private Map<Integer, List<IAction<Byte>>> buttonToActionsMap = new HashMap<>();
Expand Down Expand Up @@ -65,8 +65,6 @@ private static <V extends Number> Map<Integer, List<IAction<V>>> cloneActionMap(
@Override
public Object clone() throws CloneNotSupportedException {
final var mode = (Mode) super.clone();
mode.uuid = uuid;
mode.setDescription(description);

mode.axisToActionsMap = cloneActionMap(axisToActionsMap);
mode.buttonToActionsMap = cloneActionMap(buttonToActionsMap);
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/de/bwravencl/controllerbuddy/input/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ public final class Profile implements Cloneable {
public Object clone() throws CloneNotSupportedException {
final var profile = (Profile) super.clone();

profile.setVersion(version);
profile.setShowOverlay(showOverlay);
profile.setShowVrOverlay(showVrOverlay);
profile.setKeyRepeatInterval(keyRepeatInterval);

final var clonedButtonToModeActionsMap = new HashMap<Integer, List<ButtonToModeAction>>();
for (final var entry : buttonToModeActionsMap.entrySet()) {
final var buttonToModeActions = new ArrayList<ButtonToModeAction>();
Expand Down

0 comments on commit eba03aa

Please sign in to comment.