8335938: Review XxxBuilder.original and XxxModel.parent

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-07-23 04:59:58 +00:00
parent aabec4a947
commit 22914e0774
12 changed files with 12 additions and 92 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@ import java.lang.constant.ClassDesc;
import java.lang.constant.MethodTypeDesc;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.lang.classfile.constantpool.ClassEntry;
@ -58,12 +57,6 @@ public sealed interface ClassBuilder
extends ClassFileBuilder<ClassElement, ClassBuilder>
permits ChainedClassBuilder, DirectClassBuilder {
/**
* {@return the {@link ClassModel} representing the class being transformed,
* if this class builder represents the transformation of some {@link ClassModel}}
*/
Optional<ClassModel> original();
/**
* Sets the classfile version.
* @param major the major version number

View file

@ -128,12 +128,6 @@ public sealed interface CodeBuilder
extends ClassFileBuilder<CodeElement, CodeBuilder>
permits CodeBuilder.BlockCodeBuilder, ChainedCodeBuilder, TerminalCodeBuilder, NonterminalCodeBuilder {
/**
* {@return the {@link CodeModel} representing the method body being transformed,
* if this code builder represents the transformation of some {@link CodeModel}}
*/
Optional<CodeModel> original();
/** {@return a fresh unbound label} */
Label newLabel();

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@ import jdk.internal.classfile.impl.ChainedFieldBuilder;
import jdk.internal.classfile.impl.TerminalFieldBuilder;
import java.lang.reflect.AccessFlag;
import java.util.Optional;
import java.util.function.Consumer;
import jdk.internal.javac.PreviewFeature;
@ -68,9 +67,4 @@ public sealed interface FieldBuilder
return with(AccessFlags.ofField(flags));
}
/**
* {@return the {@link FieldModel} representing the field being transformed,
* if this field builder represents the transformation of some {@link FieldModel}}
*/
Optional<FieldModel> original();
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,6 @@
package java.lang.classfile;
import java.util.Optional;
import java.util.function.Consumer;
import java.lang.classfile.constantpool.Utf8Entry;
@ -50,12 +49,6 @@ public sealed interface MethodBuilder
extends ClassFileBuilder<MethodElement, MethodBuilder>
permits ChainedMethodBuilder, TerminalMethodBuilder {
/**
* {@return the {@link MethodModel} representing the method being transformed,
* if this method builder represents the transformation of some {@link MethodModel}}
*/
Optional<MethodModel> original();
/**
* Sets the method access flags.
* @param flags the access flags, as a bit mask