Record Class PackageSplitReport
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.diagnostic.PackageSplitReport
- Record Components:
packageName- the fully qualified package name | 完全限定包名classLoaderNames- the names of ClassLoaders containing classes from this package | 包含此包中类的 ClassLoader 名称列表
Immutable report of a package split across multiple ClassLoaders
跨多个 ClassLoader 拆分的包的不可变报告
Represents a Java package whose classes are spread across two or more ClassLoaders, which violates the Java module system's package uniqueness guarantee and can cause runtime errors or security issues.
表示类分布在两个或多个 ClassLoader 中的 Java 包, 这违反了 Java 模块系统的包唯一性保证,可能导致运行时错误或安全问题。
Features | 主要功能:
- Records split package name and involved loaders - 记录拆分包名和涉及的加载器
- Defensive copies for immutability - 防御性拷贝以保证不可变性
Usage Examples | 使用示例:
PackageSplitReport report = new PackageSplitReport(
"com.example.service",
List.of("appLoader", "pluginLoader")
);
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是 (不可变记录)
- Since:
- JDK 25, opencode-base-classloader V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPackageSplitReport(String packageName, List<String> classLoaderNames) Compact constructor with validation and defensive copies 带验证和防御性拷贝的紧凑构造器 -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassLoaderNamesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepackageNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PackageSplitReport
Compact constructor with validation and defensive copies 带验证和防御性拷贝的紧凑构造器- Throws:
NullPointerException- if any parameter is null | 当任何参数为 null 时IllegalArgumentException- if classLoaderNames has fewer than 2 entries | 当 classLoaderNames 少于 2 个条目时
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
packageName
Returns the value of thepackageNamerecord component.- Returns:
- the value of the
packageNamerecord component
-
classLoaderNames
Returns the value of theclassLoaderNamesrecord component.- Returns:
- the value of the
classLoaderNamesrecord component
-