[HepData-svn] r1544 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed May 30 16:18:46 BST 2012


Author: whalley
Date: Wed May 30 16:18:46 2012
New Revision: 1544

Log:
catch cases where Unit exists but is zero length string

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Wed May 30 15:45:37 2012	(r1543)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Wed May 30 16:18:46 2012	(r1544)
@@ -105,7 +105,7 @@
                     /// @todo Do better matching on "SQRT(S)" etc.
                     StringBuffer sb = new StringBuffer();
                     /// next line chnged to sqtrsssss to stop the checking for sqrts ///
-                    if (! p.getName().toLowerCase().equals("sqrtsssss")) {
+                    if (!p.getName().toLowerCase().equals("sqrtsssss")) {
                         sb.append(p.getName() + " : ");
                         if (p.getLowValue() != null && p.getHighValue() != null &&
                             p.getLowValue().equals(p.getHighValue())) {
@@ -113,8 +113,10 @@
                         } else {
                             sb.append(p.getLowValue().toString() + " - " + p.getHighValue().toString());
                         }
-                        if (!p.getUnit().isDimensionless()) {
-                            sb.append(" " + p.getUnit().toString());
+                        if ( !p.getUnit().toString().equals("") ) {
+                            if ( !p.getUnit().isDimensionless()) {
+                                sb.append(" " + p.getUnit().toString());
+                            }
                         }
                         storelist.add(sb.toString());
                     }


More information about the HepData-svn mailing list