Fix exception from backend in light classes mode for null passed as annotation argument

This commit is contained in:
Pavel V. Talanov
2015-11-02 19:46:53 +03:00
parent 7e091d0df4
commit f5c4f82971
3 changed files with 25 additions and 1 deletions
@@ -389,7 +389,15 @@ public abstract class AnnotationCodegen {
}
private Void visitUnsupportedValue(ConstantValue<?> value) {
throw new IllegalStateException("Don't know how to compile annotation value " + value);
ClassBuilderMode mode = typeMapper.getClassBuilderMode();
switch (mode) {
case FULL:
throw new IllegalStateException("Don't know how to compile annotation value " + value);
case LIGHT_CLASSES:
return null;
default:
throw new IllegalStateException("Unknown builder mode: " + mode);
}
}
};