Commit in GeomConverter/src/org/lcsim/geometry/compact on MAIN
Header.java+23-191.7 -> 1.8
fix bug where author and title were not read correctly

GeomConverter/src/org/lcsim/geometry/compact
Header.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- Header.java	18 Sep 2006 22:09:57 -0000	1.7
+++ Header.java	4 Jan 2011 21:55:07 -0000	1.8
@@ -17,45 +17,47 @@
     private String comment = "NONE";
     private String status = "NONE";
 
-    protected Header(Element info)
+    protected Header( Element info )
     {
-        if (info.getAttributeValue("name") != null)
+        if ( info.getAttributeValue( "name" ) != null )
         {
-            name = info.getAttributeValue("name");
+            name = info.getAttributeValue( "name" );
         }
-        else {
-            throw new RuntimeException("info element for this detector is missing the name attribute.");
+        else
+        {
+            throw new RuntimeException( "The <info> element is missing the name field." );
         }
 
-        if (info.getChild("author") != null)
+        if ( info.getAttribute( "author" ) != null )
         {
-            author = info.getAttributeValue("author");
+            author = info.getAttributeValue( "author" );
         }
 
-        if (info.getChild("title") != null)
+        if ( info.getAttribute( "title" ) != null )
         {
-            title = info.getAttributeValue("title");
+            title = info.getAttributeValue( "title" );
         }
 
-        if (info.getAttribute("version") != null)
+        if ( info.getAttribute( "version" ) != null )
         {
-            version = info.getAttributeValue("version");
+            version = info.getAttributeValue( "version" );
         }
 
-        if (info.getAttribute("url") != null)
+        if ( info.getAttribute( "url" ) != null )
         {
-            url = info.getAttributeValue("url");
+            url = info.getAttributeValue( "url" );
         }
 
-        if (info.getChild("comment") != null)
+        if ( info.getAttribute( "status" ) != null )
         {
-            comment = info.getChild("comment").getTextNormalize();
+            status = info.getAttributeValue( "status" );
         }
         
-        if (info.getAttribute("status") != null)
+        if ( info.getChild( "comment" ) != null )
         {
-        	status = info.getAttributeValue("status");
+            comment = info.getChild( "comment" ).getTextNormalize();
         }
+
     }
 
     /**
@@ -110,19 +112,21 @@
 
     /**
      * Get the title of this detector.
+     * 
      * @return The title.
      */
     public String getTitle()
     {
         return title;
     }
-    
+
     /**
      * Get the production status of this detector.
+     * 
      * @return The status description.
      */
     public String getStatus()
     {
-    	return status;
+        return status;
     }
 }
\ No newline at end of file
CVSspam 0.2.8