@Test public void testAddParameterInvalid () { try { mProcedure.addParameter ("a a", false); fail ("no exception"); } catch (ParameterNameException pne) { } }
public void addParameter (String name, boolean isOutput) throws ParameterNameException { if (!PARAMETER_NAME_PATTERN.matcher (name).matches ()) { throw new ParameterNameException ("invalid parameter name '%s'", name); } for (ProcedureParameter parameter : mParameters) { if (parameter.getName ().equalsIgnoreCase (name)) { throw new ParameterNameException ("duplicate parameter name '%s'", name); } } mParameters.add (new ProcedureParameter (name, isOutput)); }
Procedure { public void addParameter (String name, boolean isOutput) throws ParameterNameException { if (!PARAMETER_NAME_PATTERN.matcher (name).matches ()) { throw new ParameterNameException ("invalid parameter name '%s'", name); } for (ProcedureParameter parameter : mParameters) { if (parameter.getName ().equalsIgnoreCase (name)) { throw new ParameterNameException ("duplicate parameter name '%s'", name); } } mParameters.add (new ProcedureParameter (name, isOutput)); } }
Procedure { public void addParameter (String name, boolean isOutput) throws ParameterNameException { if (!PARAMETER_NAME_PATTERN.matcher (name).matches ()) { throw new ParameterNameException ("invalid parameter name '%s'", name); } for (ProcedureParameter parameter : mParameters) { if (parameter.getName ().equalsIgnoreCase (name)) { throw new ParameterNameException ("duplicate parameter name '%s'", name); } } mParameters.add (new ProcedureParameter (name, isOutput)); } Procedure(String name); }
Procedure { public void addParameter (String name, boolean isOutput) throws ParameterNameException { if (!PARAMETER_NAME_PATTERN.matcher (name).matches ()) { throw new ParameterNameException ("invalid parameter name '%s'", name); } for (ProcedureParameter parameter : mParameters) { if (parameter.getName ().equalsIgnoreCase (name)) { throw new ParameterNameException ("duplicate parameter name '%s'", name); } } mParameters.add (new ProcedureParameter (name, isOutput)); } Procedure(String name); String getName(); void addParameter(String name, boolean isOutput); void addTable(List<List<String>> table); }
Procedure { public void addParameter (String name, boolean isOutput) throws ParameterNameException { if (!PARAMETER_NAME_PATTERN.matcher (name).matches ()) { throw new ParameterNameException ("invalid parameter name '%s'", name); } for (ProcedureParameter parameter : mParameters) { if (parameter.getName ().equalsIgnoreCase (name)) { throw new ParameterNameException ("duplicate parameter name '%s'", name); } } mParameters.add (new ProcedureParameter (name, isOutput)); } Procedure(String name); String getName(); void addParameter(String name, boolean isOutput); void addTable(List<List<String>> table);  }