Commit a1820830 authored by raphw's avatar raphw

Make non-checking constructor accessible and deprecate consructor with unused argument

parent ab106301
Pipeline #1238 passed with stage
in 6 minutes and 38 seconds
......@@ -136,13 +136,25 @@ public class ClassReader {
this(classFile, 0, classFile.length);
}
/**
* Constructs a new {@link ClassReader} object.
*
* @param classFileBuffer a byte array containing the JVMS ClassFile structure to be read.
* @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
*/
public ClassReader(final byte[] classFileBuffer, final int classFileOffset) {
this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true);
}
/**
* Constructs a new {@link ClassReader} object.
*
* @param classFileBuffer a byte array containing the JVMS ClassFile structure to be read.
* @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
* @param classFileLength the length in bytes of the ClassFile to be read.
* @deprecated use {@link ClassReader#ClassReader(byte[], int)}.
*/
@Deprecated
public ClassReader(
final byte[] classFileBuffer, final int classFileOffset, final int classFileLength) {
this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true);
......@@ -156,7 +168,7 @@ public class ClassReader {
* @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read.
* @param checkClassVersion whether to check the class version or not.
*/
ClassReader(
protected ClassReader(
final byte[] classFileBuffer, final int classFileOffset, final boolean checkClassVersion) {
this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment