WICKET-6148 Remove AjaxEventBehavior#onCheckEvent() before Wicket 8.0.0

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/1b366f0c
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/1b366f0c
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/1b366f0c

Branch: refs/heads/WICKET-6497-unify-js
Commit: 1b366f0c7f205971a5d83c6cc853af0efdfac5df
Parents: 9937049
Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Authored: Fri Nov 24 09:48:31 2017 +0200
Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Committed: Fri Nov 24 09:48:31 2017 +0200

----------------------------------------------------------------------
 .../apache/wicket/ajax/AjaxEventBehavior.java   | 24 --------------------
 .../wicket/markup/head/OnEventHeaderItem.java   | 10 --------
 .../wicket/util/tester/WicketTesterHelper.java  | 10 --------
 3 files changed, 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/1b366f0c/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java 
b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
index a244a3a..23d8a4b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
@@ -18,7 +18,6 @@ package org.apache.wicket.ajax;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Locale;
 
 import org.apache.wicket.Component;
 import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
@@ -77,8 +76,6 @@ public abstract class AjaxEventBehavior extends 
AbstractDefaultAjaxBehavior
        {
                Args.notEmpty(event, "event");
 
-               onCheckEvent(event);
-
                this.event = event;
        }
 
@@ -106,27 +103,6 @@ public abstract class AjaxEventBehavior extends 
AbstractDefaultAjaxBehavior
        }
 
        /**
-        * 
-        * @param event
-        *      the event this behavior will be attached to
-        * @deprecated Wicket 8 Remove this method for Wicket 8.0.0
-        */
-       @Deprecated
-       protected void onCheckEvent(final String event)
-       {
-               if (event.startsWith("on"))
-               {
-                       String shortName = event.substring(2);
-                       throw new IllegalArgumentException(
-                                       String.format("Since version 6.0.0 
Wicket uses JavaScript event registration so there is no need of the leading " +
-                                                                       "'on' 
in the event name '%s'. Please use just '%s'. Wicket 8.x won't manipulate the 
provided event " +
-                                                                       "names 
so the leading 'on' may break your application."
-                                                       , event, 
shortName.toLowerCase(Locale.ENGLISH)));
-               }
-
-       }
-
-       /**
         * @return event
         *      the event this behavior is attached to
         */

http://git-wip-us.apache.org/repos/asf/wicket/blob/1b366f0c/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java
 
b/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java
index b69e7a4..62f3667 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java
@@ -83,17 +83,7 @@ public class OnEventHeaderItem extends HeaderItem
 
                Args.notEmpty(event, "event");
                event = event.toLowerCase(Locale.ENGLISH);
-               if (event.startsWith("on"))
-               {
-                       String shortName = event.substring(2);
-                       throw new IllegalArgumentException(
-                                       String.format("Since version 6.0.0 
Wicket uses JavaScript event registration so there is no need of the leading " +
-                                                                       "'on' 
in the event name '%s'. Please use just '%s'. Wicket 8.x won't manipulate the 
provided event " +
-                                                                       "names 
so the leading 'on' may break your application."
-                                                       , event, shortName));
-               }
                this.event = event;
-
                this.javaScript = javaScript;
        }
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/1b366f0c/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTesterHelper.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTesterHelper.java
 
b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTesterHelper.java
index c9590e3..27e66e4 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTesterHelper.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTesterHelper.java
@@ -206,16 +206,6 @@ public class WicketTesterHelper
                String[] eventNames = Strings.split(event, ' ');
                for (String eventName : eventNames)
                {
-                       if (eventName.startsWith("on"))
-                       {
-                               String shortName = event.substring(2);
-                               throw new IllegalArgumentException(
-                                               String.format("Since version 
6.0.0 Wicket uses JavaScript event registration so there is no need of the 
leading " +
-                                                                               
"'on' in the event name '%s'. Please use just '%s'. Wicket 8.x won't manipulate 
the provided event " +
-                                                                               
"names so the leading 'on' may break your application."
-                                                               , event, 
shortName));
-                       }
-
                        for (Behavior behavior : component.getBehaviors())
                        {
                                if (behavior instanceof AjaxEventBehavior)

Reply via email to