From 94ae08701bbd7585a0b7e5a92d1975965a503c03 Mon Sep 17 00:00:00 2001 From: Dennis Kao <ulysseskao@gmail.com> Date: Wed, 15 Jan 2014 11:28:52 +0800 Subject: [PATCH] Merge branch 'origin/2.1.x' --- xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java | 1784 +++++++++++++++++++--------------------------------------- 1 files changed, 599 insertions(+), 1,185 deletions(-) diff --git a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java index 8e2bf6b..88af493 100644 --- a/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java +++ b/xdgnjobs/ximple-dgnio/src/main/java/com/ximple/util/PrintfFormat.java @@ -441,8 +441,7 @@ * formatting of -0.0f * round up/down when last digits are 50000... */ -public final class PrintfFormat -{ +public final class PrintfFormat { /** * Vector of control strings and format literals. */ @@ -471,8 +470,7 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(String fmtArg) throws IllegalArgumentException { this(Locale.getDefault(), fmtArg); } @@ -489,91 +487,74 @@ * string is null, zero length, or otherwise * malformed. */ - public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException - { + public PrintfFormat(Locale locale, String fmtArg) throws IllegalArgumentException { dfs = new DecimalFormatSymbols(locale); int ePos = 0; ConversionSpecification sFmt = null; String unCS = this.nonControl(fmtArg, 0); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); } - while ((cPos != -1) && (cPos < fmtArg.length())) - { - for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) - { + while ((cPos != -1) && (cPos < fmtArg.length())) { + for (ePos = cPos + 1; ePos < fmtArg.length(); ePos++) { char c = 0; c = fmtArg.charAt(ePos); - if (c == 'i') - { + if (c == 'i') { break; } - if (c == 'd') - { + if (c == 'd') { break; } - if (c == 'f') - { + if (c == 'f') { break; } - if (c == 'g') - { + if (c == 'g') { break; } - if (c == 'G') - { + if (c == 'G') { break; } - if (c == 'o') - { + if (c == 'o') { break; } - if (c == 'x') - { + if (c == 'x') { break; } - if (c == 'X') - { + if (c == 'X') { break; } - if (c == 'e') - { + if (c == 'e') { break; } - if (c == 'E') - { + if (c == 'E') { break; } - if (c == 'c') - { + if (c == 'c') { break; } - if (c == 's') - { + if (c == 's') { break; } - if (c == '%') - { + if (c == '%') { break; } } @@ -583,8 +564,7 @@ vFmt.addElement(sFmt); unCS = this.nonControl(fmtArg, ePos); - if (unCS != null) - { + if (unCS != null) { sFmt = new ConversionSpecification(); sFmt.setLiteral(unCS); vFmt.addElement(sFmt); @@ -606,14 +586,12 @@ * @return the substring from the start position * to the beginning of the control string. */ - private String nonControl(String s, int start) - { + private String nonControl(String s, int start) { String ret = ""; cPos = s.indexOf("%", start); - if (cPos == -1) - { + if (cPos == -1) { cPos = s.length(); } @@ -629,90 +607,69 @@ * @param o The array of objects to format. * @return The formatted String. */ - public String sprintf(Object[] o) - { + public String sprintf(Object[] o) { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; int i = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (cs.isPositionalSpecification()) - { + } else { + if (cs.isPositionalSpecification()) { i = cs.getArgumentPosition() - 1; - if (cs.isPositionalFieldWidth()) - { + if (cs.isPositionalFieldWidth()) { int ifw = cs.getArgumentPositionForFieldWidth() - 1; cs.setFieldWidthWithArg(((Integer) o[ifw]).intValue()); } - if (cs.isPositionalPrecision()) - { + if (cs.isPositionalPrecision()) { int ipr = cs.getArgumentPositionForPrecision() - 1; cs.setPrecisionWithArg(((Integer) o[ipr]).intValue()); } - } else - { - if (cs.isVariableFieldWidth()) - { + } else { + if (cs.isVariableFieldWidth()) { cs.setFieldWidthWithArg(((Integer) o[i]).intValue()); i++; } - if (cs.isVariablePrecision()) - { + if (cs.isVariablePrecision()) { cs.setPrecisionWithArg(((Integer) o[i]).intValue()); i++; } } - if (o[i] instanceof Byte) - { + if (o[i] instanceof Byte) { sb.append(cs.internalsprintf(((Byte) o[i]).byteValue())); - } else if (o[i] instanceof Short) - { + } else if (o[i] instanceof Short) { sb.append(cs.internalsprintf(((Short) o[i]).shortValue())); - } else if (o[i] instanceof Integer) - { + } else if (o[i] instanceof Integer) { sb.append(cs.internalsprintf(((Integer) o[i]).intValue())); - } else if (o[i] instanceof Long) - { + } else if (o[i] instanceof Long) { sb.append(cs.internalsprintf(((Long) o[i]).longValue())); - } else if (o[i] instanceof Float) - { + } else if (o[i] instanceof Float) { sb.append(cs.internalsprintf(((Float) o[i]).floatValue())); - } else if (o[i] instanceof Double) - { + } else if (o[i] instanceof Double) { sb.append(cs.internalsprintf(((Double) o[i]).doubleValue())); - } else if (o[i] instanceof Character) - { + } else if (o[i] instanceof Character) { sb.append(cs.internalsprintf(((Character) o[i]).charValue())); - } else if (o[i] instanceof String) - { + } else if (o[i] instanceof String) { sb.append(cs.internalsprintf((String) o[i])); - } else - { + } else { sb.append(cs.internalsprintf(o[i])); } - if (!cs.isPositionalSpecification()) - { + if (!cs.isPositionalSpecification()) { i++; } } @@ -726,23 +683,19 @@ * * @return the formatted String. */ - public String sprintf() - { + public String sprintf() { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); } } @@ -759,26 +712,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(int x) throws IllegalArgumentException - { + public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -795,26 +743,21 @@ * conversion character is f, e, E, g, G, s, * or S. */ - public String sprintf(long x) throws IllegalArgumentException - { + public String sprintf(long x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -831,26 +774,21 @@ * conversion character is c, C, s, S, * d, d, x, X, or o. */ - public String sprintf(double x) throws IllegalArgumentException - { + public String sprintf(double x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -866,26 +804,21 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - public String sprintf(String x) throws IllegalArgumentException - { + public String sprintf(String x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -907,52 +840,38 @@ * conversion character is inappropriate for * formatting an unwrapped value. */ - public String sprintf(Object x) throws IllegalArgumentException - { + public String sprintf(Object x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuilder sb = new StringBuilder(); - while (e.hasMoreElements()) - { + while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); - if (c == '\0') - { + if (c == '\0') { sb.append(cs.getLiteral()); - } else if (c == '%') - { + } else if (c == '%') { sb.append("%"); - } else - { - if (x instanceof Byte) - { + } else { + if (x instanceof Byte) { sb.append(cs.internalsprintf(((Byte) x).byteValue())); - } else if (x instanceof Short) - { + } else if (x instanceof Short) { sb.append(cs.internalsprintf(((Short) x).shortValue())); - } else if (x instanceof Integer) - { + } else if (x instanceof Integer) { sb.append(cs.internalsprintf(((Integer) x).intValue())); - } else if (x instanceof Long) - { + } else if (x instanceof Long) { sb.append(cs.internalsprintf(((Long) x).longValue())); - } else if (x instanceof Float) - { + } else if (x instanceof Float) { sb.append(cs.internalsprintf(((Float) x).floatValue())); - } else if (x instanceof Double) - { + } else if (x instanceof Double) { sb.append(cs.internalsprintf(((Double) x).doubleValue())); - } else if (x instanceof Character) - { + } else if (x instanceof Character) { sb.append(cs.internalsprintf(((Character) x).charValue())); - } else if (x instanceof String) - { + } else if (x instanceof String) { sb.append(cs.internalsprintf((String) x)); - } else - { + } else { sb.append(cs.internalsprintf(x)); } } @@ -994,8 +913,7 @@ * optional L does not imply conversion to a long * long double. */ - private class ConversionSpecification - { + private class ConversionSpecification { /** * Default precision. */ @@ -1136,8 +1054,7 @@ * Constructor. Used to prepare an instance * to hold a literal, not a control string. */ - ConversionSpecification() - { + ConversionSpecification() { } /** @@ -1152,20 +1069,16 @@ * input string is null, zero length, or * otherwise malformed. */ - ConversionSpecification(String fmtArg) throws IllegalArgumentException - { - if (fmtArg == null) - { + ConversionSpecification(String fmtArg) throws IllegalArgumentException { + if (fmtArg == null) { throw new NullPointerException(); } - if (fmtArg.length() == 0) - { + if (fmtArg.length() == 0) { throw new IllegalArgumentException("Control strings must have positive" + " lengths."); } - if (fmtArg.charAt(0) == '%') - { + if (fmtArg.charAt(0) == '%') { fmt = fmtArg; pos = 1; setArgPosition(); @@ -1174,33 +1087,25 @@ setPrecision(); setOptionalHL(); - if (setConversionCharacter()) - { - if (pos == fmtArg.length()) - { - if (leadingZeros && leftJustify) - { + if (setConversionCharacter()) { + if (pos == fmtArg.length()) { + if (leadingZeros && leftJustify) { leadingZeros = false; } - if (precisionSet && leadingZeros) - { + if (precisionSet && leadingZeros) { if ((conversionCharacter == 'd') || (conversionCharacter == 'i') || (conversionCharacter == 'o') - || (conversionCharacter == 'x')) - { + || (conversionCharacter == 'x')) { leadingZeros = false; } } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Malformed conversion specification=" + fmtArg); } - } else - { + } else { throw new IllegalArgumentException("Control strings must begin with %."); } } @@ -1210,8 +1115,7 @@ * * @param s the String to store. */ - void setLiteral(String s) - { + void setLiteral(String s) { fmt = s; } @@ -1221,23 +1125,18 @@ * * @return s the stored String. */ - String getLiteral() - { + String getLiteral() { StringBuilder sb = new StringBuilder(); int i = 0; - while (i < fmt.length()) - { - if (fmt.charAt(i) == '\\') - { + while (i < fmt.length()) { + if (fmt.charAt(i) == '\\') { i++; - if (i < fmt.length()) - { + if (i < fmt.length()) { char c = fmt.charAt(i); - switch (c) - { + switch (c) { case 'a': sb.append((char) 0x07); @@ -1280,12 +1179,10 @@ } i++; - } else - { + } else { sb.append('\\'); } - } else - { + } else { i++; } } @@ -1299,8 +1196,7 @@ * * @return the conversion character. */ - char getConversionCharacter() - { + char getConversionCharacter() { return conversionCharacter; } @@ -1313,8 +1209,7 @@ * uses an * field width; otherwise * <code>false</code>. */ - boolean isVariableFieldWidth() - { + boolean isVariableFieldWidth() { return variableFieldWidth; } @@ -1325,10 +1220,8 @@ * * @param fw the field width. */ - void setFieldWidthWithArg(int fw) - { - if (fw < 0) - { + void setFieldWidthWithArg(int fw) { + if (fw < 0) { leftJustify = true; } @@ -1345,8 +1238,7 @@ * uses an * precision; otherwise * <code>false</code>. */ - boolean isVariablePrecision() - { + boolean isVariablePrecision() { return variablePrecision; } @@ -1356,8 +1248,7 @@ * * @param pr the precision. */ - void setPrecisionWithArg(int pr) - { + void setPrecisionWithArg(int pr) { precisionSet = true; precision = Math.max(pr, 0); } @@ -1371,22 +1262,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(int s) throws IllegalArgumentException - { + String internalsprintf(int s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat((long) s); - } else - { + } else { s2 = printDFormat(s); } @@ -1394,28 +1280,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat((long) s); - } else - { + } else { s2 = printXFormat(s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat((long) s); - } else - { + } else { s2 = printOFormat(s); } @@ -1429,7 +1309,7 @@ default: throw new IllegalArgumentException("Cannot format a int with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1444,22 +1324,17 @@ * @throws IllegalArgumentException if the * conversion character is f, e, E, g, or G. */ - String internalsprintf(long s) throws IllegalArgumentException - { + String internalsprintf(long s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'd': case 'i': - if (optionalh) - { + if (optionalh) { s2 = printDFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printDFormat(s); - } else - { + } else { s2 = printDFormat((int) s); } @@ -1467,28 +1342,22 @@ case 'x': case 'X': - if (optionalh) - { + if (optionalh) { s2 = printXFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printXFormat(s); - } else - { + } else { s2 = printXFormat((int) s); } break; case 'o': - if (optionalh) - { + if (optionalh) { s2 = printOFormat((short) s); - } else if (optionall) - { + } else if (optionall) { s2 = printOFormat(s); - } else - { + } else { s2 = printOFormat((int) s); } @@ -1502,7 +1371,7 @@ default: throw new IllegalArgumentException("Cannot format a long with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1518,12 +1387,10 @@ * conversion character is c, C, s, S, i, d, * x, X, or o. */ - String internalsprintf(double s) throws IllegalArgumentException - { + String internalsprintf(double s) throws IllegalArgumentException { String s2 = ""; - switch (conversionCharacter) - { + switch (conversionCharacter) { case 'f': s2 = printFFormat(s); @@ -1543,7 +1410,7 @@ default: throw new IllegalArgumentException("Cannot " + "format a double with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1558,17 +1425,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(String s) throws IllegalArgumentException - { + String internalsprintf(String s) throws IllegalArgumentException { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s); - } else - { + } else { throw new IllegalArgumentException("Cannot " + "format a String with a format using a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1583,17 +1447,14 @@ * @throws IllegalArgumentException if the * conversion character is neither s nor S. */ - String internalsprintf(Object s) - { + String internalsprintf(Object s) { String s2 = ""; - if ((conversionCharacter == 's') || (conversionCharacter == 'S')) - { + if ((conversionCharacter == 's') || (conversionCharacter == 'S')) { s2 = printSFormat(s.toString()); - } else - { + } else { throw new IllegalArgumentException("Cannot format a String with a format using" + " a " + conversionCharacter - + " conversion character."); + + " conversion character."); } return s2; @@ -1621,8 +1482,7 @@ * to appear after the radix character. Padding is * with trailing 0s. */ - private char[] fFormatDigits(double x) - { + private char[] fFormatDigits(double x) { // int defaultDigits=6; String sx, sxOut; int i, j, k; @@ -1630,19 +1490,15 @@ int expon = 0; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -1651,68 +1507,51 @@ int ePos = sx.indexOf('E'); int rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } @@ -1720,11 +1559,9 @@ int p; - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } @@ -1732,102 +1569,79 @@ char[] ca2 = new char[n1In + n2In]; char[] ca3, ca4, ca5; - for (j = 0; j < n1In; j++) - { + for (j = 0; j < n1In; j++) { ca2[j] = ca1[j]; } i = j + 1; - for (k = 0; k < n2In; j++, i++, k++) - { + for (k = 0; k < n2In; j++, i++, k++) { ca2[j] = ca1[i]; } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca3 = new char[-expon + n2In]; - for (j = 0, k = 0; k < (-n1In - expon); k++, j++) - { + for (j = 0, k = 0; k < (-n1In - expon); k++, j++) { ca3[j] = '0'; } - for (i = 0; i < (n1In + n2In); i++, j++) - { + for (i = 0; i < (n1In + n2In); i++, j++) { ca3[j] = ca2[i]; } - } else - { + } else { ca3 = ca2; } boolean carry = false; - if (p < -expon + n2In) - { - if (expon < 0) - { + if (p < -expon + n2In) { + if (expon < 0) { i = p; - } else - { + } else { i = p + n1In; } carry = checkForCarry(ca3, i); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca3, i - 1, 0); } } - if (n1In + expon <= 0) - { + if (n1In + expon <= 0) { ca4 = new char[2 + p]; - if (!carry) - { + if (!carry) { ca4[0] = '0'; - } else - { + } else { ca4[0] = '1'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[1] = '.'; - for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) - { + for (i = 0, j = 2; i < Math.min(p, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } - } else - { - if (!carry) - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (!carry) { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 1]; - } else - { + } else { ca4 = new char[n1In + expon]; } j = 0; - } else - { - if (alternateForm || !precisionSet || (precision != 0)) - { + } else { + if (alternateForm || !precisionSet || (precision != 0)) { ca4 = new char[n1In + expon + p + 2]; - } else - { + } else { ca4 = new char[n1In + expon + 1]; } @@ -1835,28 +1649,23 @@ j = 1; } - for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) - { + for (i = 0; i < Math.min(n1In + expon, ca3.length); i++, j++) { ca4[j] = ca3[i]; } - for (; i < n1In + expon; i++, j++) - { + for (; i < n1In + expon; i++, j++) { ca4[j] = '0'; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca4[j] = '.'; j++; - for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) - { + for (k = 0; (i < ca3.length) && (k < p); i++, j++, k++) { ca4[j] = ca3[i]; } - for (; j < ca4.length; j++) - { + for (; j < ca4.length; j++) { ca4[j] = '0'; } } @@ -1864,25 +1673,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) - { + if ((ca4[0] == '+') || (ca4[0] == '-') || (ca4[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca4.length; xdp++) - { - if (ca4[xdp] == '.') - { + for (; xdp < ca4.length; xdp++) { + if (ca4[xdp] == '.') { break; } } @@ -1890,74 +1694,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca4.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca5 = new char[ca4.length + nZeros + 1]; j++; - } else - { + } else { ca5 = new char[ca4.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca5[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca5[0] = ' '; } - } else - { + } else { ca5[0] = '-'; } - for (i = 0; i < nZeros; i++, j++) - { + for (i = 0; i < nZeros; i++, j++) { ca5[j] = '0'; } - for (i = 0; i < ca4.length; i++, j++) - { + for (i = 0; i < ca4.length; i++, j++) { ca5[j] = ca4[i]; } int lead = 0; - if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) - { + if ((ca5[0] == '+') || (ca5[0] == '-') || (ca5[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca5.length; dp++) - { - if (ca5[dp] == '.') - { + for (; dp < ca5.length; dp++) { + if (ca5[dp] == '.') { break; } } @@ -1965,35 +1755,29 @@ int nThousands = (dp - lead) / 3; // Localize the decimal point. - if (dp < ca5.length) - { + if (dp < ca5.length) { ca5[dp] = dfs.getDecimalSeparator(); } char[] ca6 = ca5; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca6 = new char[ca5.length + nThousands + lead]; ca6[0] = ca5[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca6[k]=','; ca6[k] = dfs.getGroupingSeparator(); ca6[k + 1] = ca5[i]; k += 2; - } else - { + } else { ca6[k] = ca5[i]; k++; } } - for (; i < ca5.length; i++, k++) - { + for (; i < ca5.length; i++, k++) { ca6[k] = ca5[i]; } } @@ -2011,47 +1795,35 @@ * @param x the double value to be formatted. * @return the converted double value. */ - private String fFormatString(double x) - { + private String fFormatString(double x) { boolean noDigits = false; char[] ca6, ca7; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca6 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " Inf".toCharArray(); - } else - { + } else { ca6 = "Inf".toCharArray(); } - } else - { + } else { ca6 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca6 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca6 = " NaN".toCharArray(); - } else - { + } else { ca6 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca6 = fFormatDigits(x); } @@ -2090,8 +1862,7 @@ * L does not imply conversion to a long long * double. */ - private char[] eFormatDigits(double x, char eChar) - { + private char[] eFormatDigits(double x, char eChar) { char[] ca1, ca2, ca3; // int defaultDigits=6; @@ -2102,19 +1873,15 @@ int ePos, rPos, eSize; boolean minusSign = false; - if (x > 0.0) - { + if (x > 0.0) { sx = Double.toString(x); - } else if (x < 0.0) - { + } else if (x < 0.0) { sx = Double.toString(-x); minusSign = true; - } else - { + } else { sx = Double.toString(x); - if (sx.charAt(0) == '-') - { + if (sx.charAt(0) == '-') { minusSign = true; sx = sx.substring(1); } @@ -2122,145 +1889,111 @@ ePos = sx.indexOf('E'); - if (ePos == -1) - { + if (ePos == -1) { ePos = sx.indexOf('e'); } rPos = sx.indexOf('.'); - if (rPos != -1) - { + if (rPos != -1) { n1In = rPos; - } else if (ePos != -1) - { + } else if (ePos != -1) { n1In = ePos; - } else - { + } else { n1In = sx.length(); } - if (rPos != -1) - { - if (ePos != -1) - { + if (rPos != -1) { + if (ePos != -1) { n2In = ePos - rPos - 1; - } else - { + } else { n2In = sx.length() - rPos - 1; } - } else - { + } else { n2In = 0; } - if (ePos != -1) - { + if (ePos != -1) { int ie = ePos + 1; expon = 0; - if (sx.charAt(ie) == '-') - { - for (++ie; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + if (sx.charAt(ie) == '-') { + for (++ie; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = -Integer.parseInt(sx.substring(ie)); } - } else - { - if (sx.charAt(ie) == '+') - { + } else { + if (sx.charAt(ie) == '+') { ++ie; } - for (; ie < sx.length(); ie++) - { - if (sx.charAt(ie) != '0') - { + for (; ie < sx.length(); ie++) { + if (sx.charAt(ie) != '0') { break; } } - if (ie < sx.length()) - { + if (ie < sx.length()) { expon = Integer.parseInt(sx.substring(ie)); } } } - if (rPos != -1) - { + if (rPos != -1) { expon += rPos - 1; } - if (precisionSet) - { + if (precisionSet) { p = precision; - } else - { + } else { p = defaultDigits - 1; } - if ((rPos != -1) && (ePos != -1)) - { + if ((rPos != -1) && (ePos != -1)) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1, ePos)).toCharArray(); - } else if (rPos != -1) - { + } else if (rPos != -1) { ca1 = (sx.substring(0, rPos) + sx.substring(rPos + 1)).toCharArray(); - } else if (ePos != -1) - { + } else if (ePos != -1) { ca1 = sx.substring(0, ePos).toCharArray(); - } else - { + } else { ca1 = sx.toCharArray(); } boolean carry = false; int i0 = 0; - if (ca1[0] != '0') - { + if (ca1[0] != '0') { i0 = 0; - } else - { - for (i0 = 0; i0 < ca1.length; i0++) - { - if (ca1[i0] != '0') - { + } else { + for (i0 = 0; i0 < ca1.length; i0++) { + if (ca1[i0] != '0') { break; } } } - if (i0 + p < ca1.length - 1) - { + if (i0 + p < ca1.length - 1) { carry = checkForCarry(ca1, i0 + p + 1); - if (carry) - { + if (carry) { carry = startSymbolicCarry(ca1, i0 + p, i0); } - if (carry) - { + if (carry) { ca2 = new char[i0 + p + 1]; ca2[i0] = '1'; - for (j = 0; j < i0; j++) - { + for (j = 0; j < i0; j++) { ca2[j] = '0'; } - for (i = i0, j = i0 + 1; j < p + 1; i++, j++) - { + for (i = i0, j = i0 + 1; j < p + 1; i++, j++) { ca2[j] = ca1[i]; } @@ -2269,85 +2002,67 @@ } } - if ((Math.abs(expon) < 100) && !optionalL) - { + if ((Math.abs(expon) < 100) && !optionalL) { eSize = 4; - } else - { + } else { eSize = 5; } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2 = new char[2 + p + eSize]; - } else - { + } else { ca2 = new char[1 + eSize]; } - if (ca1[0] != '0') - { + if (ca1[0] != '0') { ca2[0] = ca1[0]; j = 1; - } else - { + } else { for (j = 1; j < ((ePos == -1) - ? ca1.length - : ePos); j++) - { - if (ca1[j] != '0') - { + ? ca1.length + : ePos); j++) { + if (ca1[j] != '0') { break; } } - if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) - { + if (((ePos != -1) && (j < ePos)) || ((ePos == -1) && (j < ca1.length))) { ca2[0] = ca1[j]; expon -= j; j++; - } else - { + } else { ca2[0] = '0'; j = 2; } } - if (alternateForm || !precisionSet || (precision != 0)) - { + if (alternateForm || !precisionSet || (precision != 0)) { ca2[1] = '.'; i = 2; - } else - { + } else { i = 1; } - for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) - { + for (k = 0; (k < p) && (j < ca1.length); j++, i++, k++) { ca2[i] = ca1[j]; } - for (; i < ca2.length - eSize; i++) - { + for (; i < ca2.length - eSize; i++) { ca2[i] = '0'; } ca2[i++] = eChar; - if (expon < 0) - { + if (expon < 0) { ca2[i++] = '-'; - } else - { + } else { ca2[i++] = '+'; } expon = Math.abs(expon); - if (expon >= 100) - { - switch (expon / 100) - { + if (expon >= 100) { + switch (expon / 100) { case 1: ca2[i] = '1'; @@ -2397,8 +2112,7 @@ i++; } - switch ((expon % 100) / 10) - { + switch ((expon % 100) / 10) { case 0: ca2[i] = '0'; @@ -2452,8 +2166,7 @@ i++; - switch (expon % 10) - { + switch (expon % 10) { case 0: ca2[i] = '0'; @@ -2507,25 +2220,20 @@ int nZeros = 0; - if (!leftJustify && leadingZeros) - { + if (!leftJustify && leadingZeros) { int xThousands = 0; - if (thousands) - { + if (thousands) { int xlead = 0; - if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) - { + if ((ca2[0] == '+') || (ca2[0] == '-') || (ca2[0] == ' ')) { xlead = 1; } int xdp = xlead; - for (; xdp < ca2.length; xdp++) - { - if (ca2[xdp] == '.') - { + for (; xdp < ca2.length; xdp++) { + if (ca2[xdp] == '.') { break; } } @@ -2533,74 +2241,60 @@ xThousands = (xdp - xlead) / 3; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nZeros = fieldWidth - ca2.length; } - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { nZeros--; } nZeros -= xThousands; - if (nZeros < 0) - { + if (nZeros < 0) { nZeros = 0; } } j = 0; - if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) - { + if ((!minusSign && (leadingSign || leadingSpace)) || minusSign) { ca3 = new char[ca2.length + nZeros + 1]; j++; - } else - { + } else { ca3 = new char[ca2.length + nZeros]; } - if (!minusSign) - { - if (leadingSign) - { + if (!minusSign) { + if (leadingSign) { ca3[0] = '+'; } - if (leadingSpace) - { + if (leadingSpace) { ca3[0] = ' '; } - } else - { + } else { ca3[0] = '-'; } - for (k = 0; k < nZeros; j++, k++) - { + for (k = 0; k < nZeros; j++, k++) { ca3[j] = '0'; } - for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) - { + for (i = 0; (i < ca2.length) && (j < ca3.length); i++, j++) { ca3[j] = ca2[i]; } int lead = 0; - if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) - { + if ((ca3[0] == '+') || (ca3[0] == '-') || (ca3[0] == ' ')) { lead = 1; } int dp = lead; - for (; dp < ca3.length; dp++) - { - if (ca3[dp] == '.') - { + for (; dp < ca3.length; dp++) { + if (ca3[dp] == '.') { break; } } @@ -2608,35 +2302,29 @@ int nThousands = dp / 3; // Localize the decimal point. - if (dp < ca3.length) - { + if (dp < ca3.length) { ca3[dp] = dfs.getDecimalSeparator(); } char[] ca4 = ca3; - if (thousands && (nThousands > 0)) - { + if (thousands && (nThousands > 0)) { ca4 = new char[ca3.length + nThousands + lead]; ca4[0] = ca3[0]; - for (i = lead, k = lead; i < dp; i++) - { - if ((i > 0) && (dp - i) % 3 == 0) - { + for (i = lead, k = lead; i < dp; i++) { + if ((i > 0) && (dp - i) % 3 == 0) { // ca4[k]=','; ca4[k] = dfs.getGroupingSeparator(); ca4[k + 1] = ca3[i]; k += 2; - } else - { + } else { ca4[k] = ca3[i]; k++; } } - for (; i < ca3.length; i++, k++) - { + for (; i < ca3.length; i++, k++) { ca4[k] = ca3[i]; } } @@ -2655,33 +2343,26 @@ * @return <code>true</code> if the truncation forces * a round that will change the print */ - private boolean checkForCarry(char[] ca1, int icarry) - { + private boolean checkForCarry(char[] ca1, int icarry) { boolean carry = false; - if (icarry < ca1.length) - { - if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) - { + if (icarry < ca1.length) { + if ((ca1[icarry] == '6') || (ca1[icarry] == '7') || (ca1[icarry] == '8') || (ca1[icarry] == '9')) { carry = true; - } else if (ca1[icarry] == '5') - { + } else if (ca1[icarry] == '5') { int ii = icarry + 1; - for (; ii < ca1.length; ii++) - { - if (ca1[ii] != '0') - { + for (; ii < ca1.length; ii++) { + if (ca1[ii] != '0') { break; } } carry = ii < ca1.length; - if (!carry && (icarry > 0)) - { + if (!carry && (icarry > 0)) { carry = ((ca1[icarry - 1] == '1') || (ca1[icarry - 1] == '3') || (ca1[icarry - 1] == '5') - || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); + || (ca1[icarry - 1] == '7') || (ca1[icarry - 1] == '9')); } } } @@ -2703,16 +2384,13 @@ * a round that will change the print still * more */ - private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) - { + private boolean startSymbolicCarry(char[] ca, int cLast, int cFirst) { boolean carry = true; - for (int i = cLast; carry && (i >= cFirst); i--) - { + for (int i = cLast; carry && (i >= cFirst); i--) { carry = false; - switch (ca[i]) - { + switch (ca[i]) { case '0': ca[i] = '1'; @@ -2781,47 +2459,35 @@ * converted double value. * @return the converted double value. */ - private String eFormatString(double x, char eChar) - { + private String eFormatString(double x, char eChar) { boolean noDigits = false; char[] ca4, ca5; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { + } else { ca4 = eFormatDigits(x, eChar); } @@ -2838,74 +2504,59 @@ * @param noDigits NaN or signed Inf * @return a padded array of characters */ - private char[] applyFloatPadding(char[] ca4, boolean noDigits) - { + private char[] applyFloatPadding(char[] ca4, boolean noDigits) { char[] ca5 = ca4; - if (fieldWidthSet) - { + if (fieldWidthSet) { int i, j, nBlanks; - if (leftJustify) - { + if (leftJustify) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < ca4.length; i++) - { + for (i = 0; i < ca4.length; i++) { ca5[i] = ca4[i]; } - for (j = 0; j < nBlanks; j++, i++) - { + for (j = 0; j < nBlanks; j++, i++) { ca5[i] = ' '; } } - } else if (!leadingZeros || noDigits) - { + } else if (!leadingZeros || noDigits) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; - for (i = 0; i < nBlanks; i++) - { + for (i = 0; i < nBlanks; i++) { ca5[i] = ' '; } - for (j = 0; j < ca4.length; i++, j++) - { + for (j = 0; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } - } else if (leadingZeros) - { + } else if (leadingZeros) { nBlanks = fieldWidth - ca4.length; - if (nBlanks > 0) - { + if (nBlanks > 0) { ca5 = new char[ca4.length + nBlanks]; i = 0; j = 0; - if (ca4[0] == '-') - { + if (ca4[0] == '-') { ca5[0] = '-'; i++; j++; } - for (int k = 0; k < nBlanks; i++, k++) - { + for (int k = 0; k < nBlanks; i++, k++) { ca5[i] = '0'; } - for (; j < ca4.length; i++, j++) - { + for (; j < ca4.length; i++, j++) { ca5[i] = ca4[j]; } } @@ -2921,8 +2572,7 @@ * @param x the double to format. * @return the formatted String. */ - private String printFFormat(double x) - { + private String printFFormat(double x) { return fFormatString(x); } @@ -2933,13 +2583,10 @@ * @param x the double to format. * @return the formatted String. */ - private String printEFormat(double x) - { - if (conversionCharacter == 'e') - { + private String printEFormat(double x) { + if (conversionCharacter == 'e') { return eFormatString(x, 'e'); - } else - { + } else { return eFormatString(x, 'E'); } } @@ -2971,68 +2618,52 @@ * @param x the double to format. * @return the formatted String. */ - private String printGFormat(double x) - { + private String printGFormat(double x) { String sx, sy, sz, ret; int savePrecision = precision; int i; char[] ca4, ca5; boolean noDigits = false; - if (Double.isInfinite(x)) - { - if (x == Double.POSITIVE_INFINITY) - { - if (leadingSign) - { + if (Double.isInfinite(x)) { + if (x == Double.POSITIVE_INFINITY) { + if (leadingSign) { ca4 = "+Inf".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " Inf".toCharArray(); - } else - { + } else { ca4 = "Inf".toCharArray(); } - } else - { + } else { ca4 = "-Inf".toCharArray(); } noDigits = true; - } else if (Double.isNaN(x)) - { - if (leadingSign) - { + } else if (Double.isNaN(x)) { + if (leadingSign) { ca4 = "+NaN".toCharArray(); - } else if (leadingSpace) - { + } else if (leadingSpace) { ca4 = " NaN".toCharArray(); - } else - { + } else { ca4 = "NaN".toCharArray(); } noDigits = true; - } else - { - if (!precisionSet) - { + } else { + if (!precisionSet) { precision = defaultDigits; } - if (precision == 0) - { + if (precision == 0) { precision = 1; } int ePos = -1; - if (conversionCharacter == 'g') - { + if (conversionCharacter == 'g') { sx = eFormatString(x, 'e').trim(); ePos = sx.indexOf('e'); - } else - { + } else { sx = eFormatString(x, 'E').trim(); ePos = sx.indexOf('E'); } @@ -3041,37 +2672,28 @@ int expon = 0; - if (sx.charAt(i) == '-') - { - for (++i; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + if (sx.charAt(i) == '-') { + for (++i; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = -Integer.parseInt(sx.substring(i)); } - } else - { - if (sx.charAt(i) == '+') - { + } else { + if (sx.charAt(i) == '+') { ++i; } - for (; i < sx.length(); i++) - { - if (sx.charAt(i) != '0') - { + for (; i < sx.length(); i++) { + if (sx.charAt(i) != '0') { break; } } - if (i < sx.length()) - { + if (i < sx.length()) { expon = Integer.parseInt(sx.substring(i)); } } @@ -3079,66 +2701,50 @@ // Trim trailing zeros. // If the radix character is not followed by // a digit, trim it, too. - if (!alternateForm) - { - if ((expon >= -4) && (expon < precision)) - { + if (!alternateForm) { + if ((expon >= -4) && (expon < precision)) { sy = fFormatString(x).trim(); - } else - { + } else { sy = sx.substring(0, ePos); } i = sy.length() - 1; - for (; i >= 0; i--) - { - if (sy.charAt(i) != '0') - { + for (; i >= 0; i--) { + if (sy.charAt(i) != '0') { break; } } - if ((i >= 0) && (sy.charAt(i) == '.')) - { + if ((i >= 0) && (sy.charAt(i) == '.')) { i--; } - if (i == -1) - { + if (i == -1) { sz = "0"; - } else if (!Character.isDigit(sy.charAt(i))) - { + } else if (!Character.isDigit(sy.charAt(i))) { sz = sy.substring(0, i + 1) + "0"; - } else - { + } else { sz = sy.substring(0, i + 1); } - if ((expon >= -4) && (expon < precision)) - { + if ((expon >= -4) && (expon < precision)) { ret = sz; - } else - { + } else { ret = sz + sx.substring(ePos); } - } else - { - if ((expon >= -4) && (expon < precision)) - { + } else { + if ((expon >= -4) && (expon < precision)) { ret = fFormatString(x).trim(); - } else - { + } else { ret = sx; } } // leading space was trimmed off during // construction - if (leadingSpace) - { - if (x >= 0) - { + if (leadingSpace) { + if (x >= 0) { ret = " " + ret; } } @@ -3180,8 +2786,7 @@ * @param x the short to format. * @return the formatted String. */ - private String printDFormat(short x) - { + private String printDFormat(short x) { return printDFormat(Short.toString(x)); } @@ -3212,8 +2817,7 @@ * @param x the long to format. * @return the formatted String. */ - private String printDFormat(long x) - { + private String printDFormat(long x) { return printDFormat(Long.toString(x)); } @@ -3244,8 +2848,7 @@ * @param x the int to format. * @return the formatted String. */ - private String printDFormat(int x) - { + private String printDFormat(int x) { return printDFormat(Integer.toString(x)); } @@ -3258,59 +2861,47 @@ * String. * @return the formatted String. */ - private String printDFormat(String sx) - { + private String printDFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0, - n = 0; + n = 0; int i = 0, - jFirst = 0; + jFirst = 0; boolean neg = sx.charAt(0) == '-'; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (!neg) - { - if (precisionSet && (sx.length() < precision)) - { + if (!neg) { + if (precisionSet && (sx.length() < precision)) { nLeadingZeros = precision - sx.length(); } - } else - { - if (precisionSet && (sx.length() - 1) < precision) - { + } else { + if (precisionSet && (sx.length() - 1) < precision) { nLeadingZeros = precision - sx.length() + 1; } } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (!neg && (leadingSign || leadingSpace)) - { + if (!neg && (leadingSign || leadingSpace)) { nBlanks--; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } - if (leadingSign) - { + if (leadingSign) { n++; - } else if (leadingSpace) - { + } else if (leadingSpace) { n++; } @@ -3320,90 +2911,70 @@ char[] ca = new char[n]; - if (leftJustify) - { - if (neg) - { + if (leftJustify) { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = 0; j < nLeadingZeros; i++, j++) - { + for (int j = 0; j < nLeadingZeros; i++, j++) { ca[i] = '0'; } - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; i++, j++) - { + for (int j = 0; j < nBlanks; i++, j++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (!leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } - if (neg) - { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - } else - { - if (neg) - { + } else { + if (neg) { ca[i++] = '-'; - } else if (leadingSign) - { + } else if (leadingSign) { ca[i++] = '+'; - } else if (leadingSpace) - { + } else if (leadingSpace) { ca[i++] = ' '; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); jFirst = neg - ? 1 - : 0; + ? 1 + : 0; - for (int j = jFirst; j < csx.length; j++, i++) - { + for (int j = jFirst; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -3432,32 +3003,25 @@ * @param x the short to format. * @return the formatted String. */ - private String printXFormat(short x) - { + private String printXFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "8000"; - } else if (x < 0) - { + } else if (x < 0) { String t; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { t = "0"; - } else - { + } else { t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 16); - if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) - { + if ((t.charAt(0) == 'F') || (t.charAt(0) == 'f')) { t = t.substring(16, 32); } } - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800" + t; @@ -3474,8 +3038,7 @@ break; case 4: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 4); @@ -3514,8 +3077,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 16); } @@ -3543,19 +3105,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printXFormat(long x) - { + private String printXFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "8000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "800000000000000" + t; @@ -3632,8 +3190,7 @@ break; case 16: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 16); @@ -3672,8 +3229,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 16); } @@ -3701,19 +3257,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printXFormat(int x) - { + private String printXFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "80000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 16); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "8000000" + t; @@ -3750,8 +3302,7 @@ break; case 8: - switch (t.charAt(0)) - { + switch (t.charAt(0)) { case '1': sx = "9" + t.substring(1, 8); @@ -3790,8 +3341,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 16); } @@ -3807,45 +3357,37 @@ * String. * @return the formatted String. */ - private String printXFormat(String sx) - { + private String printXFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); - if (alternateForm) - { + if (alternateForm) { nBlanks = nBlanks - 2; } } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } int n = 0; - if (alternateForm) - { + if (alternateForm) { n += 2; } @@ -3856,71 +3398,57 @@ char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (alternateForm) - { + if (leftJustify) { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (!leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + } else { + if (!leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } } - if (alternateForm) - { + if (alternateForm) { ca[i++] = '0'; ca[i++] = 'x'; } - if (leadingZeros) - { - for (int j = 0; j < nBlanks; j++, i++) - { + if (leadingZeros) { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = '0'; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } String caReturn = new String(ca); - if (conversionCharacter == 'X') - { + if (conversionCharacter == 'X') { caReturn = caReturn.toUpperCase(); } @@ -3949,19 +3477,15 @@ * @param x the short to format. * @return the formatted String. */ - private String printOFormat(short x) - { + private String printOFormat(short x) { String sx = null; - if (x == Short.MIN_VALUE) - { + if (x == Short.MIN_VALUE) { sx = "100000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Short.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "10000" + t; @@ -3987,8 +3511,7 @@ break; } - } else - { + } else { sx = Integer.toString((int) x, 8); } @@ -4017,19 +3540,15 @@ * @param x the long to format. * @return the formatted String. */ - private String printOFormat(long x) - { + private String printOFormat(long x) { String sx = null; - if (x == Long.MIN_VALUE) - { + if (x == Long.MIN_VALUE) { sx = "1000000000000000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Long.toString((~(-x - 1)) ^ Long.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "100000000000000000000" + t; @@ -4135,8 +3654,7 @@ break; } - } else - { + } else { sx = Long.toString(x, 8); } @@ -4165,19 +3683,15 @@ * @param x the int to format. * @return the formatted String. */ - private String printOFormat(int x) - { + private String printOFormat(int x) { String sx = null; - if (x == Integer.MIN_VALUE) - { + if (x == Integer.MIN_VALUE) { sx = "20000000000"; - } else if (x < 0) - { + } else if (x < 0) { String t = Integer.toString((~(-x - 1)) ^ Integer.MIN_VALUE, 8); - switch (t.length()) - { + switch (t.length()) { case 1: sx = "2000000000" + t; @@ -4233,8 +3747,7 @@ break; } - } else - { + } else { sx = Integer.toString(x, 8); } @@ -4250,38 +3763,31 @@ * String. * @return the formatted String. */ - private String printOFormat(String sx) - { + private String printOFormat(String sx) { int nLeadingZeros = 0; int nBlanks = 0; - if (sx.equals("0") && precisionSet && (precision == 0)) - { + if (sx.equals("0") && precisionSet && (precision == 0)) { sx = ""; } - if (precisionSet) - { + if (precisionSet) { nLeadingZeros = precision - sx.length(); } - if (alternateForm) - { + if (alternateForm) { nLeadingZeros++; } - if (nLeadingZeros < 0) - { + if (nLeadingZeros < 0) { nLeadingZeros = 0; } - if (fieldWidthSet) - { + if (fieldWidthSet) { nBlanks = fieldWidth - nLeadingZeros - sx.length(); } - if (nBlanks < 0) - { + if (nBlanks < 0) { nBlanks = 0; } @@ -4289,49 +3795,38 @@ char[] ca = new char[n]; int i; - if (leftJustify) - { - for (i = 0; i < nLeadingZeros; i++) - { + if (leftJustify) { + for (i = 0; i < nLeadingZeros; i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } - for (int j = 0; j < nBlanks; j++, i++) - { + for (int j = 0; j < nBlanks; j++, i++) { ca[i] = ' '; } - } else - { - if (leadingZeros) - { - for (i = 0; i < nBlanks; i++) - { + } else { + if (leadingZeros) { + for (i = 0; i < nBlanks; i++) { ca[i] = '0'; } - } else - { - for (i = 0; i < nBlanks; i++) - { + } else { + for (i = 0; i < nBlanks; i++) { ca[i] = ' '; } } - for (int j = 0; j < nLeadingZeros; j++, i++) - { + for (int j = 0; j < nLeadingZeros; j++, i++) { ca[i] = '0'; } char[] csx = sx.toCharArray(); - for (int j = 0; j < csx.length; j++, i++) - { + for (int j = 0; j < csx.length; j++, i++) { ca[i] = csx[j]; } } @@ -4357,31 +3852,25 @@ * @param x the char to format. * @return the formatted String. */ - private String printCFormat(char x) - { + private String printCFormat(char x) { int nPrint = 1; int width = fieldWidth; - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } char[] ca = new char[width]; int i = 0; - if (leftJustify) - { + if (leftJustify) { ca[0] = x; - for (i = 1; i <= width - nPrint; i++) - { + for (i = 1; i <= width - nPrint; i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } @@ -4415,84 +3904,66 @@ * @param x the String to format. * @return the formatted String. */ - private String printSFormat(String x) - { + private String printSFormat(String x) { int nPrint = x.length(); int width = fieldWidth; - if (precisionSet && (nPrint > precision)) - { + if (precisionSet && (nPrint > precision)) { nPrint = precision; } - if (!fieldWidthSet) - { + if (!fieldWidthSet) { width = nPrint; } int n = 0; - if (width > nPrint) - { + if (width > nPrint) { n += width - nPrint; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { n += x.length(); - } else - { + } else { n += nPrint; } char[] ca = new char[n]; int i = 0; - if (leftJustify) - { - if (nPrint >= x.length()) - { + if (leftJustify) { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (i = 0; i < x.length(); i++) - { + for (i = 0; i < x.length(); i++) { ca[i] = csx[i]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (i = 0; i < nPrint; i++) - { + for (i = 0; i < nPrint; i++) { ca[i] = csx[i]; } } - for (int j = 0; j < width - nPrint; j++, i++) - { + for (int j = 0; j < width - nPrint; j++, i++) { ca[i] = ' '; } - } else - { - for (i = 0; i < width - nPrint; i++) - { + } else { + for (i = 0; i < width - nPrint; i++) { ca[i] = ' '; } - if (nPrint >= x.length()) - { + if (nPrint >= x.length()) { char[] csx = x.toCharArray(); - for (int j = 0; j < x.length(); i++, j++) - { + for (int j = 0; j < x.length(); i++, j++) { ca[i] = csx[j]; } - } else - { + } else { char[] csx = x.substring(0, nPrint).toCharArray(); - for (int j = 0; j < nPrint; i++, j++) - { + for (int j = 0; j < nPrint; i++, j++) { ca[i] = csx[j]; } } @@ -4509,20 +3980,17 @@ * character is there, and * <code>false</code> otherwise. */ - private boolean setConversionCharacter() - { + private boolean setConversionCharacter() { /* idfgGoxXeEcs */ boolean ret = false; conversionCharacter = '\0'; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); if ((c == 'i') || (c == 'd') || (c == 'f') || (c == 'g') || (c == 'G') || (c == 'o') || (c == 'x') || (c == 'X') - || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) - { + || (c == 'e') || (c == 'E') || (c == 'c') || (c == 's') || (c == '%')) { conversionCharacter = c; pos++; ret = true; @@ -4541,26 +4009,21 @@ * respectively, before formatting. If any of * these is present, store them. */ - private void setOptionalHL() - { + private void setOptionalHL() { optionalh = false; optionall = false; optionalL = false; - if (pos < fmt.length()) - { + if (pos < fmt.length()) { char c = fmt.charAt(pos); - if (c == 'h') - { + if (c == 'h') { optionalh = true; pos++; - } else if (c == 'l') - { + } else if (c == 'l') { optionall = true; pos++; - } else if (c == 'L') - { + } else if (c == 'L') { optionalL = true; pos++; } @@ -4570,44 +4033,35 @@ /** * Set the precision. */ - private void setPrecision() - { + private void setPrecision() { int firstPos = pos; precisionSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '.')) { pos++; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setPrecisionArgPosition()) - { + if (!setPrecisionArgPosition()) { variablePrecision = true; precisionSet = true; } return; - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if (pos > firstPos + 1) - { + if (pos > firstPos + 1) { String sz = fmt.substring(firstPos + 1, pos); precision = Integer.parseInt(sz); @@ -4620,39 +4074,31 @@ /** * Set the field width. */ - private void setFieldWidth() - { + private void setFieldWidth() { int firstPos = pos; fieldWidth = 0; fieldWidthSet = false; - if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) - { + if ((pos < fmt.length()) && (fmt.charAt(pos) == '*')) { pos++; - if (!setFieldWidthArgPosition()) - { + if (!setFieldWidthArgPosition()) { variableFieldWidth = true; fieldWidthSet = true; } - } else - { - while (pos < fmt.length()) - { + } else { + while (pos < fmt.length()) { char c = fmt.charAt(pos); - if (Character.isDigit(c)) - { + if (Character.isDigit(c)) { pos++; - } else - { + } else { break; } } - if ((firstPos < pos) && (firstPos < fmt.length())) - { + if ((firstPos < pos) && (firstPos < fmt.length())) { String sz = fmt.substring(firstPos, pos); fieldWidth = Integer.parseInt(sz); @@ -4664,22 +4110,17 @@ /** * Store the digits <code>n</code> in %n$ forms. */ - private void setArgPosition() - { + private void setArgPosition() { int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalSpecification = true; argumentPosition = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4690,23 +4131,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setFieldWidthArgPosition() - { + private boolean setFieldWidthArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalFieldWidth = true; argumentPositionForFieldWidth = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4720,23 +4156,18 @@ /** * Store the digits <code>n</code> in *n$ forms. */ - private boolean setPrecisionArgPosition() - { + private boolean setPrecisionArgPosition() { boolean ret = false; int xPos; - for (xPos = pos; xPos < fmt.length(); xPos++) - { - if (!Character.isDigit(fmt.charAt(xPos))) - { + for (xPos = pos; xPos < fmt.length(); xPos++) { + if (!Character.isDigit(fmt.charAt(xPos))) { break; } } - if ((xPos > pos) && (xPos < fmt.length())) - { - if (fmt.charAt(xPos) == '$') - { + if ((xPos > pos) && (xPos < fmt.length())) { + if (fmt.charAt(xPos) == '$') { positionalPrecision = true; argumentPositionForPrecision = Integer.parseInt(fmt.substring(pos, xPos)); pos = xPos + 1; @@ -4747,41 +4178,34 @@ return ret; } - boolean isPositionalSpecification() - { + boolean isPositionalSpecification() { return positionalSpecification; } - int getArgumentPosition() - { + int getArgumentPosition() { return argumentPosition; } - boolean isPositionalFieldWidth() - { + boolean isPositionalFieldWidth() { return positionalFieldWidth; } - int getArgumentPositionForFieldWidth() - { + int getArgumentPositionForFieldWidth() { return argumentPositionForFieldWidth; } - boolean isPositionalPrecision() - { + boolean isPositionalPrecision() { return positionalPrecision; } - int getArgumentPositionForPrecision() - { + int getArgumentPositionForPrecision() { return argumentPositionForPrecision; } /** * Set flag characters, one of '-+#0 or a space. */ - private void setFlagCharacters() - { + private void setFlagCharacters() { /* '-+ #0 */ thousands = false; leftJustify = false; @@ -4790,38 +4214,28 @@ alternateForm = false; leadingZeros = false; - for (; pos < fmt.length(); pos++) - { + for (; pos < fmt.length(); pos++) { char c = fmt.charAt(pos); - if (c == '\'') - { + if (c == '\'') { thousands = true; - } else if (c == '-') - { + } else if (c == '-') { leftJustify = true; leadingZeros = false; - } else if (c == '+') - { + } else if (c == '+') { leadingSign = true; leadingSpace = false; - } else if (c == ' ') - { - if (!leadingSign) - { + } else if (c == ' ') { + if (!leadingSign) { leadingSpace = true; } - } else if (c == '#') - { + } else if (c == '#') { alternateForm = true; - } else if (c == '0') - { - if (!leftJustify) - { + } else if (c == '0') { + if (!leftJustify) { leadingZeros = true; } - } else - { + } else { break; } } -- Gitblit v0.0.0-SNAPSHOT