ThreeTen / threeten

This project was the home of code used to develop a modern date and time library for JDK8. Development has moved to OpenJDK and a separate backport project, threetenbp.
http://threeten.github.io/
191 stars 37 forks source link

Inconsistent javadoc for Adjusters.dayOfWeekInMonth #265

Closed RogerRiggs closed 11 years ago

RogerRiggs commented 11 years ago

The javadoc of the method Adjusters.dayOfWeekInMonth says:

Throws: IllegalArgumentException - if the ordinal is invalid

Even though it also states:

The ordinal number of weeks is not validated and is interpreted leniently according to this algorithm.

and:

Parameters: ordinal - the week within the month, unbound but typically from -5 to 5

I guess the @throws tag is a leftover that should be removed?

Reported by Anthory Vanelverdinghe

jodastephen commented 11 years ago

"Patch" to fix this (2 changes unbound -> unbounded, and remove @ throws):

     *
     * @param ordinal  the week within the month, unbounded but typically from -5 to 5
     * @param dayOfWeek  the day-of-week, not null
     * @return the day-of-week in month adjuster, not null
     */
jodastephen commented 11 years ago

Fixed by http://hg.openjdk.java.net/threeten/threeten/jdk/rev/35bfe067692d