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

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.1
    • EAP_EWP 5.1.0
    • Hibernate
    • None
    • Release Notes
    • 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.
    • 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 }

      Attachments

        Issue Links

          Activity

            People

              shaozliu Strong Liu(刘少壮) (Inactive)
              shaozliu Strong Liu(刘少壮) (Inactive)
              Misty Stanley-Jones Misty Stanley-Jones (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: