From d06b6211bc0815c36d44c65312c097058901b1c5 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 24 Jan 2024 17:16:50 +0100 Subject: [PATCH] chore: internal reorganisation (breaking) --- .../ftbsc/lll/exceptions/InstructionMismatchException.java | 2 +- src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java | 2 +- src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java | 2 +- src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java | 5 ++--- .../java/ftbsc/lll/{tools => utils}/DescriptorBuilder.java | 2 +- src/main/java/ftbsc/lll/{tools => utils}/InsnSequence.java | 2 +- src/main/java/ftbsc/lll/{tools => utils}/PatternMatcher.java | 2 +- .../lll/{tools/StackTools.java => utils/StackUtils.java} | 4 ++-- .../ftbsc/lll/{tools => utils}/debug/BytecodePrinter.java | 4 ++-- .../ftbsc/lll/{tools => utils}/nodes/FieldProxyInsnNode.java | 2 +- .../lll/{tools => utils}/nodes/MethodProxyInsnNode.java | 2 +- .../ftbsc/lll/{tools => utils}/nodes/TypeProxyInsnNode.java | 2 +- 12 files changed, 15 insertions(+), 16 deletions(-) rename src/main/java/ftbsc/lll/{tools => utils}/DescriptorBuilder.java (99%) rename src/main/java/ftbsc/lll/{tools => utils}/InsnSequence.java (99%) rename src/main/java/ftbsc/lll/{tools => utils}/PatternMatcher.java (99%) rename src/main/java/ftbsc/lll/{tools/StackTools.java => utils/StackUtils.java} (98%) rename src/main/java/ftbsc/lll/{tools => utils}/debug/BytecodePrinter.java (98%) rename src/main/java/ftbsc/lll/{tools => utils}/nodes/FieldProxyInsnNode.java (95%) rename src/main/java/ftbsc/lll/{tools => utils}/nodes/MethodProxyInsnNode.java (95%) rename src/main/java/ftbsc/lll/{tools => utils}/nodes/TypeProxyInsnNode.java (95%) diff --git a/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java b/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java index 33c4b35..ff04ef6 100644 --- a/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java +++ b/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java @@ -1,6 +1,6 @@ package ftbsc.lll.exceptions; -import ftbsc.lll.tools.InsnSequence; +import ftbsc.lll.utils.InsnSequence; /** * Thrown when attempting to build an {@link InsnSequence} between two diff --git a/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java b/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java index 62525bc..75b7fbc 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java @@ -7,7 +7,7 @@ import org.objectweb.asm.Type; import java.lang.reflect.Field; -import static ftbsc.lll.tools.DescriptorBuilder.nameToDescriptor; +import static ftbsc.lll.utils.DescriptorBuilder.nameToDescriptor; /** * A container for information about class fields to be used diff --git a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java index a1306f7..d3f0ce3 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java @@ -10,7 +10,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static ftbsc.lll.tools.DescriptorBuilder.nameToDescriptor; +import static ftbsc.lll.utils.DescriptorBuilder.nameToDescriptor; /** * A container for information about class methods to be used diff --git a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java index 022a286..680db9b 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java @@ -1,13 +1,12 @@ package ftbsc.lll.proxies.impl; -import ftbsc.lll.proxies.AbstractProxy; import ftbsc.lll.proxies.ProxyType; import ftbsc.lll.proxies.QualifiableProxy; import org.objectweb.asm.Type; import java.lang.reflect.Modifier; -import static ftbsc.lll.tools.DescriptorBuilder.nameToDescriptor; +import static ftbsc.lll.utils.DescriptorBuilder.nameToDescriptor; /** * A container for information about classes to be used @@ -123,4 +122,4 @@ public class TypeProxy extends QualifiableProxy { public boolean equals(Object obj) { return obj instanceof TypeProxy && super.equals(obj); } -} \ No newline at end of file +} diff --git a/src/main/java/ftbsc/lll/tools/DescriptorBuilder.java b/src/main/java/ftbsc/lll/utils/DescriptorBuilder.java similarity index 99% rename from src/main/java/ftbsc/lll/tools/DescriptorBuilder.java rename to src/main/java/ftbsc/lll/utils/DescriptorBuilder.java index 1b33790..541497b 100644 --- a/src/main/java/ftbsc/lll/tools/DescriptorBuilder.java +++ b/src/main/java/ftbsc/lll/utils/DescriptorBuilder.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools; +package ftbsc.lll.utils; import org.objectweb.asm.Type; diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/utils/InsnSequence.java similarity index 99% rename from src/main/java/ftbsc/lll/tools/InsnSequence.java rename to src/main/java/ftbsc/lll/utils/InsnSequence.java index d00292e..4734505 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/utils/InsnSequence.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools; +package ftbsc.lll.utils; import ftbsc.lll.exceptions.InstructionMismatchException; import org.objectweb.asm.tree.AbstractInsnNode; diff --git a/src/main/java/ftbsc/lll/tools/PatternMatcher.java b/src/main/java/ftbsc/lll/utils/PatternMatcher.java similarity index 99% rename from src/main/java/ftbsc/lll/tools/PatternMatcher.java rename to src/main/java/ftbsc/lll/utils/PatternMatcher.java index fff84db..9518749 100644 --- a/src/main/java/ftbsc/lll/tools/PatternMatcher.java +++ b/src/main/java/ftbsc/lll/utils/PatternMatcher.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools; +package ftbsc.lll.utils; import ftbsc.lll.exceptions.PatternNotFoundException; import org.objectweb.asm.tree.AbstractInsnNode; diff --git a/src/main/java/ftbsc/lll/tools/StackTools.java b/src/main/java/ftbsc/lll/utils/StackUtils.java similarity index 98% rename from src/main/java/ftbsc/lll/tools/StackTools.java rename to src/main/java/ftbsc/lll/utils/StackUtils.java index f055ee2..225b1ee 100644 --- a/src/main/java/ftbsc/lll/tools/StackTools.java +++ b/src/main/java/ftbsc/lll/utils/StackUtils.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools; +package ftbsc.lll.utils; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; @@ -10,7 +10,7 @@ import java.util.Comparator; * Includes anything from instantiation to variable manipulation - just about * anything that loads stuff on or from the stack. */ -public class StackTools implements Opcodes { +public class StackUtils implements Opcodes { /** * Creates a new instance of an object, given its internal name, constructor descriptor and instructions to load * the parameters. diff --git a/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java b/src/main/java/ftbsc/lll/utils/debug/BytecodePrinter.java similarity index 98% rename from src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java rename to src/main/java/ftbsc/lll/utils/debug/BytecodePrinter.java index b6dd8db..c58fba4 100644 --- a/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java +++ b/src/main/java/ftbsc/lll/utils/debug/BytecodePrinter.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools.debug; +package ftbsc.lll.utils.debug; import org.apache.logging.log4j.Logger; import org.objectweb.asm.tree.AbstractInsnNode; @@ -76,4 +76,4 @@ public class BytecodePrinter { PRINTER.getText().clear(); return sw.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java b/src/main/java/ftbsc/lll/utils/nodes/FieldProxyInsnNode.java similarity index 95% rename from src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java rename to src/main/java/ftbsc/lll/utils/nodes/FieldProxyInsnNode.java index d1ac595..e809ccd 100644 --- a/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java +++ b/src/main/java/ftbsc/lll/utils/nodes/FieldProxyInsnNode.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools.nodes; +package ftbsc.lll.utils.nodes; import ftbsc.lll.proxies.impl.FieldProxy; import org.objectweb.asm.tree.FieldInsnNode; diff --git a/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java b/src/main/java/ftbsc/lll/utils/nodes/MethodProxyInsnNode.java similarity index 95% rename from src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java rename to src/main/java/ftbsc/lll/utils/nodes/MethodProxyInsnNode.java index 73a26d7..2e062f4 100644 --- a/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java +++ b/src/main/java/ftbsc/lll/utils/nodes/MethodProxyInsnNode.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools.nodes; +package ftbsc.lll.utils.nodes; import ftbsc.lll.proxies.impl.MethodProxy; import org.objectweb.asm.tree.MethodInsnNode; diff --git a/src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java b/src/main/java/ftbsc/lll/utils/nodes/TypeProxyInsnNode.java similarity index 95% rename from src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java rename to src/main/java/ftbsc/lll/utils/nodes/TypeProxyInsnNode.java index 9e78dc9..3648278 100644 --- a/src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java +++ b/src/main/java/ftbsc/lll/utils/nodes/TypeProxyInsnNode.java @@ -1,4 +1,4 @@ -package ftbsc.lll.tools.nodes; +package ftbsc.lll.utils.nodes; import ftbsc.lll.proxies.impl.TypeProxy; import org.objectweb.asm.tree.TypeInsnNode;