S2095 "Resources should be closed" should ignore JChannel instances (JGroups)

java

(Adam Gabryś) #1

Hello,
JChannel instances from JGroups must be open for the whole applications lifetime (it should be closed on shutdown). Closing it in try-with-resources in is bad because we’ll lose cluster communication due to the closed JChannel.

I’ve prepared an example code to allow verification:

Cheers