Use multi-version jar instead of reflection to detect Loom support #647
Replies: 5 comments 3 replies
-
I use CNFEs in more than just one place, e.g. to determine the correct logging subsystem. I don't understand why catching CNFEs breaks your system... |
Beta Was this translation helpful? Give feedback.
-
MR Jars are much better than using reflection, because issues can be discovered at compile-time. I can help you with setting that up @belaban |
Beta Was this translation helpful? Give feedback.
-
Yes, that'd be welcome. PRs for POM and ant/ivy... |
Beta Was this translation helpful? Give feedback.
-
OK, thanks @tristantarrant, applied&merged, will be in 5.2.5 |
Beta Was this translation helpful? Give feedback.
-
We're having errors loading the jar into our system because we do some verification that classes are loaded successfully on startup.
The jgroups jar seems to intentionally handle ClassNotFoundExceptions to "probe" for Project loom virtual Threads... which makes it break in our system.
I was just thinking that maybe you should consider using multi-version jars instead of reflection? So, if someone is running on JDK19 they would get to use the JDK19-specific classes instead of relying on reflection which can be quite fragile.
Example of a place where I believe jgroups is probing for Loom:
https://github.com/belaban/JGroups/blob/master/src/org/jgroups/util/Util.java#L210
If you don't like the suggestion, please just ignore it, thanks!
Beta Was this translation helpful? Give feedback.
All reactions