Skip to content

Commit c3cd20a

Browse files
authored
declare exception throwing in constructor
add "throws IllegalArgumentException" to one of the constructors, which already claims throwing it via javadoc
1 parent e19180d commit c3cd20a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/com/google/openlocationcode/OpenLocationCode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public double getEastLongitude() {
152152
* @throws IlegalArgumentException when the passed code is not valid.
153153
* @constructor
154154
*/
155-
public OpenLocationCode(String code) {
155+
public OpenLocationCode(String code)
156+
throws IllegalArgumentException {
156157
if (!isValidCode(code.toUpperCase())) {
157158
throw new IllegalArgumentException(
158159
"The provided code '" + code + "' is not a valid Open Location Code.");

0 commit comments

Comments
 (0)