-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java 18+ compatibility using ByteBuddy, Rewrite injection of CTCGraph…
…icsEnvironment (#16) * Avoid attempt to make java.awt.GraphicsEnvironment non final, as this breaks in Java 18+. Instead, use ByteBuddy to return CTCGraphicsEnvironment when sun.awt.PlatformGraphicsInfo.createGE() is called. * Ignore jenv and log files * Fix UnsupportedOperationException: inject CTCGraphicsEnvironment through sun.awt.PlatformGraphicsInfo.createGE() * Replace removing a final modifier, which is not possible in JDK 18+, by ByteBuddy interceptors. * Ensure that there is only one instance of CTCGraphicsEnvironment in use * Keep constructor public, no need to change the API * Make changing the Java version easier * Update CacioExtension.java * Update README.md
- Loading branch information
Showing
10 changed files
with
143 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,12 @@ target/ | |
|
||
# OS X | ||
.DS_Store | ||
|
||
# jenv | ||
|
||
|
||
# jenv | ||
.java-version | ||
|
||
# log files | ||
*.log |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
14 changes: 14 additions & 0 deletions
14
cacio-tta/src/main/java/com/github/caciocavallosilano/cacio/ctc/junit/CTCInterceptor.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.github.caciocavallosilano.cacio.ctc.junit; | ||
|
||
import com.github.caciocavallosilano.cacio.ctc.CTCGraphicsEnvironment; | ||
import net.bytebuddy.implementation.bind.annotation.*; | ||
|
||
import java.awt.*; | ||
|
||
|
||
public class CTCInterceptor { | ||
@RuntimeType | ||
public static GraphicsEnvironment intercept() { | ||
return CTCGraphicsEnvironment.getInstance(); | ||
} | ||
} |
This file contains 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
This file contains 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