
Fix ArrayIndexOutOfBoundsException and IndexOutOfBounds
Read the index and length in the exception, find the off-by-one or empty-input bug that caused it and fix it for arrays, lists and strings.
Tag
77 posts

Read the index and length in the exception, find the off-by-one or empty-input bug that caused it and fix it for arrays, lists and strings.

Find out why @Transactional is ignored on a self call, a private method or a swallowed exception, and fix it by moving the call across a bean boundary.

Fix the Java PKIX path building failed TLS error by finding the missing CA, importing it into a truststore and never disabling verification.

Read the maven-compiler-plugin failure to its real cause: a JRE instead of a JDK, a release the JDK lacks, annotation processing or a real compile error.

Fix java.lang.StackOverflowError by finding the missing base case or the hidden cycle, then convert deep recursion to a loop or raise the thread stack size.

Fix a 401 Unauthorized from Spring Security by checking credentials, the Authorization header format, token validation settings and filter order.

Fix Read timed out errors between Spring services by setting connect and read timeouts on RestClient and Feign, sizing pools and finding the slow side.

Fix invalid target release and source option errors by setting maven.compiler.release, updating the compiler plugin and making Maven run on the right JDK.

Why Hibernate throws LazyInitializationException outside a transaction, how to confirm which cause you have and the fixes in order of preference.

Decode the Note about unchecked or unsafe operations, find the lines with Xlint, and fix raw types and casts instead of suppressing the warning.

Fix Mockito errors about final classes, records and static methods by using the inline mock maker, and decide when a final class should be an interface.

Fix the Gradle error about resolving a configuration by adding repositories, matching Java versions with a toolchain and reading the nested cause.