aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2023-08-12 14:35:00 +0100
committerisXander <xandersmith2008@gmail.com>2023-08-12 14:38:59 +0100
commitff6b36987d1c149a9f1b7e1b23748cb581b8fa6f (patch)
treeb6dbef08df7bd4beb2fbf3927054940fe0060c50 /common
parenta75211aeb8119cc6c619e7e585a61d42d831afaa (diff)
downloadYetAnotherConfigLib-ff6b36987d1c149a9f1b7e1b23748cb581b8fa6f.tar.gz
YetAnotherConfigLib-ff6b36987d1c149a9f1b7e1b23748cb581b8fa6f.tar.bz2
YetAnotherConfigLib-ff6b36987d1c149a9f1b7e1b23748cb581b8fa6f.zip
🐛 Fix infinite recursion in `GsonConfigInstance.Builder#appendGsonBuilder`. (close #64)
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java
index 7dd68b3..32c688c 100644
--- a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java
+++ b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java
@@ -193,7 +193,8 @@ public class GsonConfigInstance<T> extends ConfigInstance<T> {
* @param gsonBuilder the function to apply to the builder
*/
public Builder<T> appendGsonBuilder(UnaryOperator<GsonBuilder> gsonBuilder) {
- this.gsonBuilder = builder -> gsonBuilder.apply(this.gsonBuilder.apply(builder));
+ UnaryOperator<GsonBuilder> prev = this.gsonBuilder;
+ this.gsonBuilder = builder -> gsonBuilder.apply(prev.apply(builder));
return this;
}