8335939: Hide element writing across the ClassFile API

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-07-23 12:11:47 +00:00
parent e83b4b236e
commit a2a236f904
50 changed files with 263 additions and 360 deletions

View file

@ -33,13 +33,11 @@ import java.lang.constant.MethodTypeDesc;
import java.util.List;
import java.lang.classfile.BootstrapMethodEntry;
import java.lang.classfile.BufWriter;
import java.lang.classfile.ClassBuilder;
import java.lang.classfile.ClassModel;
import jdk.internal.classfile.impl.ClassReaderImpl;
import java.lang.constant.ModuleDesc;
import java.lang.constant.PackageDesc;
import java.lang.classfile.WritableElement;
import jdk.internal.classfile.impl.AbstractPoolEntry.ClassEntryImpl;
import jdk.internal.classfile.impl.AbstractPoolEntry.NameAndTypeEntryImpl;
import jdk.internal.classfile.impl.SplitConstantPool;
@ -61,7 +59,7 @@ import static java.util.Objects.requireNonNull;
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ConstantPoolBuilder
extends ConstantPool, WritableElement<ConstantPool>
extends ConstantPool
permits SplitConstantPool, TemporaryConstantPool {
/**

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
@ -24,7 +24,6 @@
*/
package java.lang.classfile.constantpool;
import java.lang.classfile.WritableElement;
import jdk.internal.javac.PreviewFeature;
/**
@ -34,7 +33,7 @@ import jdk.internal.javac.PreviewFeature;
* @since 22
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface PoolEntry extends WritableElement<PoolEntry>
public sealed interface PoolEntry
permits AnnotationConstantValueEntry, DynamicConstantPoolEntry,
LoadableConstantEntry, MemberRefEntry, ModuleEntry, NameAndTypeEntry,
PackageEntry {