Author: jdonnerstag
Date: Sat Jun 27 07:46:20 2009
New Revision: 788935
URL: http://svn.apache.org/viewvc?rev=788935&view=rev
Log:
one more java5 for loop in Component
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java?rev=788935&r1=788934&r2=788935&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
(original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java Sat Jun
27 07:46:20 2009
@@ -195,7 +195,6 @@
* @author Johan Compagner
* @author Juergen Donnerstag
* @author Igor Vaynberg (ivaynberg)
- *
*/
public abstract class Component implements IClusterable, IConverterLocator
{
@@ -1211,24 +1210,18 @@
*/
public final void detachBehaviors()
{
- List<IBehavior> behaviors = getBehaviors();
- if (behaviors != null)
+ for (IBehavior behavior : getBehaviors())
{
- for (Iterator<IBehavior> i = behaviors.iterator();
i.hasNext();)
- {
- IBehavior behavior = i.next();
-
- // Always detach models, 'accepted' or not.
Otherwise, if they
- // are accepted during render, but not here -
something can go
- // undetached, and calling isEnabled can also
lead to nasty side
- // effects. See for instance Timo's comment on
- //
http://issues.apache.org/jira/browse/WICKET-673
- behavior.detach(this);
+ // Always detach models, 'accepted' or not. Otherwise,
if they
+ // are accepted during render, but not here - something
can go
+ // undetached, and calling isEnabled can also lead to
nasty side
+ // effects. See for instance Timo's comment on
+ // http://issues.apache.org/jira/browse/WICKET-673
+ behavior.detach(this);
- if (behavior.isTemporary())
- {
- removeBehavior(behavior);
- }
+ if (behavior.isTemporary())
+ {
+ removeBehavior(behavior);
}
}
}