Skip to content

Throw UnsupportedOperationException when default lazy method is called #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions scripts/generate-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,7 @@ $(cat <<EOD
* @since 0.10.0
*/
default ${class}<$(echo $(for j in `seq 1 ${i}`;do echo -n "A${j}, ";done) | sed 's/,$//'), Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(${class}.class.getName())
.warning("the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(${args}) {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments10Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments10Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments10Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments11Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments11Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments11Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments12Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments12Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments12Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments13Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments13Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments13Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments14Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments14Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments14Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments15Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments15Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments15Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments16Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments16Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments16Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments1Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments1Validator<A1, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments1Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1) {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments2Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments2Validator<A1, A2, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments2Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2) {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments3Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments3Validator<A1, A2, A3, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments3Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3) {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments4Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments4Validator<A1, A2, A3, A4, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments4Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments5Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments5Validator<A1, A2, A3, A4, A5, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments5Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments6Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments6Validator<A1, A2, A3, A4, A5, A6, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments6Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments7Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments7Validator<A1, A2, A3, A4, A5, A6, A7, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments7Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments8Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments8Validator<A1, A2, A3, A4, A5, A6, A7, A8, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments8Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/am/ik/yavi/arguments/Arguments9Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ default <A> Arguments1Validator<A, X> compose(
* @since 0.10.0
*/
default Arguments9Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, Supplier<X>> lazy() {
// WARNING:: The default implementation is not really lazy!
java.util.logging.Logger.getLogger(Arguments9Validator.class.getName()).warning(
"the default implementation of lazy() is called which is not really lazy!");
return this.andThen(x -> () -> x);
throw new UnsupportedOperationException("lazy is not implemented!");
}

default Validated<X> validate(@Nullable A1 a1, @Nullable A2 a2, @Nullable A3 a3,
Expand Down