track down the source of null entries in pretty version (see #4696, #4712)

This commit is contained in:
Ben Fry
2016-11-03 19:20:04 -04:00
parent 3cc680e648
commit 3e2dcd6948
4 changed files with 17 additions and 10 deletions

View File

@@ -61,10 +61,7 @@ public class AvailableContribution extends Contribution {
version = PApplet.parseInt(versionStr, 0);
}
prettyVersion = params.get("prettyVersion");
if (prettyVersion != null && prettyVersion.length() == 0) {
prettyVersion = null;
}
setPrettyVersion(params.get("prettyVersion"));
String lastUpdatedStr = params.get("lastUpdated");
if (lastUpdatedStr != null) {
@@ -337,7 +334,9 @@ public class AvailableContribution extends Contribution {
writer.println("sentence=" + sentence);
writer.println("paragraph=" + paragraph);
writer.println("version=" + version);
writer.println("prettyVersion=" + prettyVersion);
if (prettyVersion != null) {
writer.println("prettyVersion=" + prettyVersion);
}
writer.println("lastUpdated=" + lastUpdated);
writer.println("minRevision=" + minRev);
writer.println("maxRevision=" + maxRev);

View File

@@ -158,6 +158,17 @@ abstract public class Contribution {
}
public void setPrettyVersion(String pretty) {
if (pretty != null) {
// some entries were written as "null", causing that to show in the ui
if (pretty.equals("null") || pretty.length() == 0) {
pretty = null;
}
}
prettyVersion = pretty;
}
// "1.0.2" or null if not present
public String getPrettyVersion() {
return prettyVersion;

View File

@@ -86,10 +86,7 @@ public abstract class LocalContribution extends Contribution {
System.err.println("Please contact the library author to fix it according to the guidelines.");
}
prettyVersion = properties.get("prettyVersion");
if (prettyVersion != null && prettyVersion.length() == 0) {
prettyVersion = null;
}
setPrettyVersion(properties.get("prettyVersion"));
try {
lastUpdated = Long.parseLong(properties.get("lastUpdated"));

View File

@@ -7,6 +7,7 @@ o problem is because AquaButtonUI is calling getImage() (not getIcon())
o can be debugging from inside the getIconX() code in Toolkit
X just needed to use setPressedIcon(), setDisabledIcon()
X also found some other issues around the icon handling
X fix the library reporting scripts on the server
contribs
X Up-to-date status disappears after filter is removed
@@ -26,7 +27,6 @@ _ https://github.com/processing/processing/issues/4705
_ could provide script to un-quarrantine
_ xattr -d -r com.apple.quarantine
_ fix the library reporting scripts on the server
_ sharing usage metrics about libraries
_ https://github.com/processing/processing/issues/4708