Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2366

Refactor: org.apache.wicket.util.string.Strings#fromEscapedUnicode(String escapedUnicodeString)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4-RC5, 1.4-RC6, 1.4-RC7, 1.4.0
    • 1.4.0
    • None
    • None
    • trunk

    Description

      trying to understand the code I failed to see in which case the first two if statments hold true.
      this smells so bad, I didn't check beyond.

      public static String fromEscapedUnicode(String escapedUnicodeString)
      {
      int off = 0;
      char[] in = escapedUnicodeString.toCharArray();
      int len = in.length;
      char[] convtBuf = new char[len];

      if (convtBuf.length < len)
      {
      int newLen = len * 2;
      if (newLen < 0)

      { newLen = Integer.MAX_VALUE; }

      convtBuf = new char[newLen];
      }
      [...]

      Attachments

        Activity

          People

            jcompagner Johan Compagner
            funkattack Martin Funk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: