Browse Source

bugfix:

List "PREDEFINED" was not write-protected and started gathering values where it shouldnt

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
feature/brute_force_protection
Stephan Richter 2 months ago
parent
commit
b117014c26
  1. 2
      core/src/main/java/de/srsoftware/umbrella/core/model/Project.java
  2. 2
      core/src/main/java/de/srsoftware/umbrella/core/model/Status.java

2
core/src/main/java/de/srsoftware/umbrella/core/model/Project.java

@ -31,7 +31,7 @@ public class Project implements Mappable { @@ -31,7 +31,7 @@ public class Project implements Mappable {
this.companyId = companyId;
this.showClosed = showClosed;
this.members = members;
this.allowedStates = allowedStates;
this.allowedStates = new ArrayList<>(allowedStates);
}
public Collection<Status> allowedStates(){

2
core/src/main/java/de/srsoftware/umbrella/core/model/Status.java

@ -17,7 +17,7 @@ public record Status(String name, int code) implements Mappable { @@ -17,7 +17,7 @@ public record Status(String name, int code) implements Mappable {
public static final Status STARTED = new Status("STARTED",40); // was 20
public static final Status COMPLETE = new Status("COMPLETE",60);
public static final Status CANCELLED = new Status("CANCELLED", 100);
public static final List<Status> PREDEFINED = new ArrayList<>(List.of(OPEN, STARTED, PENDING, COMPLETE, CANCELLED));
public static final List<Status> PREDEFINED = List.of(OPEN, STARTED, PENDING, COMPLETE, CANCELLED);
public static Status of(int code){
return switch (code){

Loading…
Cancel
Save