You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/08/07 15:21:49 UTC

[2/2] git commit: Non-functional changes

Non-functional changes

Minor fixes in comments
Calculate local variable just once
Append char instead of String when possible


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

Branch: refs/heads/wicket-6.x
Commit: 7b0d8ea0c981d6cdff2a12f5b7317f7170ecec43
Parents: 7042f88
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Aug 7 15:20:30 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Aug 7 15:20:30 2014 +0200

----------------------------------------------------------------------
 wicket-core/src/main/java/org/apache/wicket/Component.java   | 8 ++++----
 .../java/org/apache/wicket/model/AbstractPropertyModel.java  | 8 ++------
 .../src/main/java/org/apache/wicket/model/ChainingModel.java | 4 ++--
 3 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/7b0d8ea0/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java
index d5e28cc..7f115ae 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3708,7 +3708,7 @@ public abstract class Component
 	 * {@link IComponentInheritedModel#wrapOnInheritance(Component)}.
 	 * <p>
 	 * For example a {@link FormComponent} has the opportunity to instantiate a model on the fly
-	 * usings its {@code id} and the containing {@link Form}'s model, if the form holds a
+	 * using its {@code id} and the containing {@link Form}'s model, if the form holds a
 	 * {@link CompoundPropertyModel}.
 	 * 
 	 * @return The model
@@ -3716,13 +3716,13 @@ public abstract class Component
 	protected IModel<?> initModel()
 	{
 		IModel<?> foundModel = null;
-		// Search parents for CompoundPropertyModel
+		// Search parents for IComponentInheritedModel (i.e. CompoundPropertyModel)
 		for (Component current = getParent(); current != null; current = current.getParent())
 		{
 			// Get model
-			// Don't call the getModel() that could initialize many inbetween
+			// Don't call the getModel() that could initialize many in between
 			// completely useless models.
-			// IModel model = current.getModel();
+			// IModel model = current.getDefaultModel();
 			IModel<?> model = current.getModelImpl();
 
 			if (model instanceof IWrapModel && !(model instanceof IComponentInheritedModel))

http://git-wip-us.apache.org/repos/asf/wicket/blob/7b0d8ea0/wicket-core/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java b/wicket-core/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
index 78746ef..4ff21da 100644
--- a/wicket-core/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
@@ -141,14 +141,14 @@ public abstract class AbstractPropertyModel<T> extends ChainingModel<T>
 	public Class<T> getObjectClass()
 	{
 		final String expression = propertyExpression();
+		final Object target = getInnermostModelOrObject();
+
 		if (Strings.isEmpty(expression))
 		{
 			// Return a meaningful value for an empty property expression
-			Object target = getInnermostModelOrObject();
 			return (Class<T>)(target != null ? target.getClass() : null);
 		}
 
-		final Object target = getInnermostModelOrObject();
 		if (target != null)
 		{
 			try
@@ -179,9 +179,6 @@ public abstract class AbstractPropertyModel<T> extends ChainingModel<T>
 		return null;
 	}
 
-	/**
-	 * @see org.apache.wicket.model.IPropertyReflectionAwareModel#getPropertyField()
-	 */
 	@Override
 	public Field getPropertyField()
 	{
@@ -260,7 +257,6 @@ public abstract class AbstractPropertyModel<T> extends ChainingModel<T>
 	/**
 	 * @return The innermost model or the object if the target is not a model
 	 */
-	// legacy method ...
 	public final Object getInnermostModelOrObject()
 	{
 		Object object = getTarget();

http://git-wip-us.apache.org/repos/asf/wicket/blob/7b0d8ea0/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java b/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
index 8235a4b..b88c15b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
@@ -144,8 +144,8 @@ public abstract class ChainingModel<T> implements IChainingModel<T>
 	public String toString()
 	{
 		StringBuilder sb = new StringBuilder("Model:classname=[");
-		sb.append(getClass().getName()).append("]");
-		sb.append(":nestedModel=[").append(target).append("]");
+		sb.append(getClass().getName()).append(']');
+		sb.append(":nestedModel=[").append(target).append(']');
 		return sb.toString();
 	}
 }