Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
4e3305d
Start 1.11.0
jaskarth Apr 4, 2024
ff36611
Bump to Java 17
jaskarth Apr 5, 2024
04ef235
Don't write explicit casts where redundant (#341)
IotaBread Apr 12, 2024
4345157
Move from a fixed thread pool to a fork join pool
jaskarth Apr 12, 2024
41162a6
Add option to exclude classes from decompilation with regex (#370)
mvisat Apr 14, 2024
7dc0843
Kotlin default arguments (#369)
sschr15 Apr 16, 2024
098be41
Fix 2 constructors of an inner class with 1 calling another (#375)
coehlrich Apr 19, 2024
26dd962
Fix weird indent when inlined simple lambdas return something that ta…
jpenilla Apr 19, 2024
209c87c
Inline empty lambda bodies to `{}` when simple lambda inlining enable…
jpenilla Apr 19, 2024
b23c7e6
Update to J17 features + fix ctor default params (#376)
sschr15 Apr 19, 2024
f0de072
Simplify empty anonymous class bodies to `{}` (#381)
jpenilla Apr 19, 2024
62c977e
Fix indent on 'simple' switch branches (#382)
jpenilla Apr 23, 2024
d068f59
Fix breaking decompile switch-on-enum when enum does not exist in cla…
EpicPlayerA10 Apr 30, 2024
f5d442c
Map all bytecode in range (#386)
jaskarth May 1, 2024
5f2e44a
Fix default case not always being last (#391)
coehlrich May 20, 2024
63fce84
Add back casts in numeric operations where it increases the size of t…
Machine-Maker May 20, 2024
23619f4
Fix variable used in switch head not being inlined (#399)
coehlrich May 22, 2024
a7b4c23
Fix method parameters reading the parameter type from the signature f…
coehlrich May 23, 2024
7e912ea
Add support for intersection types in casts (#405)
coehlrich Jun 23, 2024
4d3099a
Guard var name with null check, fixes #400
jaskarth Jul 11, 2024
0025be4
Fix StringBuilder-based single character issues
sschr15 Aug 6, 2024
c46995d
Update dependencies and tests to Kotlin 2.0.0
sschr15 Aug 14, 2024
328f3ea
String interpolation initial run
sschr15 Aug 6, 2024
2e1f44e
Make string concatenation toggleable
sschr15 Aug 14, 2024
6e8aeef
[Kotlin] Fix class visibility when public should be explicit
sschr15 Aug 14, 2024
e8ba2e4
[Kotlin] Fix "catch" throwable definitions
sschr15 Aug 14, 2024
fd802ed
[Kotlin] Infer `val` in method bodies
sschr15 Aug 15, 2024
d825440
Fix NPE when finding var fields, fixes #412
jaskarth Aug 16, 2024
5ecd361
Fixes for clashing variable renaming (#378)
jpenilla Aug 17, 2024
259e25e
Add option to disable inner classes names validation (#392)
EpicPlayerA10 Aug 17, 2024
5e276c2
Fail gracefully when decompiling mangled string concat, fixes IOOBE
jaskarth Aug 17, 2024
287ec00
Fix IOOBE in sequence flattening
jaskarth Aug 17, 2024
3639a44
Fix IOOBE in finally processing when the head block is empty
jaskarth Aug 17, 2024
b4ea40d
Fix local record classes that have the parent class as the first (#414)
coehlrich Aug 17, 2024
52e972a
Fix IOOBE in NewExprent type inference
jaskarth Aug 17, 2024
a2ce28f
Inner records are implicitly static
jaskarth Aug 17, 2024
e951f03
Remove preview record pattern matching tests
jaskarth Aug 17, 2024
bdec4c9
Fix NPE in invocation type inference
jaskarth Aug 17, 2024
3ae47a5
Avoid race condition crashes when handling duplicate classes
jaskarth Aug 18, 2024
0bc4e8d
Remove final from `Statement` subtypes (#415)
sschr15 Aug 18, 2024
d471432
Convert private statement constructors to protected
sschr15 Aug 18, 2024
265173b
Decompiler option access API (#418)
sschr15 Aug 18, 2024
b71e132
Fix NPE in invocation exprent inference
jaskarth Aug 19, 2024
868c468
Record pattern matching (#368)
jaskarth Aug 20, 2024
2e2d3c6
[Kotlin] Fix pass order
sschr15 Aug 20, 2024
7750353
[Kotlin] Skip braces if class body is empty
sschr15 Aug 20, 2024
a330599
[Kotlin] Add test for companion object
sschr15 Aug 21, 2024
4817426
[Kotlin] Fix objects, companion object members, and whitespace
sschr15 Aug 21, 2024
e4188ad
Fix incorrect inlining of methods into patterns
jaskarth Aug 21, 2024
7795214
[Kotlin] Fix NPE from annotation change
sschr15 Aug 23, 2024
07ab7b2
[Kotlin] Add enum test, fix error when ctors have defaults, fix enum …
sschr15 Aug 23, 2024
d6d7140
Fix tests
jaskarth Aug 23, 2024
4fc77bc
Update Kotlin tests
sschr15 Aug 23, 2024
5f5528d
Allow plugins to change decompiled file extensions (#420)
sschr15 Aug 23, 2024
e47018d
Fix NPE in variable remapping
jaskarth Aug 23, 2024
555e7d9
Improve switch expression candidate picking with stack vars
jaskarth Aug 24, 2024
72382ba
Improve statement ordering and conditionals with pattern matching
jaskarth Aug 24, 2024
a563ef7
Fix lambdas in anonymous classes referencing parameters from the root…
coehlrich Aug 24, 2024
516b1d1
[Kotlin] Fix cast types being Java-style
sschr15 Aug 25, 2024
ebe3424
[Kotlin] Update tests
sschr15 Aug 25, 2024
679e45e
Better handle synchronized blocks created with jsr and ret
jaskarth Aug 27, 2024
a3ded93
[Kotlin] Fix infinite loop, stack overflow, or whatever it is KInvoca…
sschr15 Aug 29, 2024
5416c88
Quick dependency refresh (#427)
zml2008 Sep 5, 2024
7b44d54
Minor cleanups and comments, add j21 complex switch expr test
jaskarth Sep 11, 2024
512bd41
Fix requireNonNull call appearing when the selector is reusable and f…
coehlrich Dec 4, 2024
7050bc2
Add test for labeled blocks in constructor (#437)
Earthcomputer Dec 4, 2024
59fbce5
Fix float associativity bug with addition
jaskarth Dec 4, 2024
fc638b6
Fix rare NPE and IOOBE in writing
jaskarth Dec 8, 2024
3a66bcb
Add test for broken pattern matching before loops
jaskarth Dec 9, 2024
acb55c2
Properly walk the inheritance tree when checking for possibly ambiguo…
Owen1212055 Dec 16, 2024
e13219c
Fix pattern matching instanceof not being detected inside loops (#450)
coehlrich Jan 9, 2025
66d8152
Fix incorrect SSAU in empty while loops, fix edges being removed from…
jaskarth Jan 10, 2025
9a691c9
Add test for Expression Optimization Issue (#449)
Owen1212055 Jan 10, 2025
9899227
Fix Kotlin CCE, add more tests
jaskarth Jan 10, 2025
cd1dfa6
Fix switch on enum false positive, add more tests
jaskarth Jan 10, 2025
992db8a
Fix SimplifyExprentsHelper accidentally destroying pattern matches
jaskarth Jan 10, 2025
e7bde41
Fix NPEs in ClassWriter and variable merging
jaskarth Jan 10, 2025
07ca6db
Fix CCE in SwitchHelper
jaskarth Jan 10, 2025
0be304f
Fix incorrect ppmm inlining (#451)
Kroppeb Feb 22, 2025
a1b7f6d
Fix line numbers in tests
jaskarth Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.bat text eol=crlf
*.css text
*.df text
*.htm text
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@ jobs:
build:
strategy:
matrix:
java: [11, 17, 19]
runs-on: ubuntu-22.04
java: [17, 21]
runs-on: ubuntu-24.04
container:
image: eclipse-temurin:${{ matrix.java }}
options: --user root
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.repository_owner != 'Vineflower' || !(contains(github.ref_name, 'develop') || contains(github.ref_name, 'master')) }}
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew build --stacktrace
- name: Archive test results
if: "${{ always() }}"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "test-results-java${{ matrix.java }}"
path: |
build/reports/
plugins/*/build/reports/
build/test-results/**/*.xml
publish-test-results:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: [build]
permissions:
issues: write
Expand All @@ -35,7 +36,7 @@ jobs:
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Test Results
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
- '*'
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: eclipse-temurin:17
options: --user root
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- run: ./gradlew build publish publishToSonatype closeAndReleaseSonatypeStagingRepository -x test --stacktrace
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ on: [push, pull_request]
jobs:
publish:
if: ${{ github.repository_owner == 'Vineflower' && contains(github.ref_name, 'develop') }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: eclipse-temurin:17
options: --user root
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- run: ./gradlew publish --stacktrace
env:
STATUS: snapshot
Expand Down
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import java.time.Duration

plugins {
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id("io.github.gradle-nexus.publish-plugin") version '2.0.0-rc-2'
id 'com.gradleup.shadow' version '8.3.0'
id 'org.jetbrains.kotlin.jvm' version '2.0.0'
id("io.github.gradle-nexus.publish-plugin") version '2.0.0'
}

apply plugin: 'jacoco'
Expand All @@ -20,19 +20,19 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

allprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'java'
ext.isArm = System.getProperty('os.arch') == 'aarch64'

group = 'org.vineflower'

compileJava {
sourceCompatibility = '11'
targetCompatibility = '11'
sourceCompatibility = '17'
targetCompatibility = '17'
}

java.toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(17)
}

repositories {
Expand All @@ -56,9 +56,9 @@ allprojects {
}

group = 'org.vineflower'
archivesBaseName = 'vineflower'
base.archivesName = 'vineflower'

version = '1.10.1'
version = '1.11.0'

def ENV = System.getenv()
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")
Expand Down Expand Up @@ -146,7 +146,7 @@ def testJavaRuntimes = [:]
languageVersion = JavaLanguageVersion.of(runtimeVersion)
}
}
[16, 17, 19, 21].forEach { version -> createJavaTestDataSet(version, "Preview", ["--enable-preview"]) }
[16, 17, 21].forEach { version -> createJavaTestDataSet(version, "Preview", ["--enable-preview"]) }
[8, 16].forEach { version -> createJavaTestDataSet(version, "NoDebug", ["-g:none"])}

task compileTestDataJasm(type: JasmCompile) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
21 changes: 12 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -145,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +205,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion plugins/idea-not-null/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
archivesBaseName = 'vineflower-idea-not-null'
base.archivesName = 'vineflower-idea-not-null'

dependencies {
implementation project(":")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.vineflower.ideanotnull;

import org.jetbrains.java.decompiler.api.DecompilerOption;
import org.jetbrains.java.decompiler.api.plugin.PluginOptions;
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;

public interface IdeaNotNullOptions {
@IFernflowerPreferences.Name("Resugar Intellij IDEA @NotNull")
@IFernflowerPreferences.Description("Resugar Intellij IDEA's code generated by @NotNull annotations.")
@IFernflowerPreferences.ShortName("inn")
@IFernflowerPreferences.Type(IFernflowerPreferences.Type.BOOLEAN)
@IFernflowerPreferences.Type(DecompilerOption.Type.BOOLEAN)
String IDEA_NOT_NULL_ANNOTATION = "resugar-idea-notnull";

static void addDefaults(PluginOptions.AddDefaults cons) {
Expand Down
14 changes: 14 additions & 0 deletions plugins/idea-not-null/testData/results/TestIdeaNotNull.dec
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ class 'pkg/TestIdeaNotNull' {
f 9
10 10
11 10
12 10
13 10
14 11
1d 11
1e 13
1f 13
20 13
21 13
22 13
23 13
24 13
2c 14
30 14
34 14
Expand Down Expand Up @@ -145,11 +149,15 @@ class 'pkg/TestIdeaNotNull' {
2a 33
2b 33
2c 33
2d 33
2e 33
2f 34
30 34
31 34
32 34
33 34
34 34
35 34
36 36
}

Expand All @@ -168,6 +176,8 @@ class 'pkg/TestIdeaNotNull' {
12 43
13 43
14 43
15 43
16 43
1e 44
22 44
26 44
Expand All @@ -190,6 +200,8 @@ class 'pkg/TestIdeaNotNull' {
e 53
f 53
10 53
11 53
12 53
13 54
1d 54
1e 56
Expand All @@ -200,6 +212,8 @@ class 'pkg/TestIdeaNotNull' {
23 56
24 56
25 56
26 56
27 56
2f 57
33 57
37 57
Expand Down
1 change: 1 addition & 0 deletions plugins/kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build/
/out/
/testData/classes/kt/
/testData/classes/ktold/
bin
23 changes: 21 additions & 2 deletions plugins/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ plugins {
id 'org.jetbrains.kotlin.jvm'
}

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'java'
apply plugin: 'maven-publish'

group = 'org.vineflower'
version = "0.1.0"
archivesBaseName = 'vineflower-kotlin'
base.archivesName = 'vineflower-kotlin'

sourceSets {
testDataKotlin.kotlin.srcDirs files("testData/src/kt/")
testDataOldKotlin.kotlin.srcDirs files("testData/src/ktold/")
}

configurations {
testDataOldKotlinImplementation.extendsFrom testDataKotlinImplementation
}

dependencies {
Expand All @@ -35,6 +40,20 @@ compileTestDataKotlinKotlin {
}
testDataClasses.dependsOn(testDataKotlinClasses)

compileTestDataOldKotlinKotlin {
destinationDirectory = file("testData/classes/ktold")
kotlinOptions {
compilerOptions {
freeCompilerArgs = [ // Kotlin 2.0 defaults to invokedynamic implementations. Use class implementations instead.
"-Xlambdas=class",
"-Xsam-conversions=class",
"-Xstring-concat=inline",
]
}
}
}
testDataClasses.dependsOn(testDataOldKotlinClasses)

jar {
enabled = false
}
Expand Down
Loading
Loading