From f6539d4a078e4cc37a56b9cdb548ba6a61a73b93 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 8 Mar 2023 15:37:17 +0100 Subject: feat: initial implementation of new system - multiple injectors/target - removed strict limitation of one patch per class - made finders far smarter - added boolean for obfuscation environment (currently never changed from default) --- .../ftbsc/lll/exceptions/TargetNotFoundException.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java (limited to 'src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java') diff --git a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java new file mode 100644 index 0000000..5be3d77 --- /dev/null +++ b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java @@ -0,0 +1,15 @@ +package ftbsc.lll.exceptions; + +/** + * Thrown upon failure to find an existing method from a stub. + */ +public class TargetNotFoundException extends RuntimeException { + + /** + * Constructs a new target not found exception for the specified method stub. + * @param stub the stub's name (and descriptor possibly) + */ + public TargetNotFoundException(String stub) { + super("Could not find member corresponding to stub: " + stub); + } +} -- cgit v1.2.3-56-ga3b1 From 1a4716dafedd7008b8b66e587cb8f35570be0363 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 15 Mar 2023 20:32:12 +0100 Subject: chore: use String format --- src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java | 2 +- src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java | 2 +- src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java') diff --git a/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java b/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java index dd75a08..76f12a5 100644 --- a/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java +++ b/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java @@ -17,6 +17,6 @@ public class InvalidResourceException extends RuntimeException { * @param name the resource name */ public InvalidResourceException(String name) { - super("Specified resource " + name + " was not found!"); + super(String.format("Specified resource %s was not found!", name)); } } diff --git a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java index 40b0b65..e943c01 100644 --- a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java +++ b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java @@ -12,7 +12,7 @@ public class MappingNotFoundException extends RuntimeException { * @param mapping the relevant mapping */ public MappingNotFoundException(String mapping) { - super("Could not find mapping for " + mapping + "!"); + super(String.format("Could not find mapping for %s!", mapping)); } /** diff --git a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java index 5be3d77..1b63ea5 100644 --- a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java +++ b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java @@ -10,6 +10,6 @@ public class TargetNotFoundException extends RuntimeException { * @param stub the stub's name (and descriptor possibly) */ public TargetNotFoundException(String stub) { - super("Could not find member corresponding to stub: " + stub); + super(String.format("Could not find member corresponding to stub: %s.")); } } -- cgit v1.2.3-56-ga3b1 From 6d1d648af437deaab29976c32a77c6cb7a2e5e30 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Thu, 16 Mar 2023 15:55:34 +0100 Subject: fix: epic printf fail --- src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java') diff --git a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java index 1b63ea5..c82e0fc 100644 --- a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java +++ b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java @@ -10,6 +10,6 @@ public class TargetNotFoundException extends RuntimeException { * @param stub the stub's name (and descriptor possibly) */ public TargetNotFoundException(String stub) { - super(String.format("Could not find member corresponding to stub: %s.")); + super(String.format("Could not find member corresponding to stub: %s.", stub)); } } -- cgit v1.2.3-56-ga3b1