Not a flaw in Java, a flaw in a specific overengineered logging framework. Relevantly, not a flaw that applies to JGit.
For Python, JavaScript, Ruby, etc it's not even a question.
It's arguably a symptom of a larger problem the ecosystem's sheer size.
The flaw was in log4j's use of the library which allowed remotely connecting and executing code by default based on connection strings which were possibly user-entered.