You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/02/20 19:53:39 UTC
[maven] 03/04: Additional modifications from reviews:
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-6572
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 01eb2e962467b0e3150a5f386e0294e67a306e53
Author: Gabriel Belingueres <be...@gmail.com>
AuthorDate: Sun Jan 27 00:25:28 2019 -0300
Additional modifications from reviews:
- Declare ArrayDeque variable by its interface (Deque).
- Changed throwed RuntimeException by IllegalStateException.
---
.../apache/maven/artifact/versioning/ComparableVersion.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
index c32760f..6d190d7 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
@@ -23,6 +23,7 @@ import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -142,7 +143,7 @@ public class ComparableVersion
return 1; // 1.1 > 1-1
default:
- throw new RuntimeException( "invalid item: " + item.getClass() );
+ throw new IllegalStateException( "invalid item: " + item.getClass() );
}
}
@@ -204,7 +205,7 @@ public class ComparableVersion
return 1; // 1.1 > 1-1
default:
- throw new RuntimeException( "invalid item: " + item.getClass() );
+ throw new IllegalStateException( "invalid item: " + item.getClass() );
}
}
@@ -267,7 +268,7 @@ public class ComparableVersion
return 1; // 1.1 > 1-1
default:
- throw new RuntimeException( "invalid item: " + item.getClass() );
+ throw new IllegalStateException( "invalid item: " + item.getClass() );
}
}
@@ -375,7 +376,7 @@ public class ComparableVersion
return -1; // 1.any < 1-1
default:
- throw new RuntimeException( "invalid item: " + item.getClass() );
+ throw new IllegalStateException( "invalid item: " + item.getClass() );
}
}
@@ -463,7 +464,7 @@ public class ComparableVersion
return 0;
default:
- throw new RuntimeException( "invalid item: " + item.getClass() );
+ throw new IllegalStateException( "invalid item: " + item.getClass() );
}
}
@@ -498,7 +499,7 @@ public class ComparableVersion
ListItem list = items;
- ArrayDeque<Item> stack = new ArrayDeque<>();
+ Deque<Item> stack = new ArrayDeque<>();
stack.push( list );
boolean isDigit = false;