@@ -25,9 +25,9 @@ public void executeInit(AnnotatableAbstractEditor editor, Map<String, Object> pa
2525 private void executeInitForClassAnnotations (AnnotatableAbstractEditor editor , Map <String , Object > params ) {
2626 for (Annotation annotation : getClassAnnotations (editor )) {
2727
28- Collection <EditorAnnotationExecutor > supportedAnnotations = getSupportedEditorAnnotationExecutors (annotation );
28+ Collection <EditorAnnotationExecutor > supportedAnnotationExecutors = getSupportedEditorAnnotationExecutors (annotation );
2929
30- for (EditorAnnotationExecutor annotationExecutor : supportedAnnotations ) {
30+ for (EditorAnnotationExecutor annotationExecutor : supportedAnnotationExecutors ) {
3131 annotationExecutor .init (annotation , editor , params );
3232 }
3333 }
@@ -37,13 +37,16 @@ private void executeInitForFieldAnnotations(AnnotatableAbstractEditor editor, Ma
3737 for (Field field : getDeclaredFields (editor )) {
3838 Annotation [] fieldAnnotations = field .getAnnotations ();
3939 for (Annotation annotation : fieldAnnotations ) {
40- com .haulmont .cuba .gui .components .Component fieldValue = getFieldValue (editor , field );
4140
42- Collection <EditorFieldAnnotationExecutor > supportedAnnotations = getSupportedEditorFieldAnnotationExecutors (annotation );
41+ Collection <EditorFieldAnnotationExecutor > supportedAnnotationExecutors = getSupportedEditorFieldAnnotationExecutors (annotation );
4342
44- for (EditorFieldAnnotationExecutor annotationExecutor : supportedAnnotations ) {
45- annotationExecutor .init (annotation , editor , fieldValue , params );
43+ if (supportedAnnotationExecutors != null && supportedAnnotationExecutors .size () > 0 ) {
44+ com .haulmont .cuba .gui .components .Component fieldValue = getFieldValue (editor , field );
45+ for (EditorFieldAnnotationExecutor annotationExecutor : supportedAnnotationExecutors ) {
46+ annotationExecutor .init (annotation , editor , fieldValue , params );
47+ }
4648 }
49+
4750 }
4851 }
4952 }
@@ -59,12 +62,13 @@ private void executeInitForFieldAnnotations(AnnotatableAbstractEditor editor) {
5962 for (Field field : getDeclaredFields (editor )) {
6063 Annotation [] fieldAnnotations = field .getAnnotations ();
6164 for (Annotation annotation : fieldAnnotations ) {
62- com .haulmont .cuba .gui .components .Component fieldValue = getFieldValue (editor , field );
63-
64- Collection <EditorFieldAnnotationExecutor > supportedAnnotations = getSupportedEditorFieldAnnotationExecutors (annotation );
65+ Collection <EditorFieldAnnotationExecutor > supportedAnnotationExecutors = getSupportedEditorFieldAnnotationExecutors (annotation );
6566
66- for (EditorFieldAnnotationExecutor annotationExecutor : supportedAnnotations ) {
67- annotationExecutor .postInit (annotation , editor , fieldValue );
67+ if (supportedAnnotationExecutors != null && supportedAnnotationExecutors .size () > 0 ) {
68+ com .haulmont .cuba .gui .components .Component fieldValue = getFieldValue (editor , field );
69+ for (EditorFieldAnnotationExecutor annotationExecutor : supportedAnnotationExecutors ) {
70+ annotationExecutor .postInit (annotation , editor , fieldValue );
71+ }
6872 }
6973 }
7074 }
@@ -74,9 +78,9 @@ private void executePostInitForClassAnnotations(AnnotatableAbstractEditor editor
7478
7579 for (Annotation annotation : getClassAnnotations (editor )) {
7680
77- Collection <EditorAnnotationExecutor > supportedAnnotations = getSupportedEditorAnnotationExecutors (annotation );
81+ Collection <EditorAnnotationExecutor > supportedAnnotationExecutors = getSupportedEditorAnnotationExecutors (annotation );
7882
79- for (EditorAnnotationExecutor annotationExecutor : supportedAnnotations ) {
83+ for (EditorAnnotationExecutor annotationExecutor : supportedAnnotationExecutors ) {
8084 annotationExecutor .postInit (annotation , editor );
8185 }
8286 }
0 commit comments