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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Mar 16 15:20:11 GMT 2012


Author: whalley
Date: Fri Mar 16 15:20:11 2012
New Revision: 1525

Log:
fixes a couple of bugs in the Plain Formatter

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	Thu Mar 15 16:37:36 2012	(r1524)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Fri Mar 16 15:20:11 2012	(r1525)
@@ -224,7 +224,8 @@
 //                    row.setAttribute("yval", yval);
                         for (Uncertainty e : p.getYAxis().getDataset().getYAxis(ny).getPoint(r).getErrors()) {
                         try {
-                            Uncertainty ae = e.getAbsoluteError(p);
+//                            Uncertainty ae = e.getAbsoluteError(p);
+                            Uncertainty ae = e.getAbsoluteError(p.getYAxis().getDataset().getYAxis(ny).getPoint(r));
                             if(ae.isSymmetricReversed()){
                                 s.append("\t"  + ae.getPlus());
                                 s.append("\t+" + ae.getMinus());
@@ -232,32 +233,33 @@
                             else {
                                 Pattern patt9 = Pattern.compile("\\A" + "(^[\\d]+\\.[\\d]*[012345678])[9]+[012345678]*$"  + "\\Z",Pattern.CASE_INSENSITIVE);
                                 Pattern patt0 = Pattern.compile("\\A" + "(^[\\d]+\\.[\\d]*[123456789])[0]+[123456789]*$"  + "\\Z",Pattern.CASE_INSENSITIVE);
-                                String tt = ae.getPlus().toString();
- 
-                                Matcher m9 = patt9.matcher(tt);
-                                Matcher m0 = patt0.matcher(tt);
 
-                                if(m9.matches()){
-                                    s.append("\t+" + m9.group(1));
-                                } else if(m0.matches()){
-                                    s.append("\t+" + m0.group(1));
-                                } else {
-                                    s.append("\t+" + tt);
-                                }
-
-                                tt = ae.getMinus().toString();
-                                m9 = patt9.matcher(tt);
-                                m0 = patt0.matcher(tt);
-
-                                if(m9.matches()){
-                                    s.append("\t-" + m9.group(1));
-                                } else if(m0.matches()){
-                                    s.append("\t-" + m0.group(1));
-                                } else {
-                                    s.append("\t-" + tt);
-                                }
-//                                s.append("\t+" + ae.getPlus());
-//                                s.append("\t-" + ae.getMinus());
+//                                String tt = ae.getPlus().toString();
+// 
+//                                Matcher m9 = patt9.matcher(tt);
+//                                Matcher m0 = patt0.matcher(tt);
+// 
+//                                if(m9.matches()){
+//                                    s.append("\t+" + m9.group(1));
+//                                } else if(m0.matches()){
+//                                    s.append("\t+" + m0.group(1));
+//                                } else {
+//                                    s.append("\t+" + tt);
+//                                }
+//
+//                                tt = ae.getMinus().toString();
+//                                m9 = patt9.matcher(tt);
+//                                m0 = patt0.matcher(tt);
+//
+//                                if(m9.matches()){
+//                                    s.append("\t-" + m9.group(1));
+//                                } else if(m0.matches()){
+//                                    s.append("\t-" + m0.group(1));
+//                                } else {
+//                                    s.append("\t-" + tt);
+//                                }
+                                s.append("\t+" + ae.getPlus());
+                                s.append("\t-" + ae.getMinus());
                             }
                         } catch (HDException hde) {
                             s.append("\t+?\t?");


More information about the HepData-svn mailing list