Commit a1820830 authored by raphw's avatar raphw
Browse files

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 { ...@@ -136,13 +136,25 @@ public class ClassReader {
this(classFile, 0, classFile.length); 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. * Constructs a new {@link ClassReader} object.
* *
* @param classFileBuffer a byte array containing the JVMS ClassFile structure to be read. * @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 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. * @param classFileLength the length in bytes of the ClassFile to be read.
* @deprecated use {@link ClassReader#ClassReader(byte[], int)}.
*/ */
@Deprecated
public ClassReader( public ClassReader(
final byte[] classFileBuffer, final int classFileOffset, final int classFileLength) { final byte[] classFileBuffer, final int classFileOffset, final int classFileLength) {
this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true); this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true);
...@@ -156,7 +168,7 @@ public class ClassReader { ...@@ -156,7 +168,7 @@ public class ClassReader {
* @param classFileOffset the offset in byteBuffer of the first byte of the ClassFile to be read. * @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. * @param checkClassVersion whether to check the class version or not.
*/ */
ClassReader( protected ClassReader(
final byte[] classFileBuffer, final int classFileOffset, final boolean checkClassVersion) { final byte[] classFileBuffer, final int classFileOffset, final boolean checkClassVersion) {
this.b = classFileBuffer; this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which // Check the class' major_version. This field is after the magic and minor_version fields, which
......
Supports Markdown
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