chore: constructors should be private

This commit is contained in:
zaaarf 2023-04-12 00:09:44 +02:00
parent a5576ac5e7
commit 61fa43fb8d
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C
3 changed files with 7 additions and 6 deletions

View file

@ -40,13 +40,13 @@ public class ClassContainer {
public final Element elem;
/**
* Public constructor.
* Private constructor, called from {@link #from(Annotation, Function, String, ProcessingEnvironment, ObfuscationMapper)}.
* @param fqn the fully-qualified name of the target class
* @param innerNames an array of Strings containing the path to the inner class, may be null
* @param env the {@link ProcessingEnvironment} to be used to locate the class
* @param mapper the {@link ObfuscationMapper} to be used, may be null
*/
public ClassContainer(String fqn, String[] innerNames, ProcessingEnvironment env, ObfuscationMapper mapper) {
private ClassContainer(String fqn, String[] innerNames, ProcessingEnvironment env, ObfuscationMapper mapper) {
//find and validate
Element elem = env.getElementUtils().getTypeElement(fqn);

View file

@ -55,14 +55,14 @@ public class FieldContainer {
public final VariableElement elem;
/**
* Public constructor.
* Private constructor, called from {@link #from(VariableElement, ProcessingEnvironment, ObfuscationMapper)}.
* @param parent the {@link ClassContainer} representing the parent
* @param name the fully-qualified name of the target field
* @param descriptor the descriptor of the target field, may be null for verifiable fields
* @param env the {@link ProcessingEnvironment} to perform the operation in
* @param mapper the {@link ObfuscationMapper} to be used, may be null
*/
public FieldContainer(
private FieldContainer(
ClassContainer parent, String name, String descriptor,
ProcessingEnvironment env, ObfuscationMapper mapper) {
this.parent = parent;

View file

@ -54,7 +54,8 @@ public class MethodContainer {
public final ExecutableElement elem;
/**
* Public constructor.
* Private constructor, called from
* {@link #from(ExecutableElement, Target, Find, ProcessingEnvironment, ObfuscationMapper)}.
* @param parent the {@link ClassContainer} representing the parent
* @param name the fully-qualified name of the target method
* @param descriptor the descriptor of the target method
@ -62,7 +63,7 @@ public class MethodContainer {
* @param env the {@link ProcessingEnvironment} to perform the operation in
* @param mapper the {@link ObfuscationMapper} to be used, may be null
*/
public MethodContainer(
private MethodContainer(
ClassContainer parent, String name, String descriptor,
boolean strict, ProcessingEnvironment env, ObfuscationMapper mapper) {
this.parent = parent;