From: Tim P <ti...@us...> - 2008-03-25 23:13:28
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23231/src/org/webmacro/directive Modified Files: AttributeDirective.java Log Message: Eclipse: target may be null: separate try blocks for each Exception Index: AttributeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/AttributeDirective.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AttributeDirective.java 12 Jun 2003 00:47:44 -0000 1.8 --- AttributeDirective.java 25 Mar 2008 23:13:25 -0000 1.9 *************** *** 63,74 **** { Variable target = null; ! try ! { target = (Variable) builder.getArg(ATTRIBUTE_TARGET, bc); ! Object result = builder.getArg(ATTRIBUTE_RESULT, bc); ! if (!target.isSimpleName()) ! throw new NotSimpleVariableBuildException(myDescr.name); ! ! target.setValue(bc, result); } catch (ClassCastException e) --- 63,70 ---- { Variable target = null; ! Object result = null; ! try { target = (Variable) builder.getArg(ATTRIBUTE_TARGET, bc); ! result = builder.getArg(ATTRIBUTE_RESULT, bc); } catch (ClassCastException e) *************** *** 76,79 **** --- 72,82 ---- throw new NotVariableBuildException(myDescr.name, e); } + if (!target.isSimpleName()) + throw new NotSimpleVariableBuildException(myDescr.name); + + try + { + target.setValue(bc, result); + } catch (PropertyException e) { |