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

Description

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
}
...

Environment

None

Activity

Show:
Strong Liu
November 12, 2010, 4:36 AM
Steve Ebersole
March 21, 2011, 7:08 PM

Bulk closing stale resolved issues

Assignee

Steve Ebersole

Reporter

MarcosM

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure