That class is defined in my client library and occasionally was passed into GradleConnector.forProjectDirectory()
(probably it is better to through IllegalArgumentException there if file.getClass() != File.class
).
I’ve already replaced it with raw java.io.File, but investigation of the problem took rather long time - current Gradle’s failure in this edge case takes rather long time and is not self-descriptive.
I’ll also try ‘writeReplace()’. I think it should work, need to decide which way is more correct.