RFR: 5050783: Throwable convenience method: String getStackTraceString()
claes.redestad at oracle.com
Wed Dec 31 13:32:27 UTC 2014
seems like a reasonable convenience method. :-)
Process stuff: OCA/JSPA signing aside, the patch needs to be submitted
entirety to some part of the OpenJDK infrastructure before it can be
Attaching the patch in an e-mail to this mailing list is acceptable for
patch like this when lacking upload privileges to cr.openjdk.java.net. A
could help you with the uploading etc.
This request adds a new public method, which means some internal approval
will be necessary. This is something you'll need help with from an Oracle
sponsor. I could volunteer to initiate the requests internally.
The test relies on the message generated when provoking a division by
zero. I'm not sure this is a good idea nor the place to enforce this
message format with a test. Perhaps just throwing a RuntimeException
with some specified message and test for that?
May I suggest to also add a test to ensure the method behaves well for an
exception with fillInStackTrace overridden to produce stackless exceptions?
Just a thought... I noticed PrintWriter, PrintStream and StringBuilder all
inherit from Appendable, so the PrintStreamOrWriter/StackTracePrinter
could be replaced with a single StackTraceAppendable taking an
static class instead of 1 abstract and 3 concrete static inner classes
out to be a good deal, but there's some odd mechanics in
to use the value of the line.separator property at object creation time
would be hard to support without exposing the lineSeparator fields to
Perhaps a future consideration.
Performance characteristics might change ever so slightly either way, so it
would be nice with some microbenchmarks to quantify.
On 2014-12-31 11:51, Ivan St. Ivanov wrote:
> I am Ivan from the Bulgarian Java User Group. As part of our Adopt OpenJDK
> efforts, we organized hackathon beginning of this month in Sofia. There we
> worked on the following JIRA issue:
> Unfortunately none of us has author privileges, so the issue is still
> unassigned. But, nevertheless, our JUG has already signed JSPA and some of
> our members (including myself) have signed OCA. And we informed in a
> special email this mailing list about our plans prior to the meeting.
> Our hackathon was already documented by our JUG member Mihail Stoynov:
> We used the days after the meeting for offline polishing our contribution
> and adding some more unit tests. Here is the result of our work:
> We would be very happy if you are able to review it, share your feedback
> and guide us through the contribution process as this is our first attempt.
> Thanks and have a very successful year!
More information about the core-libs-dev