Amend javadoc @throws tags

This commit is contained in:
Zafar Khaja 2014-06-24 08:24:15 +03:00
parent d36d961555
commit 4518723d66

View File

@ -173,9 +173,8 @@ class VersionParser implements Parser<Version> {
* *
* @param input the input string to parse * @param input the input string to parse
* @return a valid version object * @return a valid version object
* @throws ParseException when there is an error defined in * @throws ParseException when there is a grammar error
* the SemVer or the formal grammar * @throws UnexpectedCharacterException when encounters an unexpected character type
* @throws UnexpectedElementException when encounters an unexpected character type
*/ */
@Override @Override
public Version parse(String input) { public Version parse(String input) {
@ -188,9 +187,8 @@ class VersionParser implements Parser<Version> {
* @param version the version string to parse * @param version the version string to parse
* @return a valid version object * @return a valid version object
* @throws IllegalArgumentException if the input string is {@code NULL} or empty * @throws IllegalArgumentException if the input string is {@code NULL} or empty
* @throws ParseException when there is an error defined in * @throws ParseException when there is a grammar error
* the SemVer or the formal grammar * @throws UnexpectedCharacterException when encounters an unexpected character type
* @throws UnexpectedElementException when encounters an unexpected character type
*/ */
static Version parseValidSemVer(String version) { static Version parseValidSemVer(String version) {
VersionParser parser = new VersionParser(version); VersionParser parser = new VersionParser(version);
@ -203,9 +201,8 @@ class VersionParser implements Parser<Version> {
* @param versionCore the version core string to parse * @param versionCore the version core string to parse
* @return a valid normal version object * @return a valid normal version object
* @throws IllegalArgumentException if the input string is {@code NULL} or empty * @throws IllegalArgumentException if the input string is {@code NULL} or empty
* @throws ParseException when there is an error defined in * @throws ParseException when there is a grammar error
* the SemVer or the formal grammar * @throws UnexpectedCharacterException when encounters an unexpected character type
* @throws UnexpectedElementException when encounters an unexpected character type
*/ */
static NormalVersion parseVersionCore(String versionCore) { static NormalVersion parseVersionCore(String versionCore) {
VersionParser parser = new VersionParser(versionCore); VersionParser parser = new VersionParser(versionCore);
@ -218,8 +215,8 @@ class VersionParser implements Parser<Version> {
* @param preRelease the pre-release version string to parse * @param preRelease the pre-release version string to parse
* @return a valid pre-release version object * @return a valid pre-release version object
* @throws IllegalArgumentException if the input string is {@code NULL} or empty * @throws IllegalArgumentException if the input string is {@code NULL} or empty
* @throws ParseException when there is an error defined in * @throws ParseException when there is a grammar error
* the SemVer or the formal grammar * @throws UnexpectedCharacterException when encounters an unexpected character type
*/ */
static MetadataVersion parsePreRelease(String preRelease) { static MetadataVersion parsePreRelease(String preRelease) {
VersionParser parser = new VersionParser(preRelease); VersionParser parser = new VersionParser(preRelease);
@ -232,8 +229,8 @@ class VersionParser implements Parser<Version> {
* @param build the build metadata string to parse * @param build the build metadata string to parse
* @return a valid build metadata object * @return a valid build metadata object
* @throws IllegalArgumentException if the input string is {@code NULL} or empty * @throws IllegalArgumentException if the input string is {@code NULL} or empty
* @throws ParseException when there is an error defined in * @throws ParseException when there is a grammar error
* the SemVer or the formal grammar * @throws UnexpectedCharacterException when encounters an unexpected character type
*/ */
static MetadataVersion parseBuild(String build) { static MetadataVersion parseBuild(String build) {
VersionParser parser = new VersionParser(build); VersionParser parser = new VersionParser(build);
@ -306,7 +303,6 @@ class VersionParser implements Parser<Version> {
* </pre> * </pre>
* *
* @return a valid pre-release version object * @return a valid pre-release version object
* @throws ParseException if the pre-release version has empty identifier(s)
*/ */
private MetadataVersion parsePreRelease() { private MetadataVersion parsePreRelease() {
ensureValidLookahead(DIGIT, LETTER, HYPHEN); ensureValidLookahead(DIGIT, LETTER, HYPHEN);
@ -357,7 +353,6 @@ class VersionParser implements Parser<Version> {
* </pre> * </pre>
* *
* @return a valid build metadata object * @return a valid build metadata object
* @throws ParseException if the build metadata has empty identifier(s)
*/ */
private MetadataVersion parseBuild() { private MetadataVersion parseBuild() {
ensureValidLookahead(DIGIT, LETTER, HYPHEN); ensureValidLookahead(DIGIT, LETTER, HYPHEN);
@ -407,7 +402,6 @@ class VersionParser implements Parser<Version> {
* </pre> * </pre>
* *
* @return a string representing the numeric identifier * @return a string representing the numeric identifier
* @throws ParseException if the numeric identifier has leading zero(es)
*/ */
private String numericIdentifier() { private String numericIdentifier() {
checkForLeadingZeroes(); checkForLeadingZeroes();
@ -509,7 +503,7 @@ class VersionParser implements Parser<Version> {
* *
* @param expected the expected types of the next character * @param expected the expected types of the next character
* @return the next character in the stream * @return the next character in the stream
* @throws UnexpectedCharacterException if the next element is of an unexpected type * @throws UnexpectedCharacterException when encounters an unexpected character type
*/ */
private Character consumeNextCharacter(CharType... expected) { private Character consumeNextCharacter(CharType... expected) {
try { try {
@ -523,7 +517,7 @@ class VersionParser implements Parser<Version> {
* Checks if the next character in the stream is valid. * Checks if the next character in the stream is valid.
* *
* @param expected the expected types of the next character * @param expected the expected types of the next character
* @throws UnexpectedCharacterException if the next element is not valid * @throws UnexpectedCharacterException if the next character is not valid
*/ */
private void ensureValidLookahead(CharType... expected) { private void ensureValidLookahead(CharType... expected) {
if (!chars.positiveLookahead(expected)) { if (!chars.positiveLookahead(expected)) {