krysalis-version/src/java/org/krysalis/version/formatting VersionFormatFactory.java,1.6,1.7

[email protected]
Newsgroups gmane.comp.krysalis.sandbox
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/formatting
In directory sc8-pr-cvs1:/tmp/cvs-serv20296/src/java/org/krysalis/version/formatting

Modified Files:
	VersionFormatFactory.java 
Log Message:
First stab at replacing Formats with Specifications for "non-Krysalis" formats.
Fixed some bugs via new tests.

Index: VersionFormatFactory.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/formatting/VersionFormatFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** VersionFormatFactory.java	7 Feb 2003 20:11:53 -0000	1.6
--- VersionFormatFactory.java	10 Mar 2003 20:44:18 -0000	1.7
***************
*** 62,65 ****
--- 62,66 ----
  import org.krysalis.version.formatting.format.JavasoftVersionFormat;
  import org.krysalis.version.formatting.format.KrysalisVersionFormat;
+ import org.krysalis.version.internal.InternalVersionConstants;
  
  /**
***************
*** 73,76 ****
--- 74,81 ----
  
          l_registry = new HashMap();
+ 
+         registerVersionFormat(
+             InternalVersionConstants.KRYSALIS_VERSION_ID,
+             KrysalisVersionFormat.class);
      }
  
***************
*** 92,96 ****
      }
      /** Named */
!     public static VersionFormat createVersionFormatFromId(final String identifier) throws VersionException{
          //:TODO: Implement..
          // Register existing formats by ID
--- 97,102 ----
      }
      /** Named */
!     public static VersionFormat createVersionFormatFromId(final String identifier)
!         throws VersionException {
          //:TODO: Implement..
          // Register existing formats by ID
***************
*** 98,102 ****
          VersionFormat format = null;
  
!         synchronized(l_registry) {
  
              Class registeredClass = (Class) l_registry.get(identifier);
--- 104,108 ----
          VersionFormat format = null;
  
!         synchronized (l_registry) {
  
              Class registeredClass = (Class) l_registry.get(identifier);
***************
*** 126,137 ****
      }
  
!     public static void registerVersionFormat(String id, Class formatClass)
!         throws VersionException {
!         synchronized(l_registry) {
!             // :TODO: Consider this... 
!             // if ( l_registry.exists(id))
!             //throw new VersionException(
!             //    "Format [" + id + "] already registered");
! 
              l_registry.put(id, formatClass);
          }
--- 132,137 ----
      }
  
!     public static void registerVersionFormat(String id, Class formatClass) {
!         synchronized (l_registry) {
              l_registry.put(id, formatClass);
          }




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.