]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #42067:
authorJeremias Maerki <jeremias@apache.org>
Fri, 18 May 2007 11:59:26 +0000 (11:59 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 18 May 2007 11:59:26 +0000 (11:59 +0000)
Restore JDK 1.3 compatibility.
Submitted by: Adrian Cumiskey <fop-dev.at.cumiskey.com>

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@539406 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/Trait.java

index 1ded6966390c5a4cf4d51b0219c74de59099a32b..32582dec1954179d4c71b96f7089f484ff3724ff 100644 (file)
@@ -521,13 +521,10 @@ public class Trait implements Serializable {
            if (attrValue != null) {
               int len = attrValue.length();
               if (len >= 2 && attrValue.charAt(0) == '(' && attrValue.charAt(len - 1) == ')') {
-                  String[] values = attrValue.substring(1, len - 1).split(",", 2);
-                  if (values.length > 0) {
-                      result[0] = values[0].trim();
-                      if (values.length > 1) {
-                          result[1] = values[1].trim();
-                      }
-                  }
+                  String value = attrValue.substring(1, len - 1); // remove brackets
+                  int delimIndex = value.indexOf(',');
+                  result[0] = value.substring(0, delimIndex).trim(); // PV key
+                  result[1] = value.substring(delimIndex + 1, value.length()).trim(); // IDRef
               } else {
                   // PV key only, e.g. from old area tree XML:
                   result[0] = attrValue;