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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.3.0.GA_CP10
    • 4.2.0.GA_CP09, 4.3.0.GA_CP08, EAP_EWP 5.1.0, 4.3.0.GA_CP09
    • Hibernate
    • None
    • Release Notes
    • Hide
      Hibernate's <methodname>ByteCodeHelper.readByteCode()</methodname> can now handle an entity class of any size. Previously, it was limited to 409600 bytes, due to a bug in the method.
      Show
      Hibernate's <methodname>ByteCodeHelper.readByteCode()</methodname> can now handle an entity class of any size. Previously, it was limited to 409600 bytes, due to a bug in the method.
    • Documented as Resolved Issue

      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 }

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

              Created:
              Updated:
              Resolved: