]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Compressing toString() output when min==opt==max makes it more readable.
authorJeremias Maerki <jeremias@apache.org>
Fri, 23 Sep 2005 08:00:53 +0000 (08:00 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 23 Sep 2005 08:00:53 +0000 (08:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@291092 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/traits/MinOptMax.java

index ad3259ea762b60d3b92749b6cc8469bbcc4b1a9e..47469d1614aafd00566fec9e0fa2d02bc2b38e06 100644 (file)
@@ -163,8 +163,20 @@ public class MinOptMax implements java.io.Serializable, Cloneable {
         max -= op.min;
     }
 
+    /** @see java.lang.Object#toString() */
     public String toString() {
-        return "MinOptMax: min=" + min + "; opt=" + opt + "; max=" + max;
+        StringBuffer sb = new StringBuffer();
+        sb.append("MinOptMax[min=");
+        if (min != opt) {
+            sb.append(min).append("; ");
+        }
+        sb.append("opt=");
+        if (opt != max) {
+            sb.append(opt).append("; ");
+        }
+        sb.append("max=").append(max);
+        sb.append("]");
+        return sb.toString();
     }
 }