aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authoraclement <aclement>2006-08-25 13:05:32 +0000
committeraclement <aclement>2006-08-25 13:05:32 +0000
commit475afa91a3222f6839e7f087760415cc9bb76c98 (patch)
tree9df5f4a20d0c521738482a16d03cc0f227a71abd /build
parent40cf61076994bf2dd6f0397b1bd0287ed546a75b (diff)
downloadaspectj-475afa91a3222f6839e7f087760415cc9bb76c98.tar.gz
aspectj-475afa91a3222f6839e7f087760415cc9bb76c98.zip
includes refactoring that is in real Version.java
Diffstat (limited to 'build')
-rw-r--r--build/lib/BridgeVersion.java.txt27
1 files changed, 15 insertions, 12 deletions
diff --git a/build/lib/BridgeVersion.java.txt b/build/lib/BridgeVersion.java.txt
index 132e027ae..36c1e0df4 100644
--- a/build/lib/BridgeVersion.java.txt
+++ b/build/lib/BridgeVersion.java.txt
@@ -43,22 +43,25 @@ public class Version {
* time in seconds-since-... format, used by programmatic clients.
* (if DEVELOPMENT version, NOTIME)
*/
- public static final long time;
+ private static long time = -1; // -1 == uninitialized
/** format used by build script to set time_text */
public static final String SIMPLE_DATE_FORMAT = "@build.time.format@";
- // if not DEVELOPMENT version, read time text using format used to set time
- static {
- long foundTime = NOTIME;
- try {
- SimpleDateFormat format = new SimpleDateFormat(SIMPLE_DATE_FORMAT);
- ParsePosition pos = new ParsePosition(0);
- Date date = format.parse(time_text, pos);
- foundTime = date.getTime();
- } catch (Throwable t) {
- }
- time = foundTime;
+ public static long getTime() {
+ if (time==-1) {
+ long foundTime = NOTIME;
+ // if not DEVELOPMENT version, read time text using format used to set time
+ try {
+ SimpleDateFormat format = new SimpleDateFormat(SIMPLE_DATE_FORMAT);
+ ParsePosition pos = new ParsePosition(0);
+ Date date = format.parse(time_text, pos);
+ if (date!=null) foundTime = date.getTime();
+ } catch (Throwable t) {
+ }
+ time = foundTime;
+ }
+ return time;
}
/**