A similar question provides the answer.
According to the JLS, by default, the stacktrace is filled in when the exception is instantiated. However, there are times that you might want to "reset" the stack to some more useful location when rethrowing.
To allow this functionality, we have fillInStackTrace()
EDIT
Well, today I learned the Java standard library specification was removed from the JLS after revision 1. As the preface to the second edition states:
The specifications of the libraries are now far too large to fit into this volume, and
they continue to evolve. Consequently, API specifications have been removed from
this book. The library specifications can be found on the Web; this specification
now concentrates solely on the Java programming language proper.
As such, we really need to look more closely at the javadoc to figure this out. The API is here surprisingly loose. The entire relevant portions are from the header, which states:
Instances of two subclasses, Error and Exception, are conventionally used to indicate
that exceptional situations have occurred. Typically, these instances are freshly
created in the context of the exceptional situation so as to include relevant
information (such as stack trace data).
And java.lang.Throwable.printStackTrace() is
Prints this throwable and its backtrace to the standard error stream.
My belief is that this is to allow VM implementors to provide whatever is the most performant/appropriate implementation for their context. With this context, having the explicit fillInStackTrace() public makes even more sense.
By default, the Virtual Machines provides you with it's best effort backtrace location. Making fillInStackTrace() public allows developers to refine further.
--
one final edit :)
I managed to track down a remaining link to the relevant bits of the JLS First Edition and I'd like to offer one further reason why the method is public. It's for better or worse a common explanation in Java.
It was always been this way.