You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2016/04/20 15:48:00 UTC

wicket git commit: Removed deprecated method AjaxEventBehavior#onCheckEvent

Repository: wicket
Updated Branches:
  refs/heads/master bea2469af -> cb106d966


Removed deprecated method AjaxEventBehavior#onCheckEvent


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

Branch: refs/heads/master
Commit: cb106d96693a2f7aca521a69b511fe6a70a1f2a0
Parents: bea2469
Author: Andrea Del Bene <ad...@apache.org>
Authored: Wed Apr 20 15:47:04 2016 +0200
Committer: Andrea Del Bene <ad...@apache.org>
Committed: Wed Apr 20 15:47:04 2016 +0200

----------------------------------------------------------------------
 .../apache/wicket/ajax/AjaxEventBehavior.java   | 23 --------------------
 .../wicket/ajax/AjaxEventBehaviorTest.java      |  9 --------
 2 files changed, 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/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 a0456a4..46369ad 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
@@ -80,8 +80,6 @@ public abstract class AjaxEventBehavior extends AbstractDefaultAjaxBehavior
 	{
 		Args.notEmpty(event, "event");
 
-		onCheckEvent(event);
-
 		this.event = event;
 	}
 
@@ -109,27 +107,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));
-		}
-
-	}
-
-	/**
 	 * @return event
 	 *      the event this behavior is attached to
 	 */

http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
index df0a690..6a8ca48 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
@@ -93,15 +93,6 @@ public class AjaxEventBehaviorTest extends WicketTestCase
 		AjaxEventBehavior behavior = new EventNamesBehavior("event");
 		assertThat(behavior.getEvent(), is("event"));
 
-		behavior = new EventNamesBehavior("event");
-		assertThat(behavior.getEvent(), is("event"));
-
-		behavior = new EventNamesBehavior("event event2");
-		assertThat(behavior.getEvent(), is("event event2"));
-
-		behavior = new EventNamesBehavior("event event2");
-		assertThat(behavior.getEvent(), is("event event2"));
-
 		behavior = new EventNamesBehavior("event event2");
 		assertThat(behavior.getEvent(), is("event event2"));
 


Re: wicket git commit: Removed deprecated method AjaxEventBehavior#onCheckEvent

Posted by andrea del bene <an...@gmail.com>.
Opss, sorry, I haven't seen the issue you opened. I'm changing the code 
as you suggested.

On 20/04/2016 15:52, Martin Grigorov wrote:
> Hi Andrea,
>
> It seems I didn't understand you correctly.
> The test should be removed!
> But the method in AjaxEventBehavior should stay there before we release
> 8.0.0.
> In 7.x we log a WARN message but I have seen several applications already
> where people just ignore it.
> The best we could do is to throw an exception in the milestones (I think we
> are almost ready for 8.0.0-M1!) so developers which decide to try 8.0.0-Mn
> will have to fix their applications.
> I even created https://issues.apache.org/jira/browse/WICKET-6148 yesterday
> to not forget about this before releasing 8.0.0.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Apr 20, 2016 at 3:48 PM, <ad...@apache.org> wrote:
>
>> Repository: wicket
>> Updated Branches:
>>    refs/heads/master bea2469af -> cb106d966
>>
>>
>> Removed deprecated method AjaxEventBehavior#onCheckEvent
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/cb106d96
>> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/cb106d96
>> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/cb106d96
>>
>> Branch: refs/heads/master
>> Commit: cb106d96693a2f7aca521a69b511fe6a70a1f2a0
>> Parents: bea2469
>> Author: Andrea Del Bene <ad...@apache.org>
>> Authored: Wed Apr 20 15:47:04 2016 +0200
>> Committer: Andrea Del Bene <ad...@apache.org>
>> Committed: Wed Apr 20 15:47:04 2016 +0200
>>
>> ----------------------------------------------------------------------
>>   .../apache/wicket/ajax/AjaxEventBehavior.java   | 23 --------------------
>>   .../wicket/ajax/AjaxEventBehaviorTest.java      |  9 --------
>>   2 files changed, 32 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>>
>> http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/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 a0456a4..46369ad 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
>> @@ -80,8 +80,6 @@ public abstract class AjaxEventBehavior extends
>> AbstractDefaultAjaxBehavior
>>          {
>>                  Args.notEmpty(event, "event");
>>
>> -               onCheckEvent(event);
>> -
>>                  this.event = event;
>>          }
>>
>> @@ -109,27 +107,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));
>> -               }
>> -
>> -       }
>> -
>> -       /**
>>           * @return event
>>           *      the event this behavior is attached to
>>           */
>>
>>
>> http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
>> ----------------------------------------------------------------------
>> diff --git
>> a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
>> b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
>> index df0a690..6a8ca48 100644
>> ---
>> a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
>> +++
>> b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
>> @@ -93,15 +93,6 @@ public class AjaxEventBehaviorTest extends
>> WicketTestCase
>>                  AjaxEventBehavior behavior = new
>> EventNamesBehavior("event");
>>                  assertThat(behavior.getEvent(), is("event"));
>>
>> -               behavior = new EventNamesBehavior("event");
>> -               assertThat(behavior.getEvent(), is("event"));
>> -
>> -               behavior = new EventNamesBehavior("event event2");
>> -               assertThat(behavior.getEvent(), is("event event2"));
>> -
>> -               behavior = new EventNamesBehavior("event event2");
>> -               assertThat(behavior.getEvent(), is("event event2"));
>> -
>>                  behavior = new EventNamesBehavior("event event2");
>>                  assertThat(behavior.getEvent(), is("event event2"));
>>
>>
>>


Re: wicket git commit: Removed deprecated method AjaxEventBehavior#onCheckEvent

Posted by Martin Grigorov <mg...@apache.org>.
Hi Andrea,

It seems I didn't understand you correctly.
The test should be removed!
But the method in AjaxEventBehavior should stay there before we release
8.0.0.
In 7.x we log a WARN message but I have seen several applications already
where people just ignore it.
The best we could do is to throw an exception in the milestones (I think we
are almost ready for 8.0.0-M1!) so developers which decide to try 8.0.0-Mn
will have to fix their applications.
I even created https://issues.apache.org/jira/browse/WICKET-6148 yesterday
to not forget about this before releasing 8.0.0.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Apr 20, 2016 at 3:48 PM, <ad...@apache.org> wrote:

> Repository: wicket
> Updated Branches:
>   refs/heads/master bea2469af -> cb106d966
>
>
> Removed deprecated method AjaxEventBehavior#onCheckEvent
>
>
> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/cb106d96
> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/cb106d96
> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/cb106d96
>
> Branch: refs/heads/master
> Commit: cb106d96693a2f7aca521a69b511fe6a70a1f2a0
> Parents: bea2469
> Author: Andrea Del Bene <ad...@apache.org>
> Authored: Wed Apr 20 15:47:04 2016 +0200
> Committer: Andrea Del Bene <ad...@apache.org>
> Committed: Wed Apr 20 15:47:04 2016 +0200
>
> ----------------------------------------------------------------------
>  .../apache/wicket/ajax/AjaxEventBehavior.java   | 23 --------------------
>  .../wicket/ajax/AjaxEventBehaviorTest.java      |  9 --------
>  2 files changed, 32 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/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 a0456a4..46369ad 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
> @@ -80,8 +80,6 @@ public abstract class AjaxEventBehavior extends
> AbstractDefaultAjaxBehavior
>         {
>                 Args.notEmpty(event, "event");
>
> -               onCheckEvent(event);
> -
>                 this.event = event;
>         }
>
> @@ -109,27 +107,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));
> -               }
> -
> -       }
> -
> -       /**
>          * @return event
>          *      the event this behavior is attached to
>          */
>
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/cb106d96/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
> ----------------------------------------------------------------------
> diff --git
> a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
> b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
> index df0a690..6a8ca48 100644
> ---
> a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
> +++
> b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxEventBehaviorTest.java
> @@ -93,15 +93,6 @@ public class AjaxEventBehaviorTest extends
> WicketTestCase
>                 AjaxEventBehavior behavior = new
> EventNamesBehavior("event");
>                 assertThat(behavior.getEvent(), is("event"));
>
> -               behavior = new EventNamesBehavior("event");
> -               assertThat(behavior.getEvent(), is("event"));
> -
> -               behavior = new EventNamesBehavior("event event2");
> -               assertThat(behavior.getEvent(), is("event event2"));
> -
> -               behavior = new EventNamesBehavior("event event2");
> -               assertThat(behavior.getEvent(), is("event event2"));
> -
>                 behavior = new EventNamesBehavior("event event2");
>                 assertThat(behavior.getEvent(), is("event event2"));
>
>
>