Skip to content

Commit

Permalink
Add support for lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
urielsalis committed Jun 11, 2021
1 parent 105bf5c commit 738ddd9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.urielsalis"
version = "2.0.3"
version = "2.0.4"

val arrowVersion = "0.10.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ fun getDeobfuscation(
}
// Matches <whitespace>at<whitespace>(modulename)//(className).(method)((sourcefile):(line))
val java16Regex = "(?:.*?\\bat\\s+[a-zA-Z]*\\//)%c\\.%m\\(%s:%l\\)"
val regex = ReTrace.REGULAR_EXPRESSION + "|(?:" + java16Regex + ")"
// Matches <whitespace>at<whitespace>(optional module name//)(className)$$Lambda$(anything).(method)(sourcefile)
val lambdaRegex = "(?:.*?\\bat\\s+(?:[a-zA-Z]*\\/\\/)?)%c\\\$\\\$Lambda\\\$\\d*\\/(.*)\\.%m\\((.*)\\)"
val regex = ReTrace.REGULAR_EXPRESSION + "|(?:" + java16Regex + ")|(?:" + lambdaRegex + ")"
val retrace = ReTrace(regex, false, true, mappingFile)
val stringWriter = StringWriter()
val printWriter = PrintWriter(stringWriter)
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/crashes/deobfuscator/client-deobf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ java.lang.OutOfMemoryError: Java heap space
at net.minecraft.nbt.NbtIo.net.minecraft.nbt.CompoundTag readCompressed(java.io.InputStream)(NbtIo.java:32)
at net.minecraft.nbt.NbtIo.net.minecraft.nbt.CompoundTag readCompressed(java.io.File)(NbtIo.java:26)
at net.minecraft.world.level.storage.LevelStorageSource.net.minecraft.world.level.storage.LevelSummary lambda$levelSummaryReader$5(java.io.File,boolean,java.io.File,com.mojang.datafixers.DataFixer)(LevelStorageSource.java:229)
at cyg$$Lambda$2987/857564250.apply(Unknown Source)
at net.minecraft.world.level.storage.LevelStorageSource$$Lambda$2987/null 857564250(null).apply(Unknown Source)
at net.minecraft.world.level.storage.LevelStorageSource.java.lang.Object readLevelData(java.io.File,java.util.function.BiFunction)(LevelStorageSource.java:178)
at net.minecraft.world.level.storage.LevelStorageSource.java.util.List getLevelList()(LevelStorageSource.java:157)
at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.void refreshList(java.util.function.Supplier,boolean)(WorldSelectionList.java:91)
Expand All @@ -38,7 +38,7 @@ java.lang.OutOfMemoryError: Java heap space
at net.minecraft.client.gui.screens.Screen.void init(net.minecraft.client.Minecraft,int,int)(Screen.java:325)
at net.minecraft.client.Minecraft.void setScreen(net.minecraft.client.gui.screens.Screen)(Minecraft.java:922)
at net.minecraft.client.gui.screens.TitleScreen.void lambda$createNormalMenuOptions$4(net.minecraft.client.gui.components.Button)(TitleScreen.java:141)
at doy$$Lambda$2670/1502984812.onPress(Unknown Source)
at net.minecraft.client.gui.screens.TitleScreen$$Lambda$2670/null 1502984812(null).onPress(Unknown Source)
at net.minecraft.client.gui.components.Button.void onPress()(Button.java:33)


Expand Down Expand Up @@ -77,10 +77,10 @@ Stacktrace:
at net.minecraft.client.gui.screens.Screen.void wrapScreenError(java.lang.Runnable,java.lang.String,java.lang.String)(Screen.java:438)
at net.minecraft.client.MouseHandler.void onPress(long,int,int,int)(MouseHandler.java:92)
at net.minecraft.client.MouseHandler.void lambda$null$4(long,int,int,int)(MouseHandler.java:162)
at dka$$Lambda$2975/534027987.run(Unknown Source)
at net.minecraft.client.MouseHandler$$Lambda$2975/null 534027987(null).run(Unknown Source)
at net.minecraft.util.thread.BlockableEventLoop.void execute(java.lang.Runnable)(BlockableEventLoop.java:94)
at net.minecraft.client.MouseHandler.void lambda$setup$5(long,int,int,int)(MouseHandler.java:162)
at dka$$Lambda$2334/656802017.invoke(Unknown Source)
at net.minecraft.client.MouseHandler$$Lambda$2334/null 656802017(null).invoke(Unknown Source)
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.null callback(null)(GLFWMouseButtonCallbackI.java:36)
at org.lwjgl.system.JNI.null invokeV(null)(JNI.java)
at org.lwjgl.glfw.GLFW.null glfwWaitEventsTimeout(null)(GLFW.java:3174)
Expand Down
Loading

0 comments on commit 738ddd9

Please sign in to comment.