Skip to content

Commit

Permalink
Merge pull request #1075 from virtualsatellite/feature/task_1074-VirS…
Browse files Browse the repository at this point in the history
…at_UUID_fix

Fixing repeated conversion between UUID and String
  • Loading branch information
PhilMFischer committed Mar 31, 2022
2 parents 690bec2 + 5f346d4 commit d037df1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
public class VirSatUuid {

public static final String UUID_NA = "VIRSAT-UUID-NO-UUID-YET-SET";
private UUID uuid;
private final String uuid;

/**
* COnstructor generating a random UUID
*/
public VirSatUuid() {
this.uuid = UUID.randomUUID();
this.uuid = UUID.randomUUID().toString();
}

/**
Expand All @@ -36,9 +36,9 @@ public VirSatUuid() {
*/
public VirSatUuid(String uuidString) {
if ((uuidString != null) && (!uuidString.isEmpty())) {
this.uuid = UUID.fromString(uuidString);
this.uuid = uuidString;
} else {
uuid = UUID.randomUUID();
uuid = UUID.randomUUID().toString();
}
}

Expand Down

0 comments on commit d037df1

Please sign in to comment.