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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Nov 2 15:08:18 GMT 2015


Author: whalley
Date: Mon Nov  2 15:08:18 2015
New Revision: 1901

Log:
fix to allow records with corrupt qualifiers output with the Input formatter

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

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Wed Oct 28 12:58:21 2015	(r1900)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Mon Nov  2 15:08:18 2015	(r1901)
@@ -185,8 +185,11 @@
                 else{
                     s.append(store[0][i]);
                     for(int ny=1; ny<nyax; ny++){
-			String right = store[ny][i].split("\\s*\\:\\s")[1];
-			if(!store[0][i].startsWith("*yheader")) {right = store[ny][i].split("\\s*\\:\\s")[2];}
+                        String right = "";
+                        try{ 
+		            right = store[ny][i].split("\\s*\\:\\s")[1];
+                            if(!store[0][i].startsWith("*yheader")) {right = store[ny][i].split("\\s*\\:\\s")[2];}
+                        } catch (Exception ex) {}
                         s.append(" : "+right);
                     }
                     s.append("\n");
@@ -270,7 +273,7 @@
 			    s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getDescription());
 			} else {
 			    s.append(" -");
-			}
+                        }
                     }
                     s.append(";");                   
                 }


More information about the HepData-svn mailing list