Skip to content

Commit

Permalink
CLDR-17612 cla: record CLDR version with CLA
Browse files Browse the repository at this point in the history
- also, fix date serialization issue in UserSettings (Gson setting issue) for the signed date
  • Loading branch information
srl295 committed Dec 9, 2024
1 parent 092a7ec commit 3815f86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public final class ClaSignature {
public String employer; // May be different than org!
public boolean corporate; // signed as corporate

@Schema(required = false, description = "Version of CLDR signed in, or * for n/a")
public String version; // which CLDR version was it signed in?

@Schema(required = false)
public Date signed;

Expand Down Expand Up @@ -59,6 +62,7 @@ public ClaSignature(Organization o) {
this.corporate = true;
this.signed = new Date(0);
this.readonly = true;
this.version = "*";
}

public ClaSignature(String string) {
Expand All @@ -68,5 +72,6 @@ public ClaSignature(String string) {
this.corporate = true;
this.signed = new Date(0);
this.readonly = true;
this.version = "*";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import org.apache.commons.codec.digest.DigestUtils;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.json.JSONException;
Expand Down Expand Up @@ -568,6 +576,7 @@ public void signCla(ClaSignature cla) {
}
if (!cla.valid()) throw new IllegalArgumentException("Invalid CLA");
cla.signed = new Date();
cla.version = SurveyMain.getNewVersion();
settings().setJson(ClaSignature.CLA_KEY, cla);
claSigned = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package org.unicode.cldr.web;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public abstract class UserSettings implements Comparable<UserSettings> {
/**
Expand Down Expand Up @@ -92,7 +93,7 @@ public boolean persistent() {
}

public void setJson(String name, Object o) {
final Gson gson = new Gson();
final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();
set(name, gson.toJson(o));
}

Expand Down

0 comments on commit 3815f86

Please sign in to comment.