doc: improved javadocs

This commit is contained in:
zaaarf 2023-02-27 17:13:26 +01:00
parent fe928a0fb0
commit 4064aa7726
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C
7 changed files with 16 additions and 14 deletions

View file

@ -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 {

View file

@ -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) {

View file

@ -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) {

View file

@ -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 {
/**

View file

@ -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);

View file

@ -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<String> str) {
AtomicReference<String> 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<String, String> members;

View file

@ -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())