CreateProcess error=206, The filename or extension is too long

I had the same problem. I used <fileset dir=”${basedir}/build”> <include name=”**/*.class”/> </fileset> inside findbugs target and it seems that there is too much .class files to be passed to findbug (?via command line?) because when I used <fileset dir=”${basedir}/build/com/domain/package”> <include name=”**/*.class”/> </fileset> that had low number of classes, the error was gone. So, I solved … Read more

ResultSet not closed when connection closed?

One problem with ONLY closing the connection and not the result set, is that if your connection management code is using connection pooling, the connection.close() would just put the connection back in the pool. Additionally, some database have a cursor resource on the server that will not be freed properly unless it is explicitly closed.

Could not find artifact com.sun:tools:jar:0

tools.jar removed from Java 9+ You’re on JDK 11. No tools.jar found there. JEP 220: Modular Run-Time Images removed both tools.jar and rt.jar from the lib folder, as of Java 9. Removed: rt.jar and tools.jar The class and resource files previously stored in lib/rt.jar, lib/tools.jar, lib/dt.jar, and various other internal JAR files are now stored … Read more

Is there a way to ignore a single FindBugs warning?

The FindBugs initial approach involves XML configuration files aka filters. This is really less convenient than the PMD solution but FindBugs works on bytecode, not on the source code, so comments are obviously not an option. Example: <Match> <Class name=”com.mycompany.Foo” /> <Method name=”bar” /> <Bug pattern=”DLS_DEAD_STORE_OF_CLASS_LITERAL” /> </Match> However, to solve this issue, FindBugs later … Read more

Switch without break

Findbugs is flagging up that falling through from one case to the next is generally not a good idea if there’s any code in the first one (although sometimes it can be used to good effect). So when it sees the second case and no break, it reports the error. So for instance: switch (foo) … Read more