Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks for generic types and discard any unexpected types #430

Open
wants to merge 77 commits into
base: develop/1.11.0
Choose a base branch
from

Conversation

sschr15
Copy link
Member

@sschr15 sschr15 commented Sep 14, 2024

Fixes #409 by adding checks and discarding any clearly bogus generics

jaskarth and others added 30 commits April 4, 2024 15:08
…a 21 (#355)

* Fix switches with enums for enums in other classes and null cases

* Remove println
* Fix if statements inside switch statements preventing switch expressions

* Update test output

* Fix switch statements that throw an exception not being converted

* Add comment
…o arguments (#362)

* Fix formatter emitting blank lines for long method invocations with no arguments

fixes #359

* Simplify test
* Fix local class methods not getting the parent context

* Add test
)

They may be needed later when writing other classes.

This fixes an issue where non-static inner class constructor invocations from foreign classes would inconsistently have the synthetic enclosing this instance removed from the parameter list, depending on the order they were processed in (and consequently having strange interactions with multithreaded writing)
* Don't write explicit casts where redundant

* Fix numeric parameter disambiguation

* Write casts when not doing so would change behavior

* Fix failing test

---------

Co-authored-by: Jasmine Karthikeyan <[email protected]>
* add option to exclude classes from decompilation

* add @type annotation

* rename into excluded-classes, remove short name
* Default arguments in function / constructor declarations

* Improve defaults detection and parsing, and add option for unknown defaults

* Fix ambiguous wording

* Clean up with J12-17 features

* Describe in detail what happens to default parameters

* Fix cases with 32 or more parameters

* Improve wording about default constructors

* Clean up imports

* Fix problems with long/double parameters
…kes up multiple lines before reformatting (like an anonymous class instantiation) (#379)
* Simplify empty anonymous class bodies to `{}`

This is typically how people actually write code like this (as can be seen in the existing tests)

The improvement is extra noticeable with things like type tokens

* Switch to AtomicBoolean and add comments
…he number (#395)

* Add failing test for number casts issue

* make sure to include casts for numeric operations
* Fix variable used in switch head not being inlined

* Update dec files

* Comments and put streams on multiple lines
* Fix intersection casts for direct methods

* Add support for variable assignments

* Use var for variables that represent intersection types and update tests

* Add comments and remove println

* Add support for when an intersection type is casted back to it's
original type
jaskarth and others added 24 commits August 19, 2024 13:13
* Allow plugins to change decompiled file extensions

* Address review comments
… method (#423)

* Fix lambdas in anonymous classes referencing parameters from the root
method

* Update test
* chore(deps): Bump GHA versions

* chore(deps): Bump Gradle and plugin versions
Also upload the intended test result for TestCorruptedSignatures
Copy link

github-actions bot commented Sep 14, 2024

Test Results

   18 files  ±0     18 suites  ±0   1m 4s ⏱️ -1s
1 930 tests +1  1 929 ✅ +1  1 💤 ±0  0 ❌ ±0 
2 556 runs  +2  2 554 ✅ +2  2 💤 ±0  0 ❌ ±0 

Results for commit 1c14529. ± Comparison against base commit fd167c7.

♻️ This comment has been updated with latest results.

@SpaceWalkerRS
Copy link

How do these checks work when signatures depend on each other? For example, a field that initially has a valid signature, but its type class's signature does not pass the check and is modified/removed, which in turn then invalidates that field's signature.

@jaskarth jaskarth force-pushed the develop/1.11.0 branch 2 times, most recently from a6698b7 to 0be304f Compare February 25, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet