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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu May 31 10:35:17 BST 2012


Author: whalley
Date: Thu May 31 10:35:17 2012
New Revision: 1546

Log:
tweaks to handle records with Axis errors

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 17:21:36 2012	(r1545)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Thu May 31 10:35:17 2012	(r1546)
@@ -95,10 +95,16 @@
             for (int ny=1; ny<=d.getYAxes().size(); ny++ ) {
                 List <String> storelist = new ArrayList();
                 for (String c : d.getYAxis(ny).getComments()) {
-                    storelist.add(c);
+                    if(!c.startsWith("Axis error")){
+                        storelist.add(c);
+                    } else{
+                        c=c.replaceFirst("Axis","Axis("+ny+")");
+                        s.append(c+"\n");
+                    }
                 }
                 Collections.sort(storelist);
-                for(int i=0; i<storelist.size(); i++){
+                nstore=storelist.size();
+                 for(int i=0; i<storelist.size(); i++){
                     store[ny-1][i]=storelist.get(i);
                 }
                 for (Property p : d.getYAxis(ny).getProperties()) {
@@ -137,6 +143,7 @@
              
                 }
                 Collections.sort(storelist);
+                nstore = storelist.size();
                 for(int i=0; i<storelist.size(); i++){
                     store[ny-1][i]=storelist.get(i);
                 }


More information about the HepData-svn mailing list