mirror of https://github.com/sbt/sbt.git
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:
parent
e3517c7a6f
commit
22f2d5b993
|
|
@ -42,7 +42,11 @@ object ReflectUtilities
|
||||||
if(method.getParameterTypes.length == 0 && clazz.isAssignableFrom(method.getReturnType))
|
if(method.getParameterTypes.length == 0 && clazz.isAssignableFrom(method.getReturnType))
|
||||||
{
|
{
|
||||||
for(field <- correspondingFields.get(method.getName) if field.getType == 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
|
mappings
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue