diff --git a/spring-core/src/main/java/org/springframework/asm/AnnotationVisitor.java b/spring-core/src/main/java/org/springframework/asm/AnnotationVisitor.java
index 5135706880..c3c236aefa 100644
--- a/spring-core/src/main/java/org/springframework/asm/AnnotationVisitor.java
+++ b/spring-core/src/main/java/org/springframework/asm/AnnotationVisitor.java
@@ -38,8 +38,8 @@ package org.springframework.asm;
public abstract class AnnotationVisitor {
/**
- * The ASM API version implemented by this visitor. The value of this field must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * The ASM API version implemented by this visitor. The value of this field must be one of the
+ * {@code ASM}x values in {@link Opcodes}.
*/
protected final int api;
@@ -52,8 +52,8 @@ public abstract class AnnotationVisitor {
/**
* Constructs a new {@link AnnotationVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
*/
public AnnotationVisitor(final int api) {
this(api, null);
@@ -62,8 +62,8 @@ public abstract class AnnotationVisitor {
/**
* Constructs a new {@link AnnotationVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
* @param annotationVisitor the annotation visitor to which this visitor must delegate method
* calls. May be {@literal null}.
*/
diff --git a/spring-core/src/main/java/org/springframework/asm/ByteVector.java b/spring-core/src/main/java/org/springframework/asm/ByteVector.java
index 3789eec3fd..6187c1e22c 100644
--- a/spring-core/src/main/java/org/springframework/asm/ByteVector.java
+++ b/spring-core/src/main/java/org/springframework/asm/ByteVector.java
@@ -352,6 +352,9 @@ public class ByteVector {
* @param size number of additional bytes that this byte vector should be able to receive.
*/
private void enlarge(final int size) {
+ if (length > data.length) {
+ throw new AssertionError("Internal error");
+ }
int doubleCapacity = 2 * data.length;
int minimalCapacity = length + size;
byte[] newData = new byte[doubleCapacity > minimalCapacity ? doubleCapacity : minimalCapacity];
diff --git a/spring-core/src/main/java/org/springframework/asm/ClassVisitor.java b/spring-core/src/main/java/org/springframework/asm/ClassVisitor.java
index b49c3eebce..05b448321a 100644
--- a/spring-core/src/main/java/org/springframework/asm/ClassVisitor.java
+++ b/spring-core/src/main/java/org/springframework/asm/ClassVisitor.java
@@ -40,8 +40,8 @@ package org.springframework.asm;
public abstract class ClassVisitor {
/**
- * The ASM API version implemented by this visitor. The value of this field must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * The ASM API version implemented by this visitor. The value of this field must be one of the
+ * {@code ASM}x values in {@link Opcodes}.
*/
protected final int api;
@@ -51,8 +51,8 @@ public abstract class ClassVisitor {
/**
* Constructs a new {@link ClassVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
*/
public ClassVisitor(final int api) {
this(api, null);
@@ -61,9 +61,8 @@ public abstract class ClassVisitor {
/**
* Constructs a new {@link ClassVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link
- * Opcodes#ASM8} or {@link Opcodes#ASM9}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
* @param classVisitor the class visitor to which this visitor must delegate method calls. May be
* null.
*/
diff --git a/spring-core/src/main/java/org/springframework/asm/FieldVisitor.java b/spring-core/src/main/java/org/springframework/asm/FieldVisitor.java
index 841b4a3cb7..727417045f 100644
--- a/spring-core/src/main/java/org/springframework/asm/FieldVisitor.java
+++ b/spring-core/src/main/java/org/springframework/asm/FieldVisitor.java
@@ -37,9 +37,8 @@ package org.springframework.asm;
public abstract class FieldVisitor {
/**
- * The ASM API version implemented by this visitor. The value of this field must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link
- * Opcodes#ASM8} or {@link Opcodes#ASM9}.
+ * The ASM API version implemented by this visitor. The value of this field must be one of the
+ * {@code ASM}x values in {@link Opcodes}.
*/
protected final int api;
@@ -49,9 +48,8 @@ public abstract class FieldVisitor {
/**
* Constructs a new {@link FieldVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7}, {@link
- * Opcodes#ASM8} or {@link Opcodes#ASM9}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
*/
public FieldVisitor(final int api) {
this(api, null);
@@ -60,9 +58,8 @@ public abstract class FieldVisitor {
/**
* Constructs a new {@link FieldVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7} or {@link
- * Opcodes#ASM8}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
* @param fieldVisitor the field visitor to which this visitor must delegate method calls. May be
* null.
*/
diff --git a/spring-core/src/main/java/org/springframework/asm/MethodVisitor.java b/spring-core/src/main/java/org/springframework/asm/MethodVisitor.java
index ff5ce1056d..15ca4a5e4e 100644
--- a/spring-core/src/main/java/org/springframework/asm/MethodVisitor.java
+++ b/spring-core/src/main/java/org/springframework/asm/MethodVisitor.java
@@ -51,8 +51,8 @@ public abstract class MethodVisitor {
private static final String REQUIRES_ASM5 = "This feature requires ASM5";
/**
- * The ASM API version implemented by this visitor. The value of this field must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * The ASM API version implemented by this visitor. The value of this field must be one of the
+ * {@code ASM}x values in {@link Opcodes}.
*/
protected final int api;
@@ -64,8 +64,8 @@ public abstract class MethodVisitor {
/**
* Constructs a new {@link MethodVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
*/
public MethodVisitor(final int api) {
this(api, null);
@@ -74,8 +74,8 @@ public abstract class MethodVisitor {
/**
* Constructs a new {@link MethodVisitor}.
*
- * @param api the ASM API version implemented by this visitor. Must be one of {@link
- * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
+ * @param api the ASM API version implemented by this visitor. Must be one of the {@code
+ * ASM}x values in {@link Opcodes}.
* @param methodVisitor the method visitor to which this visitor must delegate method calls. May
* be null.
*/