Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x
This commit is contained in:
commit
640801987c
|
@ -52,7 +52,7 @@ public class PostConstructAnnotationHandler extends AbstractIntrospectableAnnota
|
||||||
Method m = (Method)methods[i];
|
Method m = (Method)methods[i];
|
||||||
if (m.isAnnotationPresent(PostConstruct.class))
|
if (m.isAnnotationPresent(PostConstruct.class))
|
||||||
{
|
{
|
||||||
if (m.getParameterTypes().length != 0)
|
if (m.getParameterCount() != 0)
|
||||||
throw new IllegalStateException(m+" has parameters");
|
throw new IllegalStateException(m+" has parameters");
|
||||||
if (m.getReturnType() != Void.TYPE)
|
if (m.getReturnType() != Void.TYPE)
|
||||||
throw new IllegalStateException(m+" is not void");
|
throw new IllegalStateException(m+" is not void");
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class PreDestroyAnnotationHandler extends AbstractIntrospectableAnnotatio
|
||||||
Method m = (Method)methods[i];
|
Method m = (Method)methods[i];
|
||||||
if (m.isAnnotationPresent(PreDestroy.class))
|
if (m.isAnnotationPresent(PreDestroy.class))
|
||||||
{
|
{
|
||||||
if (m.getParameterTypes().length != 0)
|
if (m.getParameterCount() != 0)
|
||||||
throw new IllegalStateException(m+" has parameters");
|
throw new IllegalStateException(m+" has parameters");
|
||||||
if (m.getReturnType() != Void.TYPE)
|
if (m.getReturnType() != Void.TYPE)
|
||||||
throw new IllegalStateException(m+" is not void");
|
throw new IllegalStateException(m+" is not void");
|
||||||
|
|
|
@ -257,7 +257,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method.getParameterTypes().length != 1)
|
if (method.getParameterCount() != 1)
|
||||||
{
|
{
|
||||||
LOG.warn("Skipping Resource annotation on "+clazz.getName()+"."+method.getName()+": invalid java bean, not single argument to method");
|
LOG.warn("Skipping Resource annotation on "+clazz.getName()+"."+method.getName()+": invalid java bean, not single argument to method");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -676,7 +676,7 @@ public class ObjectMBean implements DynamicMBean
|
||||||
{
|
{
|
||||||
|
|
||||||
// look for a declared setter
|
// look for a declared setter
|
||||||
if (methods[m].getName().equals(declaredSetter) && methods[m].getParameterTypes().length == 1)
|
if (methods[m].getName().equals(declaredSetter) && methods[m].getParameterCount() == 1)
|
||||||
{
|
{
|
||||||
if (setter != null)
|
if (setter != null)
|
||||||
{
|
{
|
||||||
|
@ -695,7 +695,7 @@ public class ObjectMBean implements DynamicMBean
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for a setter
|
// look for a setter
|
||||||
if ( methods[m].getName().equals("set" + uName) && methods[m].getParameterTypes().length == 1)
|
if ( methods[m].getName().equals("set" + uName) && methods[m].getParameterCount() == 1)
|
||||||
{
|
{
|
||||||
if (setter != null)
|
if (setter != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class JSONObjectConvertor implements JSON.Convertor
|
||||||
{
|
{
|
||||||
Method m=methods[i];
|
Method m=methods[i];
|
||||||
if (!Modifier.isStatic(m.getModifiers()) &&
|
if (!Modifier.isStatic(m.getModifiers()) &&
|
||||||
m.getParameterTypes().length==0 &&
|
m.getParameterCount()==0 &&
|
||||||
m.getReturnType()!=null &&
|
m.getReturnType()!=null &&
|
||||||
m.getDeclaringClass()!=Object.class)
|
m.getDeclaringClass()!=Object.class)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class JSONPojoConvertor implements JSON.Convertor
|
||||||
if (!Modifier.isStatic(m.getModifiers()) && m.getDeclaringClass()!=Object.class)
|
if (!Modifier.isStatic(m.getModifiers()) && m.getDeclaringClass()!=Object.class)
|
||||||
{
|
{
|
||||||
String name=m.getName();
|
String name=m.getName();
|
||||||
switch(m.getParameterTypes().length)
|
switch(m.getParameterCount())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class IntrospectionUtil
|
||||||
if (!method.getName().startsWith("set"))
|
if (!method.getName().startsWith("set"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (method.getParameterTypes().length != 1)
|
if (method.getParameterCount() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -517,7 +517,7 @@ public class TypeUtil
|
||||||
{
|
{
|
||||||
if (!method.getName().equals(methodName))
|
if (!method.getName().equals(methodName))
|
||||||
continue;
|
continue;
|
||||||
if (method.getParameterTypes().length != arg.length)
|
if (method.getParameterCount() != arg.length)
|
||||||
continue;
|
continue;
|
||||||
if (Modifier.isStatic(method.getModifiers()) != (obj == null))
|
if (Modifier.isStatic(method.getModifiers()) != (obj == null))
|
||||||
continue;
|
continue;
|
||||||
|
@ -541,7 +541,7 @@ public class TypeUtil
|
||||||
{
|
{
|
||||||
if (!method.getName().equals(methodName))
|
if (!method.getName().equals(methodName))
|
||||||
continue;
|
continue;
|
||||||
if (method.getParameterTypes().length != arg.length+1)
|
if (method.getParameterCount() != arg.length+1)
|
||||||
continue;
|
continue;
|
||||||
if (!method.getParameterTypes()[arg.length].isArray())
|
if (!method.getParameterTypes()[arg.length].isArray())
|
||||||
continue;
|
continue;
|
||||||
|
@ -575,10 +575,10 @@ public class TypeUtil
|
||||||
if (arguments == null)
|
if (arguments == null)
|
||||||
{
|
{
|
||||||
// null arguments in .newInstance() is allowed
|
// null arguments in .newInstance() is allowed
|
||||||
if (constructor.getParameterTypes().length != 0)
|
if (constructor.getParameterCount() != 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (constructor.getParameterTypes().length != arguments.length)
|
else if (constructor.getParameterCount() != arguments.length)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -603,10 +603,10 @@ public class TypeUtil
|
||||||
if (arguments == null)
|
if (arguments == null)
|
||||||
{
|
{
|
||||||
// null arguments in .newInstance() is allowed
|
// null arguments in .newInstance() is allowed
|
||||||
if (constructor.getParameterTypes().length != 0)
|
if (constructor.getParameterCount() != 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (constructor.getParameterTypes().length != arguments.length)
|
else if (constructor.getParameterCount() != arguments.length)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue