From 84e248c23f2204e30c1cac43214601b033510e9c Mon Sep 17 00:00:00 2001 From: joelmoniz Date: Sat, 26 Jul 2014 13:17:20 +0400 Subject: [PATCH] A few final changes to Last Updated --- .../app/contrib/AvailableContribution.java | 23 +++++++++++++++---- .../app/contrib/LocalContribution.java | 6 +++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/src/processing/app/contrib/AvailableContribution.java b/app/src/processing/app/contrib/AvailableContribution.java index 639cbe9db..44ed86888 100644 --- a/app/src/processing/app/contrib/AvailableContribution.java +++ b/app/src/processing/app/contrib/AvailableContribution.java @@ -1,4 +1,4 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org @@ -242,16 +242,29 @@ class AvailableContribution extends Contribution { version = Integer.parseInt(properties.get("version")); } catch (NumberFormatException e) { version = getVersion(); - System.err.println("The version number for the “" + name - + "” library is not set properly."); + System.err.println("The version number for the “" + name + + "” contribution is not set properly."); System.err - .println("Please contact the library author to fix it according to the guidelines."); + .println("Please contact the author to fix it according to the guidelines."); } String prettyVersion = properties.get("prettyVersion"); if (prettyVersion == null || prettyVersion.isEmpty()) prettyVersion = getPrettyVersion(); + long lastUpdated; + try { + lastUpdated = Long.parseLong(properties.get("lastUpdated")); + } + catch (NumberFormatException nfe) { + lastUpdated = getLastUpdated(); + // Better comment these out till all contribs have a lastUpdated +// System.err.println("The last updated date for the “" + name +// + "” contribution is not set properly."); +// System.err +// .println("Please contact the author to fix it according to the guidelines."); + } + if (propFile.delete() && propFile.createNewFile() && propFile.setWritable(true)) { PrintWriter writer = PApplet.createWriter(propFile); @@ -263,7 +276,7 @@ class AvailableContribution extends Contribution { writer.println("paragraph=" + paragraph); writer.println("version=" + version); writer.println("prettyVersion=" + prettyVersion); - writer.println("lastUpdated=" + getLastUpdated()); + writer.println("lastUpdated=" + lastUpdated); writer.flush(); writer.close(); diff --git a/app/src/processing/app/contrib/LocalContribution.java b/app/src/processing/app/contrib/LocalContribution.java index 7b485cde4..57ac2ffc9 100644 --- a/app/src/processing/app/contrib/LocalContribution.java +++ b/app/src/processing/app/contrib/LocalContribution.java @@ -78,8 +78,10 @@ public abstract class LocalContribution extends Contribution { lastUpdated = Long.parseLong(properties.get("lastUpdated")); } catch (NumberFormatException e) { lastUpdated = 0; - System.err.println("The last updated timestamp for the “" + name + "” library is not set properly."); - System.err.println("Please contact the library author to fix it according to the guidelines."); + + // Better comment these out till all contribs have a lastUpdated +// System.err.println("The last updated timestamp for the “" + name + "” library is not set properly."); +// System.err.println("Please contact the library author to fix it according to the guidelines."); } } else {