From 4064aa7726d1aea02b479981df2a03a131ae980d Mon Sep 17 00:00:00 2001 From: zaaarf Date: Mon, 27 Feb 2023 17:13:26 +0100 Subject: doc: improved javadocs --- .../ftbsc/lll/exceptions/InstructionMismatchException.java | 2 +- .../java/ftbsc/lll/exceptions/MappingNotFoundException.java | 4 +++- .../java/ftbsc/lll/exceptions/PatternNotFoundException.java | 2 +- src/main/java/ftbsc/lll/tools/InsnSequence.java | 2 +- src/main/java/ftbsc/lll/tools/PatternMatcher.java | 12 ++++++------ src/main/java/ftbsc/lll/tools/SrgMapper.java | 6 +++--- src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java b/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java index 7f3fe83..b9e0d05 100644 --- a/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java +++ b/src/main/java/ftbsc/lll/exceptions/InstructionMismatchException.java @@ -1,7 +1,7 @@ package ftbsc.lll.exceptions; /** - * Thrown when attempting to build an InstructionSequence between two + * Thrown when attempting to build an {@link ftbsc.lll.tools.InsnSequence} between two * unconnected nodes. */ public class InstructionMismatchException extends RuntimeException { diff --git a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java index 77bc900..d281a93 100644 --- a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java +++ b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java @@ -1,7 +1,9 @@ package ftbsc.lll.exceptions; +import ftbsc.lll.tools.SrgMapper; + /** - * Thrown upon failure to find the requested mapping within a loaded SrgMapper. + * Thrown upon failure to find the requested mapping within a loaded {@link SrgMapper}. */ public class MappingNotFoundException extends RuntimeException { public MappingNotFoundException(String mapping) { diff --git a/src/main/java/ftbsc/lll/exceptions/PatternNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/PatternNotFoundException.java index 5e7401c..d84fefd 100644 --- a/src/main/java/ftbsc/lll/exceptions/PatternNotFoundException.java +++ b/src/main/java/ftbsc/lll/exceptions/PatternNotFoundException.java @@ -1,7 +1,7 @@ package ftbsc.lll.exceptions; /** - * Thrown when failing to find a pattern + * Thrown when failing to find a pattern. */ public class PatternNotFoundException extends RuntimeException { public PatternNotFoundException(String message) { diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 3cdacb8..1a915ca 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -8,7 +8,7 @@ import java.util.Objects; /** * Represents a sequence of instructions contained within two given nodes. - * Extends InsnList, but provides additional flexibility and features. + * Extends {@link InsnList}, but provides additional flexibility and features. */ public class InsnSequence extends InsnList { /** diff --git a/src/main/java/ftbsc/lll/tools/PatternMatcher.java b/src/main/java/ftbsc/lll/tools/PatternMatcher.java index a4dc8cb..1b7d567 100644 --- a/src/main/java/ftbsc/lll/tools/PatternMatcher.java +++ b/src/main/java/ftbsc/lll/tools/PatternMatcher.java @@ -56,15 +56,15 @@ public class PatternMatcher { } /** - * @return the Builder object for this PatternMatcher + * @return the Builder object for this {@link PatternMatcher} */ public static Builder builder() { return new Builder(); } /** - * Tries to match the given pattern on a given MethodNode. - * @param node the MethodNode to search + * Tries to match the given pattern on a given {@link MethodNode}. + * @param node the {@link MethodNode} to search * @return the InsnSequence object representing the matched pattern */ public InsnSequence find(MethodNode node) { @@ -74,7 +74,7 @@ public class PatternMatcher { /** * Tries to match the given pattern starting from a given node. * @param node the node to start the search on - * @return the InsnSequence object representing the matched pattern + * @return the {@link InsnSequence} object representing the matched pattern */ public InsnSequence find(AbstractInsnNode node) { if(node != null) { @@ -103,7 +103,7 @@ public class PatternMatcher { } /** - * The Builder object for PatternMatcher. + * The Builder object for {@link PatternMatcher}. */ public static class Builder { @@ -134,7 +134,7 @@ public class PatternMatcher { /** * Builds the pattern defined so far. - * @return the built PatternMatcher + * @return the built {@link PatternMatcher} */ public PatternMatcher build() { return new PatternMatcher(predicates, reverse, ignoreLabels, ignoreFrames, ignoreLineNumbers); diff --git a/src/main/java/ftbsc/lll/tools/SrgMapper.java b/src/main/java/ftbsc/lll/tools/SrgMapper.java index 7151d1d..0e2b3c8 100644 --- a/src/main/java/ftbsc/lll/tools/SrgMapper.java +++ b/src/main/java/ftbsc/lll/tools/SrgMapper.java @@ -26,9 +26,9 @@ public class SrgMapper { /** * The public constructor. - * Should be passed a Stream of Strings, one representing each line. + * Should be passed a {@link Stream} of Strings, one representing each line. * Whether they contain line endings or not is irrelevant. - * @param str a Stream of strings + * @param str a {@link Stream} of strings */ public SrgMapper(Stream str) { AtomicReference currentClass = new AtomicReference<>(""); @@ -129,7 +129,7 @@ public class SrgMapper { private final String srgName; /** - * A Map tying each member's deobfuscatede name or signature to its + * A {@link Map} tying each member's deobfuscatede name or signature to its * SRG name. */ private final Map members; diff --git a/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java b/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java index cf253c9..c08d85c 100644 --- a/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java +++ b/src/main/java/ftbsc/lll/tools/debug/BytecodePrinter.java @@ -41,7 +41,7 @@ public class BytecodePrinter { /** * Logs the bytecode of a method using the ASM logger. * @param main the method to print - * @param logger the Log4j logger to print it with + * @param logger the Log4j {@link Logger} to print it with */ public static void logAsmMethod(final MethodNode main, final Logger logger) { for (AbstractInsnNode i : main.instructions.toArray()) -- cgit v1.2.3-56-ga3b1