Community
Participate
Working Groups
Throughout the RWT code base there are several places where objects are created reflectively. Partly from known classes and partly from strings that represent class names. Class#newInstance() throws several checked exceptions which makes the code bulky. The exception handling is mostly the same but implemented redundantly each time. A common utility class should provide methods to handle object instantiation and its exception handling.
Created attachment 191077 [details] ClassUtil
Committed patch to CVS HEAD. It introduces a ClassUtil class with overloaded newInstance() methods to create an instance from * a given class * a given class name and class loader * a given class and using the constructor derived from the given argument types An unchecked ClassInstantiationException is thrown in case of any error during instantiation. All places where instances where created _manually_ were replaced by calls to ClassUtil#newInstance().