boolean needsPrimitive = ! ( expectedTypeDescr.startsWith( "L" ) || expectedTypeDescr.startsWith( "[" ) );
String returnedType = isObject ? "Ljava/lang/Object;" : typeDescr(declaration.getTypeName());
mv.visitMethodInsn(INVOKEVIRTUAL, Declaration.class.getName().replace('.', '/'), readMethod,
"(L" + InternalWorkingMemory.class.getName().replace('.', '/') +";Ljava/lang/Object;)" + returnedType);
if (isObject) {
InternalReadAccessor extractor = declaration.getExtractor();
if (extractor != null) {
cast(extractor.getExtractToClass());
}
}
if ( needsPrimitive && isObject ) {
castToPrimitive( convertPrimitiveNameToType( declarationType) );