kripton
kripton copied to clipboard
NullPointerException: Name is null
On JDK >11, when compile an Dao with @SQLInsert an error raise:
error: java.lang.NullPointerException: Name is null
error: at java.lang.Enum.valueOf(null:-1)
error: at com.abubusoft.kripton.android.sqlite.ConflictAlgorithmType.valueOf(ConflictAlgorithmType.java:27)
error: at com.abubusoft.kripton.processor.sqlite.grammars.jql.JQLBuilder.buildJQLInsert(JQLBuilder.java:378)
I think the relevant code is related to extraction method for the annotation attribute value. It can be usefull provide a default value in
Annotation Utilty.
/**
* Estract from an annotation of a property the attribute value specified.
*
* @param item the item
* @param annotationClass annotation to analyze
* @param attribute the attribute
* @return attribute value as list of string
*/
public static String extractAsEnumerationValue(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) {
final Elements elementUtils=BindDataSourceSubProcessor.elementUtils;
final One<String> result = new One<String>();
extractAttributeValue(elementUtils, item, annotationClass.getName(), attribute, new OnAttributeFoundListener() {
@Override
public void onFound(String value) {
if (value.indexOf(".") >= 0)
result.value0 = value.substring(value.lastIndexOf(".") + 1);
}
});
return result.value0;
}