Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-5409

HHH-5453 ByteCodeHelper.readByteCode won't load classes bigger than a constant size

    XMLWordPrintable

    Details

    • Affects:
      Release Notes
    • Release Notes Text:
      Hide
      Hibernate's <methodname>ByteCodeHelper.readByteCode()</methodname> was previously limited to 409600 bytes, but can now handle an entity class of any size.
      Show
      Hibernate's <methodname>ByteCodeHelper.readByteCode()</methodname> was previously limited to 409600 bytes, but can now handle an entity class of any size.
    • Release Notes Docs Status:
      Documented as Resolved Issue

      Description

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-5453
      ----------------------------------------------
      Although it is unlikely that a class will have more than 409600 bytes, ByteCodeHelper.readByteCode() will fail in this case.
      The programmer's intention was clear: handle any file size; but he or she forgot to add a call to inputStream.read() at the end of the loop

      ...
      r = inputStream.read( buffer );
      while ( r >= buffer.length )

      { byte[] temp = new byte[ classBytes.length + buffer.length ]; System.arraycopy( classBytes, 0, temp, 0, classBytes.length ); System.arraycopy( buffer, 0, temp, classBytes.length, buffer.length ); classBytes = temp; // THERE SHOULD BE A "r = inputStream.read( buffer )" HERE }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  stliu Strong Liu
                  Reporter:
                  stliu Strong Liu
                  Writer:
                  Misty Stanley-Jones
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: