Condition for non-latin1 string size too large exception is off by one

XMLWordPrintable

    • b02

        The compact strings implementation of java.lang.String in StringUTF16.newBytesFor checks the length of non-latin1 strings against MAX_LENGTH.
        The exception message says "should be less than" is correct but does not match the code.
        If the length is exactly MAX_LENGTH the array cannot be allocated, throwing java.lang.OutOfMemoryError: Requested array size exceeds VM limit

              Assignee:
              Roger Riggs
              Reporter:
              Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: