[
https://issues.apache.org/jira/browse/WICKET-6324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940276#comment-15940276
]
Martin Grigorov commented on WICKET-6324:
-----------------------------------------
[~svenmeier]
Why did you make this change:
{code}
diff --git
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxFallbackButton.java
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxFallbackButton.java
index 8fd7ad8..f24dd22 100644
---
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxFallbackButton.java
+++
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxFallbackButton.java
@@ -73,19 +73,19 @@ public abstract class AjaxFallbackButton extends Button
@Override
protected void onSubmit(AjaxRequestTarget target)
{
-
AjaxFallbackButton.this.onSubmit(Optional.ofNullable(target));
+
AjaxFallbackButton.this.onSubmit(Optional.of(target));
{code}
`target` may be null and then this will break at :
{code}
private Optional(T value) {
this.value = Objects.requireNonNull(value);
}
{code}
> AjaxFallbackButton#onError parameter type should be
> Optional<AjaxRequestTarget>
> -------------------------------------------------------------------------------
>
> Key: WICKET-6324
> URL: https://issues.apache.org/jira/browse/WICKET-6324
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 8.0.0-M3
> Reporter: Andrew Geery
> Assignee: Sven Meier
> Priority: Minor
> Fix For: 8.0.0-M4
>
>
> The parameter for AjaxFallbackButton#onSubmit is Optional<AjaxRequestTarget>
> because the AjaxRequestTarget can be null. However, the parameter for
> AjaxFallbackButton#onError is AjaxRequestTarget. The AjaxRequestTarget can
> be null so the parameter to #onError should follow #onSubmit and also be
> Optional.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)