Revision: 14760 http://gate.svn.sourceforge.net/gate/?rev=14760&view=rev Author: markagreenwood Date: 2011-12-13 17:03:43 +0000 (Tue, 13 Dec 2011) Log Message: ----------- while looking at some weird findbug issues (most of which aren't important) I spotted some REALLY weird issues around static variables. it turns out that we had static on the wrong variable which would have completely screwed up any datastores already loaded in GATE if a really old v1.0 datastore was opened as it would have changed the version info (and hence code behaviour) of a static field. I think I've unravelled most of the mess and have tided up the encapsulation and static behaviour, but if people start complaining about datastore issues, this is probably the fix to blame
Modified Paths: -------------- gate/trunk/src/gate/persist/SerialDataStore.java Modified: gate/trunk/src/gate/persist/SerialDataStore.java =================================================================== --- gate/trunk/src/gate/persist/SerialDataStore.java 2011-12-13 17:02:39 UTC (rev 14759) +++ gate/trunk/src/gate/persist/SerialDataStore.java 2011-12-13 17:03:43 UTC (rev 14760) @@ -143,10 +143,10 @@ } // create() /** The name of the version file */ - protected static String versionFileName = "__GATE_SerialDataStore__"; + private static String versionFileName = "__GATE_SerialDataStore__"; /** The protocol version of the currently open data store */ - protected static String currentProtocolVersion = null; + protected String currentProtocolVersion = null; /** Get a File for the protocol version file. */ protected File getVersionFile() throws IOException { @@ -167,16 +167,16 @@ * This variable stores the version of the current level of the * protocol, NOT the level in use in the currently open data store. */ - protected String versionNumber = "1.1"; + protected static final String versionNumber = "1.1"; /** List of valid protocol version numbers. */ - protected String[] protocolVersionNumbers = { + protected static final String[] protocolVersionNumbers = { "1.0", "1.1" }; // protocolVersionNumbers /** Check a version number for validity. */ - protected boolean isValidProtocolVersion(String versionNumber) { + protected static boolean isValidProtocolVersion(String versionNumber) { if(versionNumber == null) return false; @@ -570,7 +570,7 @@ } // random /** Random number generator */ - protected static Random randomiser = new Random(); + private static final Random randomiser = new Random(); private transient Vector datastoreListeners; /** String representation */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ _______________________________________________ GATE-cvs mailing list GATE-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gate-cvs