This example combines both of them.
public void setPhones(List<PhoneNumber> phones) throws Exception
{
this.phones = phones;
this.phones.clear();
this.phones.addAll(phones);
}
Those funny java snippets from real code
public void setPhones(List<PhoneNumber> phones) throws Exception
{
this.phones = phones;
this.phones.clear();
this.phones.addAll(phones);
}
if (!Float.valueOf("0.0").equals(price.getActualPrice()))
{
return true;
}
protected void parseSummaryLines()
{
...
// NOTE: First letters are ommited in order to
// support capitalized words as well
String RESULT_GOOD_TEXT_1 = "othing"; // Nothing
String RESULT_GOOD_TEXT_2 = "uccessful"; // Successful
String RESULT_BAD_TEXT_1 = "assword"; // Password
String RESULT_BAD_TEXT_2 = "failed"; // Failed
...
}
public static void main(String args[]) {
try{
FileInputStream fstream = ...
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
}
public void setStatementFromAddress(CCallableStatement ccstmt,
CAddressStruct address, int nStartFrom) throws SQLException
{
nStartFrom = nStartFrom - 12;
ccstmt.setString(nStartFrom + 0, address.getStreet());
ccstmt.setLong(nStartFrom + 1, address.getCityID());
ccstmt.setString(nStartFrom + 2, address.getCity());
ccstmt.setLong(nStartFrom + 3, address.getCountyID());
ccstmt.setString(nStartFrom + 4, address.getCounty());
ccstmt.setString(nStartFrom + 5, address.getRegionID());
ccstmt.setString(nStartFrom + 6, address.getRegion());
ccstmt.setLong(nStartFrom + 7, address.getCountryID());
ccstmt.setString(nStartFrom + 8, address.getCountry());
ccstmt.setString(nStartFrom + 9, address.getZIP());
ccstmt.setString(nStartFrom + 10, address.getPhone());
ccstmt.setString(nStartFrom + 11, address.getFax());
ccstmt.setString(nStartFrom + 12, address.getEMail());
}
// check that it is valid format
// d,m,y
// m,y
// y
if ((nYearFrom != null && nMonthFrom != null && nDayFrom != null ||
nYearFrom != null && nMonthFrom != null ||
nYearFrom != null) &&
(nYearTo != null && nMonthTo != null && nDayTo != null ||
nYearTo != null && nMonthTo != null ||
nYearTo != null))
if (nYearFrom != null && nYearTo != null)