Skip to content

Commit 04d7f5b

Browse files
committed
Better Javadoc for org.apache.bcel.Const.MAX_CODE_SIZE
1 parent 0f1dcf7 commit 04d7f5b

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

src/main/java/org/apache/bcel/Const.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -845,20 +845,22 @@ public final class Const {
845845
public static final int MAX_CP_ENTRIES = 65535;
846846

847847
/**
848-
* Maximum code size (plus one; the code size must be LESS than this): {@value}.
848+
* Maximum code size plus one; the code size must be LESS than {@value}.
849849
* <p>
850-
* One of the limitations of the Java Virtual Machine. Note vmspec2 page 152 ("Limitations") says:
851-
* </p>
852-
* <pre>"The amount of code per non-native, non-abstract method is limited to 65536 bytes by the sizes of the indices in the exception_table of the Code
853-
* attribute (§4.7.3), in the LineNumberTable attribute (§4.7.8), and in the LocalVariableTable attribute (§4.7.9)." However this should be taken as an
854-
* upper limit rather than the defined maximum. On page 134 (4.8.1 Static Constants) of the same spec, it says: "The value of the code_length item must be
855-
* less than 65536."</pre>
856-
* <p>
857-
* The entry in the Limitations section has been removed from later versions of the specification; it is not present in the Java SE 8 edition.
850+
* This limitation is from <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3"> The Java Virtual Machine
851+
* Specification, Java SE 8 Edition, 4.7.3 The Code Attribute.</a>:
858852
* </p>
859853
*
860-
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3-300-E"> The Java Virtual Machine Specification, Java SE 8
861-
* Edition, page 104, chapter 4.7.</a>
854+
* <pre>
855+
* code_length
856+
*
857+
* The value of the code_length item gives the number of bytes in the code array for this method.
858+
*
859+
* The value of code_length must be greater than zero (as the code array must not be empty) and less than 65536"
860+
* </pre>
861+
*
862+
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3"> The Java Virtual Machine Specification, Java SE 8
863+
* Edition, 4.7.3 The Code Attribute.</a>
862864
*/
863865
public static final int MAX_CODE_SIZE = 65536; // bytes
864866

0 commit comments

Comments
 (0)