From: <mwl...@us...> - 2008-01-10 20:59:49
|
Revision: 595 http://cishell.svn.sourceforge.net/cishell/?rev=595&view=rev Author: mwlinnem Date: 2008-01-10 12:59:40 -0800 (Thu, 10 Jan 2008) Log Message: ----------- Now throws exception if, in a chain of conversion, a non-terminal converter returns a null result. This is so that the error is pre-emptively caught, as oppose to feeding that null value to the next converter while will inevitably choke on it. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java 2008-01-09 22:33:54 UTC (rev 594) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/AlgorithmWrapper.java 2008-01-10 20:59:40 UTC (rev 595) @@ -78,6 +78,14 @@ for (int i=0; i < data.length; i++) { if (converters[i] != null) { data[i] = converters[i][0].convert(data[i]); + + if (data[i] == null && i < (data.length - 1)) { + Exception e = + new Exception("The converter " + + converters[i].getClass().getName() + + " returned a null result where data was expected."); + throw e; + } converters[i] = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |