RFR: 8050091: LinkedList has incorrect implementation comment

Martin Buchholz martinrb at google.com
Tue Jun 30 17:56:37 UTC 2015


(I've already committed this change...)

Paul and Ivan, I see your point,  but perhaps writing a commented out
dataStructureInvariants method should be some kind of best practice, at
least for classes where we're not willing to pay the bytecode cost of
having the assertions be real code.  This is no different in principle from
the other commented out assert statements in the same source file.

On Tue, Jun 30, 2015 at 1:27 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:

>
> On Jun 26, 2015, at 10:04 PM, Martin Buchholz <martinrb at google.com> wrote:
>
> > Hi Ivan, I'd like you to do a code review.
> >
> > https://bugs.openjdk.java.net/browse/JDK-8050091
> >
> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/LinkedList-invariant/
>
>
> I would prefer if there was some text with the commented out method
> explaining the method, and why this it is not actually explicitly called,
> for example:
>
> /*
> The first and last node must have invariants as represented by assertions
> in the following method:
>
>
> This method is not explicitly utilized because <place some blurb about
> asserts and inlining and link to the corresponding issue?>. Such invariants
> are verified by unit tests.
> */
>
> Otherwise, this is just too obtuse for developers not familiar with the
> code base (now, or imagine 5 years in the future). Regardless of the method
> name it looks like dead code that someone forgot to remove.
>
> Paul.
>



More information about the core-libs-dev mailing list