Add check against uninitialized vals to reflective discovery

git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@935 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
dmharrah 2009-08-02 01:12:24 +00:00
parent e3517c7a6f
commit 22f2d5b993
1 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,11 @@ object ReflectUtilities
if(method.getParameterTypes.length == 0 && clazz.isAssignableFrom(method.getReturnType))
{
for(field <- correspondingFields.get(method.getName) if field.getType == method.getReturnType)
mappings(method.getName) = method.invoke(self).asInstanceOf[T]
{
val value = method.invoke(self).asInstanceOf[T]
assume(value != null, "val " + method.getName + " was null")
mappings(method.getName) = value
}
}
}
mappings