Community
Participate
Working Groups
Currently when using the sdk to automatically create the form data for a form it creates inner member classes (public class ...). I request to change this to create inner static classes for fields, properties, etc. (public static class ...). This change would make the form data a 100% pure java bean composite with - empty constructors of all - also inner - types - inner classes can be used isolated of outer (not member any more) - form data composite can be used in jax-ws as complex types. The change would not affect scout rt concepts and handling in any way. From the rt point of view it is a null change.
In the constructor of AbstractFormData a new instance is created for each nested class (property data). This is done using ConfigurationUtility.newInnerInstance() which uses getDeclaringClass() as indicator whether to use the default constructor (of the nested class) or the constructor with the surrounding (declaring) class as parameter. If we change the FormData nested classes to static inner classes, the constructor has no parameter anymore. But getDeclaringClass() still returns the class of the parent of the static inner class. This leads to the problem that the ConfigurationUtility.newInnerInstance() tries to create the inner instance with parameter while this constructor does not exist (only the default constructor exists) -> NoSuchMethodException. Maybe the ConfigurationUtility.newInnerInstance() should be adapted so that this case can be handled correctly. Keep in mind that this utility method is also used in e.g. AbstractForm where we would like to keep non-static member classes. When changing ConfigurationUtility.newInnerInstance() please consider all of the following cases (analysis from Ivan Motsch) and create tests accordingly: There are five kinds of classes (or interfaces): a) Top level classes -> (declaredClass=null, enclosingClass=null) b) Nested classes (static member classes) -> (declaredClass=parent, enclosingClass=null) c) Inner classes (non-static member classes) -> (declaredClass=parent, enclosingClass=null) d) Local classes (named classes declared within a method) -> (declaredClass=null, enclosingClass=class of method) e) Anonymous classes
Created attachment 205030 [details] Patch Proposal for FormData generation in Scout SDK The attached patch proposal changes the FormData Generation to create static member classes for fields (instead of non-static). This can only be applied after the Scout Runtime can handle static member classes in form datas.
runtime has been adapted. patch applied.
ticket closed. deliverd as part of eclipse scout 3.8.0 (juno release train)