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 2019/10/10 11:37:09 UTC
[wicket] branch wicket-8.x updated: Minor cleanups.
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/wicket-8.x by this push:
new 690a1eb Minor cleanups.
690a1eb is described below
commit 690a1eb352b22a72a49c7347c6466d3f17eff154
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Thu Oct 10 14:35:36 2019 +0300
Minor cleanups.
Use 'type' variable instead of another reflection call.
Do not create an array for varargs methods.
'public' modifier is implicit for interface methods
---
.../wicket/core/util/lang/PropertyResolver.java | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java
index 7459ee3..2372e06 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java
@@ -293,7 +293,7 @@ public final class PropertyResolver
break;
}
- IGetAndSet getAndSet = null;
+ IGetAndSet getAndSet;
try
{
getAndSet = getGetAndSet(exp, clz);
@@ -485,12 +485,12 @@ public final class PropertyResolver
*
* @return The value of this property
*/
- public Object getValue(final Object object);
+ Object getValue(final Object object);
/**
* @return The target class of the object that as to be set.
*/
- public Class<?> getTargetClass();
+ Class<?> getTargetClass();
/**
* @param object
@@ -498,30 +498,30 @@ public final class PropertyResolver
*
* @return The new value for the property that is set back on that object.
*/
- public Object newValue(Object object);
+ Object newValue(Object object);
/**
* @param object
* @param value
* @param converter
*/
- public void setValue(final Object object, final Object value,
+ void setValue(final Object object, final Object value,
PropertyResolverConverter converter);
/**
* @return Field or null if there is no field
*/
- public Field getField();
+ Field getField();
/**
* @return Getter method or null if there is no getter
*/
- public Method getGetter();
+ Method getGetter();
/**
* @return Setter of null if there is no setter
*/
- public Method getSetter();
+ Method getSetter();
}
public static abstract class AbstractGetAndSet implements IGetAndSet
@@ -979,7 +979,7 @@ public final class PropertyResolver
"]. Can't convert value: " + value + " to class: " +
type + " for setting it on " + object);
}
- else if (setMethod != null && setMethod.getParameterTypes()[0].isPrimitive())
+ else if (setMethod != null && type.isPrimitive())
{
throw new ConversionException("Method [" + setMethod +
"]. Can't convert null value to a primitive class: " +
@@ -1038,7 +1038,7 @@ public final class PropertyResolver
}
try
{
- Method method = clz.getMethod(name, new Class[] { getMethod.getReturnType() });
+ Method method = clz.getMethod(name, getMethod.getReturnType());
if (method != null)
{
method.setAccessible(true);
@@ -1464,7 +1464,7 @@ public final class PropertyResolver
// and setPropertyIndex(int, object)
String name = Character.toUpperCase(propertyName.charAt(0)) +
propertyName.substring(1);
- method = clz.getMethod(GET + name, new Class[] { int.class });
+ method = clz.getMethod(GET + name, int.class);
getAndSet = new IndexedPropertyGetAndSet(method, parsedIndex);
}
catch (Exception e)