Skip to content

Commit 80e17f5

Browse files
committed
Fixes, roll back package info
1 parent dcf07ff commit 80e17f5

File tree

4 files changed

+379
-141
lines changed

4 files changed

+379
-141
lines changed

Diff for: src/java.base/share/classes/java/lang/classfile/ClassBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ default ClassBuilder withField(String name,
239239
* {@snippet lang=java :
240240
* // @link substring=withField target="#withField(Utf8Entry, Utf8Entry, Consumer)" :
241241
* withField(field.fieldName(), field.fieldType(),
242-
* b -> b.transform(field, transform)) // @link regex="transform(?=\()" target="FieldBuilder#transform"
242+
* fb -> fb.transform(field, transform)) // @link regex="transform(?=\()" target="FieldBuilder#transform"
243243
* }
244244
*
245245
* @param field the field to be transformed
@@ -351,7 +351,7 @@ default ClassBuilder withMethodBody(String name,
351351
* {@snippet lang=java :
352352
* // @link substring=withMethod target="#withMethod(Utf8Entry, Utf8Entry, int, Consumer)" :
353353
* withMethod(method.methodName(), method.methodType(), method.flags().flagMask(),
354-
* mb -> mb.transform(method, transform)) // @link regex=transform(?=\() target=MethodBuilder#transform
354+
* mb -> mb.transform(method, transform)) // @link regex="transform(?=\()" target="MethodBuilder#transform"
355355
* }
356356
*
357357
* @param method the method to be transformed

Diff for: src/java.base/share/classes/java/lang/classfile/ClassFile.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -667,16 +667,16 @@ default void buildModuleTo(Path path,
667667
* this class, as well as a {@link ClassBuilder} for building the new class.
668668
* The transform is free to preserve, remove, or replace elements as it
669669
* sees fit.
670-
*
671-
* @apiNote
670+
* <p>
672671
* This method behaves as if:
673672
* {@snippet lang=java :
674673
* ConstantPoolBuilder cpb = null; // @replace substring=null; replacement=...
675674
* this.build(model.thisClass(), cpb,
676675
* clb -> clb.transform(model, transform));
677676
* }
678677
* where {@code cpb} is determined by {@link ConstantPoolSharingOption}.
679-
* <p>
678+
*
679+
* @apiNote
680680
* This is named {@code transformClass} instead of {@code transform} for
681681
* consistency with {@link ClassBuilder#transformField}, {@link
682682
* ClassBuilder#transformMethod}, and {@link MethodBuilder#transformCode},
@@ -724,15 +724,15 @@ default byte[] transformClass(ClassModel model, ClassDesc newClassName, ClassTra
724724
* this class, as well as a {@link ClassBuilder} for building the new class.
725725
* The transform is free to preserve, remove, or replace elements as it
726726
* sees fit.
727-
*
728-
* @apiNote
727+
* <p>
729728
* This method behaves as if:
730729
* {@snippet lang=java :
731730
* ConstantPoolBuilder cpb = null; // @replace substring=null; replacement=...
732731
* this.build(newClassName, cpb, clb -> clb.transform(model, transform));
733732
* }
734733
* where {@code cpb} is determined by {@link ConstantPoolSharingOption}.
735-
* <p>
734+
*
735+
* @apiNote
736736
* This is named {@code transformClass} instead of {@code transform} for
737737
* consistency with {@link ClassBuilder#transformField}, {@link
738738
* ClassBuilder#transformMethod}, and {@link MethodBuilder#transformCode},

Diff for: src/java.base/share/classes/java/lang/classfile/CodeBuilder.java

+27-16
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ default CodeBuilder aastore() {
10331033
* Generates an instruction to load a {@link TypeKind#REFERENCE reference}
10341034
* from a local variable.
10351035
* <p>
1036-
* This may also generate {@link Opcode#ALOAD_0 aload_<N>} and {@link
1036+
* This may also generate {@link Opcode#ALOAD_0 aload_&lt;N&gt;} and {@link
10371037
* Opcode#ALOAD_W wide aload} instructions.
10381038
*
10391039
* @param slot the local variable slot
@@ -1103,8 +1103,8 @@ default CodeBuilder arraylength() {
11031103
* into a local variable. Such an instruction can also store a {@link
11041104
* TypeKind##returnAddress returnAddress}.
11051105
* <p>
1106-
* This may also generate {@link Opcode#ASTORE_0 astore_<N>} and {@link
1107-
* Opcode#ASTORE_W wide astore} instructions.
1106+
* This may also generate {@link Opcode#ASTORE_0 astore_&lt;N&gt;} and
1107+
* {@link Opcode#ASTORE_W wide astore} instructions.
11081108
*
11091109
* @param slot the local variable slot
11101110
* @return this builder
@@ -1359,7 +1359,7 @@ default CodeBuilder ddiv() {
13591359
* Generates an instruction to load a {@link TypeKind#DOUBLE double} from a
13601360
* local variable.
13611361
* <p>
1362-
* This may also generate {@link Opcode#DLOAD_0 dload_<N>} and {@link
1362+
* This may also generate {@link Opcode#DLOAD_0 dload_&lt;N&gt;} and {@link
13631363
* Opcode#DLOAD_W wide dload} instructions.
13641364
*
13651365
* @param slot the local variable slot
@@ -1424,8 +1424,8 @@ default CodeBuilder dreturn() {
14241424
* Generates an instruction to store a {@link TypeKind#DOUBLE double} into a
14251425
* local variable.
14261426
* <p>
1427-
* This may also generate {@link Opcode#DSTORE_0 dstore_<N>} and {@link
1428-
* Opcode#DSTORE_W wide dstore} instructions.
1427+
* This may also generate {@link Opcode#DSTORE_0 dstore_&lt;N&gt;} and
1428+
* {@link Opcode#DSTORE_W wide dstore} instructions.
14291429
*
14301430
* @param slot the local variable slot
14311431
* @return this builder
@@ -1671,7 +1671,7 @@ default CodeBuilder fdiv() {
16711671
* Generates an instruction to load a {@link TypeKind#FLOAT float} from a
16721672
* local variable.
16731673
* <p>
1674-
* This may also generate {@link Opcode#FLOAD_0 fload_<N>} and {@link
1674+
* This may also generate {@link Opcode#FLOAD_0 fload_&lt;N&gt;} and {@link
16751675
* Opcode#FLOAD_W wide fload} instructions.
16761676
*
16771677
* @param slot the local variable slot
@@ -1736,8 +1736,8 @@ default CodeBuilder freturn() {
17361736
* Generates an instruction to store a {@link TypeKind#FLOAT float} into a
17371737
* local variable.
17381738
* <p>
1739-
* This may also generate {@link Opcode#FSTORE_0 fstore_<N>} and {@link
1740-
* Opcode#FSTORE_W wide fstore} instructions.
1739+
* This may also generate {@link Opcode#FSTORE_0 fstore_&lt;N&gt;} and
1740+
* {@link Opcode#FSTORE_W wide fstore} instructions.
17411741
*
17421742
* @param slot the local variable slot
17431743
* @return this builder
@@ -2173,6 +2173,7 @@ default CodeBuilder if_icmpgt(Label target) {
21732173
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
21742174
*
21752175
* @param target the branch target
2176+
* @return this builder
21762177
* @see Opcode#IF_ICMPLE
21772178
* @see #branch(Opcode, Label)
21782179
* @see BranchInstruction
@@ -2190,6 +2191,7 @@ default CodeBuilder if_icmple(Label target) {
21902191
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
21912192
*
21922193
* @param target the branch target
2194+
* @return this builder
21932195
* @see Opcode#IF_ICMPLT
21942196
* @see #branch(Opcode, Label)
21952197
* @see BranchInstruction
@@ -2207,6 +2209,7 @@ default CodeBuilder if_icmplt(Label target) {
22072209
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22082210
*
22092211
* @param target the branch target
2212+
* @return this builder
22102213
* @see Opcode#IF_ICMPNE
22112214
* @see #branch(Opcode, Label)
22122215
* @see BranchInstruction
@@ -2224,6 +2227,7 @@ default CodeBuilder if_icmpne(Label target) {
22242227
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22252228
*
22262229
* @param target the branch target
2230+
* @return this builder
22272231
* @see Opcode#IFNONNULL
22282232
* @see #branch(Opcode, Label)
22292233
* @see BranchInstruction
@@ -2241,6 +2245,7 @@ default CodeBuilder ifnonnull(Label target) {
22412245
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22422246
*
22432247
* @param target the branch target
2248+
* @return this builder
22442249
* @see Opcode#IFNULL
22452250
* @see #branch(Opcode, Label)
22462251
* @see BranchInstruction
@@ -2258,6 +2263,7 @@ default CodeBuilder ifnull(Label target) {
22582263
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22592264
*
22602265
* @param target the branch target
2266+
* @return this builder
22612267
* @see Opcode#IFEQ
22622268
* @see #branch(Opcode, Label)
22632269
* @see BranchInstruction
@@ -2275,6 +2281,7 @@ default CodeBuilder ifeq(Label target) {
22752281
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22762282
*
22772283
* @param target the branch target
2284+
* @return this builder
22782285
* @see Opcode#IFGE
22792286
* @see #branch(Opcode, Label)
22802287
* @see BranchInstruction
@@ -2292,6 +2299,7 @@ default CodeBuilder ifge(Label target) {
22922299
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
22932300
*
22942301
* @param target the branch target
2302+
* @return this builder
22952303
* @see Opcode#IFGT
22962304
* @see #branch(Opcode, Label)
22972305
* @see BranchInstruction
@@ -2309,6 +2317,7 @@ default CodeBuilder ifgt(Label target) {
23092317
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
23102318
*
23112319
* @param target the branch target
2320+
* @return this builder
23122321
* @see Opcode#IFLE
23132322
* @see #branch(Opcode, Label)
23142323
* @see BranchInstruction
@@ -2326,6 +2335,7 @@ default CodeBuilder ifle(Label target) {
23262335
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
23272336
*
23282337
* @param target the branch target
2338+
* @return this builder
23292339
* @see Opcode#IFLT
23302340
* @see #branch(Opcode, Label)
23312341
* @see BranchInstruction
@@ -2343,6 +2353,7 @@ default CodeBuilder iflt(Label target) {
23432353
* target} cannot be encoded as a BCI offset in {@code [-32768, 32767]}.
23442354
*
23452355
* @param target the branch target
2356+
* @return this builder
23462357
* @see Opcode#IFNE
23472358
* @see #branch(Opcode, Label)
23482359
* @see BranchInstruction
@@ -2374,8 +2385,8 @@ default CodeBuilder iinc(int slot, int val) {
23742385
* Generates an instruction to load an {@link TypeKind#INT int} from a local
23752386
* variable.
23762387
* <p>
2377-
* This may also generate {@link Opcode#ILOAD_0 iload_<N>} and
2378-
* {@link Opcode#ILOAD_W wide iload} instructions.
2388+
* This may also generate {@link Opcode#ILOAD_0 iload_&lt;N&gt;} and {@link
2389+
* Opcode#ILOAD_W wide iload} instructions.
23792390
*
23802391
* @param slot the local variable slot
23812392
* @return this builder
@@ -2727,7 +2738,7 @@ default CodeBuilder ishr() {
27272738
* Generates an instruction to store an {@link TypeKind#INT int} into a
27282739
* local variable.
27292740
* <p>
2730-
* This may also generate {@link Opcode#ISTORE_0 istore_<N>} and
2741+
* This may also generate {@link Opcode#ISTORE_0 istore_&lt;N&gt;} and
27312742
* {@link Opcode#ISTORE_W wide istore} instructions.
27322743
*
27332744
* @param slot the local variable slot
@@ -2965,8 +2976,8 @@ default CodeBuilder ldiv() {
29652976
* Generates an instruction to load a {@link TypeKind#LONG long} from a
29662977
* local variable.
29672978
* <p>
2968-
* This may also generate {@link Opcode#LLOAD_0 lload_<N>} and
2969-
* {@link Opcode#LLOAD_W wide lload} instructions.
2979+
* This may also generate {@link Opcode#LLOAD_0 lload_&lt;N&gt;} and {@link
2980+
* Opcode#LLOAD_W wide lload} instructions.
29702981
*
29712982
* @param slot the local variable slot
29722983
* @return this builder
@@ -3067,8 +3078,8 @@ default CodeBuilder lshr() {
30673078
* Generates an instruction to store a {@link TypeKind#LONG long} into a
30683079
* local variable.
30693080
* <p>
3070-
* This may also generate {@link Opcode#LSTORE_0 lstore_<N>} and {@link
3071-
* Opcode#LSTORE_W wide lstore} instructions.
3081+
* This may also generate {@link Opcode#LSTORE_0 lstore_&lt;N&gt;} and
3082+
* {@link Opcode#LSTORE_W wide lstore} instructions.
30723083
*
30733084
* @param slot the local variable slot
30743085
* @return this builder

0 commit comments

Comments
 (0)