It's not in this method. Please check up, using the debugger. Catch all exceptions in this thread and see what happens; it should give you exact location.
And the body of your method should be just one line:
return (sum1 + sum2) * (sum1 - sum2 + 1) / 2;
Of course, what you write is not a mistake, but looks weird…
—SA