aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-12-21 15:56:34 +0100
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-12-21 15:56:34 +0100
commit9161b23b47c5046bec7f27c53145b1ca2fabf8df (patch)
treeabdd22c0727d0f8e94d81fbe174886f2a7ecae5d /bcel-builder
parentffacda77227a11da3bf53ddba1c0fa5746d3e73e (diff)
downloadaspectj-9161b23b47c5046bec7f27c53145b1ca2fabf8df.tar.gz
aspectj-9161b23b47c5046bec7f27c53145b1ca2fabf8df.zip
BCEL: use MAX_CP_ENTRIES from internal class, not from JRE
Instead of importing com.sun.org.apache.bcel.internal.Const, use use org.aspectj.apache.bcel.Constants. The former class is from the internal JRE module 'java.xml' which is not exposed by default. Actually, no existing test failed because of it, but javadoc generation for the AspectJ weaver. Relates to #192. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'bcel-builder')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
index 5b434651e..ba188b064 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
@@ -59,7 +59,6 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import com.sun.org.apache.bcel.internal.Const;
import org.aspectj.apache.bcel.Constants;
import org.aspectj.apache.bcel.generic.ArrayType;
import org.aspectj.apache.bcel.generic.ObjectType;
@@ -294,7 +293,7 @@ public class ConstantPool implements Node {
* This is a redundant measure as the ConstantPoolGen should have already
* reported an error back in the situation.
*/
- final int size = Math.min(poolSize, Const.MAX_CP_ENTRIES);
+ final int size = Math.min(poolSize, Constants.MAX_CP_ENTRIES);
file.writeShort(size);
for (int i = 1; i < size; i++)
if (pool[i] != null)
@@ -425,17 +424,17 @@ public class ConstantPool implements Node {
private void adjustSize() {
// 3 extra spaces are needed as some entries may take 3 slots
- if (poolSize + 3 >= Const.MAX_CP_ENTRIES + 1) {
+ if (poolSize + 3 >= Constants.MAX_CP_ENTRIES + 1) {
throw new IllegalStateException(
"The number of constants " + (poolSize + 3) +
- " is over the size of the constant pool: " + Const.MAX_CP_ENTRIES
+ " is over the size of the constant pool: " + Constants.MAX_CP_ENTRIES
);
}
if (poolSize + 3 >= pool.length) {
Constant[] cs = pool;
int size = cs.length + 8;
// the constant array shall not exceed the size of the constant pool
- size = Math.min(size, Const.MAX_CP_ENTRIES + 1);
+ size = Math.min(size, Constants.MAX_CP_ENTRIES + 1);
pool = new Constant[size];
System.arraycopy(cs, 0, pool, 0, cs.length);
}