kripton icon indicating copy to clipboard operation
kripton copied to clipboard

NullPointerException: Name is null

Open xcesco opened this issue 7 months ago • 1 comments

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)

xcesco avatar Jul 11 '25 05:07 xcesco

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;
	}

xcesco avatar Jul 11 '25 05:07 xcesco