When using the "surround with" function on a method call to wrap it with a
try/catch block, Idea is putting the highest level exception first, and is not
catching all the execptions thrown by the method.

Below is the example of code that demonstrates what the bug produced.




public void init() throws ServletException {
        super.init();
        try {
            initActions();
        } catch (Exception e) {
        } catch (InstantiationError error) {
        }
    }

private void initActions()throws ClassNotFoundException,
InstantiationError,Exception{
       actions  =   new HashMap();
       HashMap actionConfig = getActionConfiguration();
       Set keys = actionConfig.keySet();
       Iterator it  =   keys.iterator();

        while(it.hasNext()){
            String keyName = (String) it.next();

actions.put(keyName,Class.forName((String)actionConfig.get(keyName)).newInstance());
        }
 }




_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to