News for hackers. Stuff that matters.
Re:Stepping down as Mockito maintainer after 10 years by lovich on Sunday December 28, 2025 @06:24PM (#46415539)
What am I missing that makes this change a massive headache if just setting a flag gets the old behavior?
Re:Stepping down as Mockito maintainer after 10 years by okillbite on Sunday December 28, 2025 @06:35PM (#46415610)
I haven't read the discussion but this seems like the obvious answer considering the flag only needs to be set during test.

Presumably this might miss some edge case (where something else also needs the flag?) though an explicit allow of the mockito agent in the jvm arg would have solved for that.

Re:Stepping down as Mockito maintainer after 10 years by pron on Sunday December 28, 2025 @06:41PM (#46415649)
> though an explicit allow of the mockito agent in the jvm arg would have solved for that.

You can and should explicitly specify Mockito as an agent in the JVM configuration, as it is one.

Re:Stepping down as Mockito maintainer after 10 years by pron on Sunday December 28, 2025 @06:28PM (#46415559)
Nothing makes it a massive headache, but I think that Maven/Gradle don't make it as easy as they could and should.
Re:Stepping down as Mockito maintainer after 10 years by dathanb82 on Monday December 29, 2025 @04:23PM (#46425875)
The auto-attach flag isn’t a huge deal, since it’s a one-liner that can be statically documented and the fix works in all cases. The bigger issue is the JDK / runtime team’s stance that libraries should not be able to dynamically attach agents, and that the auto-attach flag might be removed in the future. You can still enable mockito’s agent with the —javaagent flag, but you have to provide the path to the mockito jar, and getting that path right is highly build-system-dependent and not something the mockito team can document in a way that minimizes the entry threshold for newcomers.