[Sablevm-developer] primitive types and isAssignableFrom
Brought to you by:
egagnon
|
From: Laurent M. <la...@ao...> - 2004-05-19 13:20:44
|
Hi,
I think the following implementation of
java.lang.isAssignableFrom(Class) should be OK for primitive types too:
public boolean isAssignableFrom(Class c)
{
if (c == null) {
throw new NullPointerException();
} else if (this.isPrimitive() || c.isPrimitive()) {
return this == c;
} else {
return VMClass.isAssignableFrom (this, c);
}
}
--
Laurent Martelli
la...@ao... Java Aspect Components
http://www.aopsys.com/ http://jac.objectweb.org
|