-
Notifications
You must be signed in to change notification settings - Fork 10
Fixes #174: remove entire GC mechanism and use try-with-resources instead #175
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #175 +/- ##
==========================================
- Coverage 60.50% 58.97% -1.53%
==========================================
Files 66 67 +1
Lines 2504 2467 -37
Branches 227 227
==========================================
- Hits 1515 1455 -60
- Misses 903 924 +21
- Partials 86 88 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ascopes
commented
Dec 4, 2022
...rc/test/groovy/io/github/ascopes/jct/acceptancetests/checkerframework/CheckerNullTest.groovy
Outdated
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Outdated
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Outdated
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/package-info.java
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/package-info.java
Show resolved
Hide resolved
ascopes
commented
Dec 4, 2022
...ler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractJavaFileObjectAssert.java
Show resolved
Hide resolved
...compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/AbstractJctCompiler.java
Outdated
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Outdated
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Outdated
Show resolved
Hide resolved
...mpiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactory.java
Outdated
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java
Outdated
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java
Outdated
Show resolved
Hide resolved
java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/TempDirectory.java
Outdated
Show resolved
Hide resolved
...st/java/io/github/ascopes/jct/testing/integration/BasicModuleCompilationIntegrationTest.java
Outdated
Show resolved
Hide resolved
...va/io/github/ascopes/jct/testing/integration/BasicMultiModuleCompilationIntegrationTest.java
Outdated
Show resolved
Hide resolved
47ceb9a to
1a0ac4a
Compare
…ecific standard locations
…tract to a public interface.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This set of changes rips out a bunch of internal components around dealing with file managements that were not cleaning up correctly.
Previously, I used GC hooks to detect this stuff. It worked to begin with but it is very flaky with regards to circular references preventing object cleanup.
The new solution will provide an explicit
Workspacetype that holds all of the file resources. This is initialised by the user in their test and provided to the compiler when callingJctCompiler#compile. This workspace type implements theCloseableinterface, so it can be used with atry-with-resourcesinstead, removing the need for any GC hooks anywhere.An example of how a test would look under this system:
The directory system that should be used can be provided as an argument to the
Workspaceconstructor:The default if no arguments are provided is to use
PathStrategy.RAM_DIRECTORIES.Other changes that facilitate this change include:
pathwrapperspackage no longer exists. Types are now in theworkspacespackage.implsubpackages for internal details.ContainerandContainerGroup-derived types, will now throw IOException in their signature. Theworkspaceclass is exempt from this, instead throwing UncheckedIOException to prevent polluting test cases with checked exception requirements.byte[] getClassBinary(String binaryName) throws IOException;methods are now removed as they were not used anyway. They were a leftover artifact of the old class loader mechanism that was used before I switched to using URLClassLoader.