Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit cea44d6

Browse files
author
Dmitry Cherepanov
committed
8235368: Update BCEL to Version 6.4.1
Reviewed-by: yan Backport-of: e8f8eef
1 parent 7368c4b commit cea44d6

File tree

318 files changed

+2871
-1223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+2871
-1223
lines changed

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/Const.java

Lines changed: 82 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
33
*/
44
/*
55
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,8 +25,8 @@
2525
/**
2626
* Constants for the project, mostly defined in the JVM specification.
2727
*
28-
* @version $Id$
2928
* @since 6.0 (intended to replace the Constants interface)
29+
* @LastModified: Jan 2020
3030
*/
3131
public final class Const {
3232

@@ -180,6 +180,18 @@ public final class Const {
180180
* */
181181
public static final short MINOR_13 = 0;
182182

183+
/** Major version number of class files for Java 14.
184+
* @see #MINOR_14
185+
* @since 6.4.0
186+
* */
187+
public static final short MAJOR_14 = 58;
188+
189+
/** Minor version number of class files for Java 14.
190+
* @see #MAJOR_14
191+
* @since 6.4.0
192+
* */
193+
public static final short MINOR_14 = 0;
194+
183195
/** Default major version number. Class file is for Java 1.1.
184196
* @see #MAJOR_1_1
185197
* */
@@ -199,12 +211,14 @@ public final class Const {
199211
public static final int MAX_BYTE = 255; // 2^8 - 1
200212

201213
/** One of the access flags for fields, methods, or classes.
202-
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5'>
203-
* Flag definitions for Fields in the Java Virtual Machine Specification (Java SE 8 Edition).</a>
204-
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6'>
205-
* Flag definitions for Methods in the Java Virtual Machine Specification (Java SE 8 Edition).</a>
206-
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6-300-D.1-D.1'>
207-
* Flag definitions for Classes in the Java Virtual Machine Specification (Java SE 8 Edition).</a>
214+
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1'>
215+
* Flag definitions for Classes in the Java Virtual Machine Specification (Java SE 9 Edition).</a>
216+
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.5'>
217+
* Flag definitions for Fields in the Java Virtual Machine Specification (Java SE 9 Edition).</a>
218+
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6'>
219+
* Flag definitions for Methods in the Java Virtual Machine Specification (Java SE 9 Edition).</a>
220+
* @see <a href='http://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.6-300-D.1-D.1'>
221+
* Flag definitions for Inner Classes in the Java Virtual Machine Specification (Java SE 9 Edition).</a>
208222
*/
209223
public static final short ACC_PUBLIC = 0x0001;
210224

@@ -228,89 +242,123 @@ public final class Const {
228242
*/
229243
public static final short ACC_FINAL = 0x0010;
230244

231-
/** One of the access flags for fields, methods, or classes.
245+
/** One of the access flags for the Module attribute.
246+
* @see #ACC_PUBLIC
247+
*/
248+
public static final short ACC_OPEN = 0x0020;
249+
250+
/** One of the access flags for classes.
251+
* @see #ACC_PUBLIC
252+
*/
253+
public static final short ACC_SUPER = 0x0020;
254+
255+
/** One of the access flags for methods.
232256
* @see #ACC_PUBLIC
233257
*/
234258
public static final short ACC_SYNCHRONIZED = 0x0020;
235259

236-
/** One of the access flags for fields, methods, or classes.
260+
/** One of the access flags for the Module attribute.
237261
* @see #ACC_PUBLIC
238262
*/
239-
public static final short ACC_VOLATILE = 0x0040;
263+
public static final short ACC_TRANSITIVE = 0x0020;
240264

241-
/** One of the access flags for fields, methods, or classes.
265+
/** One of the access flags for methods.
242266
* @see #ACC_PUBLIC
243267
*/
244268
public static final short ACC_BRIDGE = 0x0040;
245269

246-
/** One of the access flags for fields, methods, or classes.
270+
/** One of the access flags for the Module attribute.
271+
* @see #ACC_PUBLIC
272+
*/
273+
public static final short ACC_STATIC_PHASE = 0x0040;
274+
275+
/** One of the access flags for fields.
276+
* @see #ACC_PUBLIC
277+
*/
278+
public static final short ACC_VOLATILE = 0x0040;
279+
280+
/** One of the access flags for fields.
247281
* @see #ACC_PUBLIC
248282
*/
249283
public static final short ACC_TRANSIENT = 0x0080;
250284

251-
/** One of the access flags for fields, methods, or classes.
285+
/** One of the access flags for methods.
252286
* @see #ACC_PUBLIC
253287
*/
254288
public static final short ACC_VARARGS = 0x0080;
255289

256-
/** One of the access flags for fields, methods, or classes.
290+
/** One of the access flags for methods.
257291
* @see #ACC_PUBLIC
258292
*/
259293
public static final short ACC_NATIVE = 0x0100;
260294

261-
/** One of the access flags for fields, methods, or classes.
295+
/** One of the access flags for classes.
262296
* @see #ACC_PUBLIC
263297
*/
264298
public static final short ACC_INTERFACE = 0x0200;
265299

266-
/** One of the access flags for fields, methods, or classes.
300+
/** One of the access flags for methods or classes.
267301
* @see #ACC_PUBLIC
268302
*/
269303
public static final short ACC_ABSTRACT = 0x0400;
270304

271-
/** One of the access flags for fields, methods, or classes.
305+
/** One of the access flags for methods.
272306
* @see #ACC_PUBLIC
273307
*/
274308
public static final short ACC_STRICT = 0x0800;
275309

276-
/** One of the access flags for fields, methods, or classes.
310+
/** One of the access flags for fields, methods, classes, MethodParameter attribute, or Module attribute.
277311
* @see #ACC_PUBLIC
278312
*/
279313
public static final short ACC_SYNTHETIC = 0x1000;
280314

281-
/** One of the access flags for fields, methods, or classes.
315+
/** One of the access flags for classes.
282316
* @see #ACC_PUBLIC
283317
*/
284318
public static final short ACC_ANNOTATION = 0x2000;
285319

286-
/** One of the access flags for fields, methods, or classes.
320+
/** One of the access flags for fields or classes.
287321
* @see #ACC_PUBLIC
288322
*/
289323
public static final short ACC_ENUM = 0x4000;
290324

291-
/** One of the access flags for fields, methods, or classes.
325+
// Applies to classes compiled by new compilers only
326+
/** One of the access flags for MethodParameter or Module attributes.
292327
* @see #ACC_PUBLIC
293328
*/
294329
public static final short ACC_MANDATED = (short) 0x8000;
295330

296-
// Applies to classes compiled by new compilers only
297-
/** One of the access flags for fields, methods, or classes.
331+
/** One of the access flags for classes.
298332
* @see #ACC_PUBLIC
299333
*/
300-
public static final short ACC_SUPER = 0x0020;
334+
public static final short ACC_MODULE = (short) 0x8000;
301335

302336
/** One of the access flags for fields, methods, or classes.
303337
* @see #ACC_PUBLIC
338+
* @deprecated Use {@link #MAX_ACC_FLAG_I}
304339
*/
340+
@Deprecated
305341
public static final short MAX_ACC_FLAG = ACC_ENUM;
306342

343+
/** One of the access flags for fields, methods, or classes.
344+
* ACC_MODULE is negative as a short.
345+
* @see #ACC_PUBLIC
346+
* @since 6.4.0
347+
*/
348+
public static final int MAX_ACC_FLAG_I = 0x8000; // ACC_MODULE is negative as a short
349+
350+
// Note that do to overloading:
351+
// 'synchronized' is for methods, might be 'open' (if Module), 'super' (if class), or 'transitive' (if Module).
352+
// 'volatile' is for fields, might be 'bridge' (if method) or 'static_phase' (if Module)
353+
// 'transient' is for fields, might be 'varargs' (if method)
354+
// 'module' is for classes, might be 'mandated' (if Module or MethodParameters)
307355
/**
308356
* The names of the access flags.
309357
*/
310358
private static final String[] ACCESS_NAMES = {
311359
"public", "private", "protected", "static", "final", "synchronized",
312360
"volatile", "transient", "native", "interface", "abstract", "strictfp",
313-
"synthetic", "annotation", "enum"
361+
"synthetic", "annotation", "enum", "module"
314362
};
315363

316364
/** @since 6.0 */
@@ -2279,8 +2327,13 @@ public static int getProduceStack(final int index) {
22792327
public static final byte ATTR_STACK_MAP_TABLE = 19;
22802328
public static final byte ATTR_BOOTSTRAP_METHODS = 20;
22812329
public static final byte ATTR_METHOD_PARAMETERS = 21;
2330+
public static final byte ATTR_MODULE = 22;
2331+
public static final byte ATTR_MODULE_PACKAGES = 23;
2332+
public static final byte ATTR_MODULE_MAIN_CLASS = 24;
2333+
public static final byte ATTR_NEST_HOST = 25;
2334+
public static final byte ATTR_NEST_MEMBERS = 26;
22822335

2283-
public static final short KNOWN_ATTRIBUTES = 22; // count of attributes
2336+
public static final short KNOWN_ATTRIBUTES = 27; // count of attributes
22842337

22852338
private static final String[] ATTRIBUTE_NAMES = {
22862339
"SourceFile", "ConstantValue", "Code", "Exceptions",
@@ -2290,7 +2343,8 @@ public static int getProduceStack(final int index) {
22902343
"RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations",
22912344
"RuntimeVisibleParameterAnnotations", "RuntimeInvisibleParameterAnnotations",
22922345
"AnnotationDefault", "LocalVariableTypeTable", "EnclosingMethod", "StackMapTable",
2293-
"BootstrapMethods", "MethodParameters"
2346+
"BootstrapMethods", "MethodParameters", "Module", "ModulePackages",
2347+
"ModuleMainClass", "NestHost", "NestMembers"
22942348
};
22952349

22962350
/**

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/ExceptionConst.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
33
*/
44
/*
55
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,7 +23,7 @@
2323
/**
2424
* Exception constants.
2525
* @since 6.0 (intended to replace the InstructionConstant interface)
26-
* @LastModified: Oct 2017
26+
* @LastModified: Jan 2020
2727
*/
2828
public final class ExceptionConst {
2929

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/Repository.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
33
*/
44
/*
55
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -31,30 +31,32 @@
3131
* @see com.sun.org.apache.bcel.internal.util.Repository
3232
* @see SyntheticRepository
3333
*
34-
* @version $Id$
35-
* @LastModified: Jun 2019
34+
* @LastModified: Jan 2020
3635
*/
3736
public abstract class Repository {
3837

3938
private static com.sun.org.apache.bcel.internal.util.Repository repository
4039
= SyntheticRepository.getInstance();
4140

4241

43-
/** @return currently used repository instance
42+
/**
43+
* @return currently used repository instance
4444
*/
4545
public static com.sun.org.apache.bcel.internal.util.Repository getRepository() {
4646
return repository;
4747
}
4848

4949

50-
/** Set repository instance to be used for class loading
50+
/**
51+
* Sets repository instance to be used for class loading
5152
*/
5253
public static void setRepository( final com.sun.org.apache.bcel.internal.util.Repository rep ) {
5354
repository = rep;
5455
}
5556

5657

57-
/** Lookup class somewhere found on your CLASSPATH, or whereever the
58+
/**
59+
* Lookups class somewhere found on your CLASSPATH, or whereever the
5860
* repository instance looks for it.
5961
*
6062
* @return class object for given fully qualified class name
@@ -67,7 +69,8 @@ public static JavaClass lookupClass( final String class_name ) throws ClassNotFo
6769

6870

6971
/**
70-
* Try to find class source using the internal repository instance.
72+
* Tries to find class source using the internal repository instance.
73+
*
7174
* @see Class
7275
* @return JavaClass object for given runtime class
7376
* @throws ClassNotFoundException if the class could not be found or
@@ -87,7 +90,7 @@ public static void clearCache() {
8790

8891

8992
/**
90-
* Add clazz to repository if there isn't an equally named class already in there.
93+
* Adds clazz to repository if there isn't an equally named class already in there.
9194
*
9295
* @return old entry in repository
9396
*/
@@ -99,15 +102,15 @@ public static JavaClass addClass( final JavaClass clazz ) {
99102

100103

101104
/**
102-
* Remove class with given (fully qualified) name from repository.
105+
* Removes class with given (fully qualified) name from repository.
103106
*/
104107
public static void removeClass( final String clazz ) {
105108
repository.removeClass(repository.findClass(clazz));
106109
}
107110

108111

109112
/**
110-
* Remove given class from repository.
113+
* Removes given class from repository.
111114
*/
112115
public static void removeClass( final JavaClass clazz ) {
113116
repository.removeClass(clazz);

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/AccessFlags.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
33
*/
44
/*
55
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,8 +25,7 @@
2525
* Super class for all objects that have modifiers like private, final, ... I.e.
2626
* classes, fields, and methods.
2727
*
28-
* @version $Id$
29-
* @LastModified: Jun 2019
28+
* @LastModified: Jan 2020
3029
*/
3130
public abstract class AccessFlags {
3231

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/AnnotationDefault.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
/**
3131
* Represents the default value of a annotation for a method info
3232
*
33-
* @version $Id: AnnotationDefault 1 2005-02-13 03:15:08Z dbrosius $
3433
* @since 6.0
3534
*/
3635
public class AnnotationDefault extends Attribute {

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/AnnotationEntry.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
/**
3434
* represents one annotation in the annotation table
3535
*
36-
* @version $Id: AnnotationEntry
3736
* @since 6.0
3837
*/
3938
public class AnnotationEntry implements Node {

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/Annotations.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
/**
2929
* base class for annotations
3030
*
31-
* @version $Id: Annotations
3231
* @since 6.0
3332
*/
3433
public abstract class Annotations extends Attribute {

0 commit comments

Comments
 (0)