I’m refreshing my project in IDEA a lot today, and it seems to take 10-20 minutes each time.
But I started investigating what’s going on, and IDEA is just waiting for Gradle to finish.
When I start to profile Gradle, I see it handling a lot of exceptions, and calling slow Commons Lang code to walk the exception hierarchy.
org.apache.commons.lang.exception.ExceptionUtils.getCauseUsingMethodName() 2.5373385 362,566 ms (2.5%) 362,566 ms 362,571 ms 362,571 ms
org.apache.commons.lang.exception.ExceptionUtils.getCauseUsingFieldName() 0.15319394 22,012 ms (0.2%) 22,012 ms 22,012 ms 22,012 ms
These methods use reflection to do their job, and the sole purposes seems to be to support the old days of Throwable, when getCause() didn’t exist. Now getCause() does exist, so I don’t think you can just call getCause(), which should be much faster than this.
Is this worth filing as an issue in itself?
When I went to investigate the specific exception which was occurring, it turned out to be ModuleVersionResolveException. It is occurring on many dependencies, so I can’t pin down a specific cause. I don’t see anything in the log, and the operation just completes successfully after 10-20 minutes has passed, so I’m left worrying that Gradle is using exceptions as flow control, with no means of debugging it to figure out why.