RFR: JDK-8151604: Rely on options range checking rather than explict checks

Derek White derek.white at oracle.com
Thu Mar 10 16:03:41 UTC 2016


On 3/10/16 4:59 AM, Bengt Rutisson wrote:
>
> Hi everyone,
>
> Could I have a couple of reviews for this change?
>
> http://cr.openjdk.java.net/~brutisso/8151604/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8151604
>
> With the new range checking in the argument parsing we don't need to 
> have explicit checks in the code to handle invalid arguments.
>
> Thanks,
> Bengt

Great idea. Only comment is that this can go further (I only checked 
g1CollectorPolicy):

g1CollectorPolicy.cpp:
- Line 186, can change tests of MaxGCPauseMillis to guarantee(), because:
           range(1, max_uintx)
- Line 192, can change tests of GCPauseIntervalMillis to guarantee(), 
because:
           OK, this doesn't have a range defined, but it should: 
range(1, max_uintx)

The checks from lines 220-228 are probably covered by the constraint 
functions (MaxGCPauseMillisConstraintFunc(), etc), but this RFE is about 
ranges :-)

  - Line 293, can change tests of SurvivorRatio to guarantee(), because:
             range(1, max_uintx-2)

  - Derek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20160310/b45556a6/attachment.htm>


More information about the hotspot-gc-dev mailing list