public boolean checkFalse(Boolean bool)
{
  if (bool.booleanValue() == Boolean.FALSE.booleanValue())
  {
    return Boolean.FALSE.booleanValue();
  }
  else
  {
    return Boolean.TRUE.booleanValue();
  }
}
By Anonymous, 2017-12-12 17:35:17
dotychczasowyPostep += predkosc * 1;
By tb, 2017-03-29 22:35:52
int phoneNumberFinder(int phoneNum){
int num = 0;
   while (true){
    if(phoneNum == num){
     return num;
    else{
      num++;
    }
  }
}
By Neeson, 2017-12-13 21:33:52
@RequestMapping(value = "user/getOnlineApplicationsList", produces = "XML/Text; charset=utf-8", method = RequestMethod.POST)
	public @ResponseBody String getOnlineApplicationsList(HttpSession session, HttpServletRequest request,
			@RequestParam("status") int status, @RequestParam("fullname") String fullname,
			@RequestParam("privateNumber") String privateNumber, @RequestParam("phoneNumber") String phoneNumber,
			@RequestParam("applicationIdFrom") String applicationIdFrom,
			@RequestParam("applicationIdTo") String applicationIdTo,
			// @RequestParam("dateFrom") String timeFrom,
			// @RequestParam("dateTo") String timeTo,
			@RequestParam("order") int order, @RequestParam("companyId") int companyId) {
		try {
			TimeFunctions tf = new TimeFunctions();
			StringBuilder ret = new StringBuilder();
			List<OnlineApplication> onlineAppList = new ArrayList<OnlineApplication>();
			List<OnlineApplicationForConsumerLoan> onlineAppListCL = new ArrayList<OnlineApplicationForConsumerLoan>();

			if (companyId == 3) {
				onlineAppList = onlineAppService.getOnlineApps(fullname, privateNumber,
						tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
						status, phoneNumber, applicationIdFrom, applicationIdTo);
			}
			else if (companyId == 2) {
				onlineAppListCL = onlineAppService.getConsumerOnlineApps(fullname, privateNumber,
						tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
						status, phoneNumber, applicationIdFrom, applicationIdTo);
			}
		
			else {
				onlineAppList = onlineAppService.getOnlineApps(fullname, privateNumber,
						tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
						status, phoneNumber, applicationIdFrom, applicationIdTo);
				onlineAppListCL = onlineAppService.getConsumerOnlineApps(fullname, privateNumber,
						tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
						status, phoneNumber, applicationIdFrom, applicationIdTo);
			}
			for (OnlineApplication onlineApp : onlineAppList) {
				if (onlineApp.getStatus() == 0) {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
							+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
							+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
							+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
							+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
							+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
							+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
							+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
							+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
							+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
							+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" +  "<td>ინკასო</td>" +
							"<td>დადასტურება</td>"+ "<td>უარყოფა</td>" + "<td>წაშლა</td>" + "</tr>" + "<tr>" + "<td>"
							+ onlineApp.getWorkTime() + "</td>" + "<td>" + onlineApp.getAdditionalIncome() + "</td>"
							+ "<td>" + onlineApp.getLoanFreqAmount() + "</td>" + "<td>" + onlineApp.getMaritalStatus()
							+ "</td>" + "<td>" + onlineApp.getChildren() + "</td>" + "<td>"
							+ onlineApp.getWorkingRelatives() + "</td>" + "<td>" + onlineApp.getTotalIncome() + "</td>"
							+ "<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
							+ "<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>" + "<td bgcolor=\"lightgreen\" onclick=\"approveApplication(" + onlineApp.getOnlineAppId()
							+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/accept.png\"></td>"
							+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getOnlineAppId()
							+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/reject.png\"></td>"
							+ "<td bgcolor=\"silver\" onclick=\"deleteApplication(" + onlineApp.getOnlineAppId() + ","
							+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/delete.png\"></td>" + "</tr>" + ""
							+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>" + "<br>");
				} else if (onlineApp.getStatus() == 1) {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
							+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
							+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
							+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
							+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
							+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
							+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
							+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
							+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
							+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
							+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
							+ "<td align=\"center\">კომენტარები</td><td align=\"center\">აპლიკაციის დამატება</td><td align=\"center\">აპლიკაციის უარყოფა</td>"
							+ "</tr>" + "<tr>" + "<td>" + onlineApp.getWorkTime() + "</td>" + "<td>"
							+ onlineApp.getAdditionalIncome() + "</td>" + "<td>" + onlineApp.getLoanFreqAmount()
							+ "</td>" + "<td>" + onlineApp.getMaritalStatus() + "</td>" + "<td>"
							+ onlineApp.getChildren() + "</td>" + "<td>" + onlineApp.getWorkingRelatives() + "</td>"
							+ "<td>" + onlineApp.getTotalIncome() + "</td>" + "<td>"
							+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) +
							 "<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
							+ "</td><td onclick=\"triggerComments(" + onlineApp.getOnlineAppId() + ","
							+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/comment.png\"></td>"
							+ "<td bgcolor=\"lightgreen\" onclick=\"acceptApplication(" + onlineApp.getOnlineAppId()
							+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/accept.png\"></td>"
							+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getOnlineAppId()
							+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/reject.png\"></td>" + "</tr>"
							+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>" + "</table>"
							+ "<br>");
				} else {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
							+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
							+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
							+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
							+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
							+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
							+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
							+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
							+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
							+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
							+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
							+ "<td colspan=\"3\" align=\"center\">კომენტარები</td>" + "</tr>" + "<tr>" + "<td>"
							+ onlineApp.getWorkTime() + "</td>" + "<td>" + onlineApp.getAdditionalIncome() + "</td>"
							+ "<td>" + onlineApp.getLoanFreqAmount() + "</td>" + "<td>" + onlineApp.getMaritalStatus()
							+ "</td>" + "<td>" + onlineApp.getChildren() + "</td>" + "<td>"
							+ onlineApp.getWorkingRelatives() + "</td>" + "<td>" + onlineApp.getTotalIncome() + "</td>"
							+ "<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>" +
							"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
							+ "<td colspan=\"3\" onclick=\"triggerComments(" + onlineApp.getOnlineAppId() + ","
							+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
							+ request.getContextPath() + "/resources/images/comment.png\"></td>"
							+ ((onlineApp.getStatus() != 2) ? "<td colspan=\"3\" onclick=\"changeStatus("
									+ onlineApp.getOnlineAppId() + "," + onlineApp.getCompany() + "," + 0
									+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
									+ "/resources/images/resume.png\" title=\"აპლიკაციაში დაბრუნება\"></td>" : "")
							+ "</tr>" + "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>"
							+ "</table>" + "<br>");
				}
			}
			for (OnlineApplicationForConsumerLoan onlineApp : onlineAppListCL) {
				// TODO: change below
				int consCompId = 2;
				if (onlineApp.getStatus() == 0) {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
							+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
							+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
							+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
							+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
							+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
							+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
							+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
							+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
							+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
							+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
							+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>" + "<td>დადასტურება</td>"
							+ "<td>უარყოფა</td>" + "<td>წაშლა</td>" + "</tr>" + "<tr>" + "<td>"
							+ onlineApp.getWorkPeriod() + "</td>" + "<td>" + onlineApp.getOtherIncome() + "</td>"
							+ "<td>" + onlineApp.getAmountToPayOnOtherLoans() + "</td>" + "<td>"
							+ onlineApp.getMaritalStatus() + "</td>" + "<td>" + onlineApp.getNumberOfChildren()
							+ "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers() + "</td>" + "<td>"
							+ onlineApp.getTotalFamilyIncome() + "</td>" + "<td>"
							+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>" +
							"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
							+ "<td bgcolor=\"lightgreen\" onclick=\"approveApplication(" + onlineApp.getId() + ","
							+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/accept.png\"></td>"
							+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getId() + ","
							+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/reject.png\"></td>"
							+ "<td bgcolor=\"silver\" onclick=\"deleteApplication(" + onlineApp.getId() + ","
							+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/delete.png\"></td>" + "</tr>"
							+ "<tr><td colspan=\"3\">"+onlineApp.getLoanPurpose()+"</td><td colspan=\"5\" align=\"left\"> " + onlineApp.getBranchOfficeName() + "</td></tr>"
							+ "</table>" + "<br>");
				} else if (onlineApp.getStatus() == 1) {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
							+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
							+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
							+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
							+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
							+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
							+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
							+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
							+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
							+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
							+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
							+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
							+ "<td align=\"center\">კომენტარები</td><td align=\"center\">აპლიკაციის დამატება</td><td align=\"center\">აპლიკაციის უარყოფა</td>"
							+ "</tr>" + "<tr>" + "<td>" + onlineApp.getWorkPeriod() + "</td>" + "<td>"
							+ onlineApp.getOtherIncome() + "</td>" + "<td>" + onlineApp.getAmountToPayOnOtherLoans()
							+ "</td>" + "<td>" + onlineApp.getMaritalStatus() + "</td>" + "<td>"
							+ onlineApp.getNumberOfChildren() + "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers()
							+ "</td>" + "<td>" + onlineApp.getTotalFamilyIncome() + "</td>" +
							"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>" +
							"<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
							+ "<td onclick=\"triggerComments(" + onlineApp.getId() + "," + consCompId
							+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/comment.png\"></td>"
							+ "<td bgcolor=\"lightgreen\" onclick=\"acceptApplication(" + onlineApp.getId() + ","
							+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/accept.png\"></td>"
							+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getId() + ","
							+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/reject.png\"></td>" + "</tr>"
							+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\" align=\"left\"> " + onlineApp.getBranchOfficeName() + "</td></tr>"
							+ "</table>" + "<br>");
				} else {
					ret.append("<br>"
							+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
							+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
							+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
							+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
							+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
							+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
							+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
							+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
							+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
							+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
							+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
							+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
							+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
							+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
							+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
							+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
							+ "<td colspan=\"3\" align=\"center\">კომენტარები</td>" + "</tr>" + "<tr>" + "<td>"
							+ onlineApp.getWorkPeriod() + "</td>" + "<td>" + onlineApp.getOtherIncome() + "</td>"
							+ "<td>" + onlineApp.getAmountToPayOnOtherLoans() + "</td>" + "<td>"
							+ onlineApp.getMaritalStatus() + "</td>" + "<td>" + onlineApp.getNumberOfChildren()
							+ "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers() + "</td>" + "<td>"
							+ onlineApp.getTotalFamilyIncome() + "</td>" + "<td>"
							+ "<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
							+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
							+ "<td colspan=\"3\" onclick=\"triggerComments(" + onlineApp.getId() + "," + consCompId
							+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
							+ "/resources/images/comment.png\"></td>"
							+ ((onlineApp.getStatus() != 2)
									? "<td colspan=\"4\" onclick=\"changeStatus(" + onlineApp.getId() + "," + consCompId
											+ "," + 0 + ")\"><img height=\"20px\" width=\"20px\" src=\""
											+ request.getContextPath()
											+ "/resources/images/resume.png\"  title=\"აპლიკაციაში დაბრუნება\"></td>"
									: "")
							+ "</tr>" + "<tr><td colspan=\"3\" align=\"left\"> " + onlineApp.getBranchOfficeName()
							+ "</td></tr>" + "</table>" + "<br>");
				}
			}
			return ret.toString();
		} catch (Exception e) {
			e.printStackTrace();
			return "სესხის სტატუსის შეცვლისას დაფიქსირდა შეცდომა: " + e.toString();
		}
	}
By Anonymous, 2017-11-06 09:59:23
Long timestamp = Instant.now().toEpochMilli(); // fallback
if (oTimestamp instanceof Integer)
    timestamp = (Integer) oTimestamp *1L;
else
    if (oTimestamp instanceof Long)
        timestamp = (Long) oTimestamp * 1L;
By Anonymous, 2017-12-12 08:13:40
int length = 0;
for(int idx = 0; idx < a.length; i++) {
     length++;
}
System.out.println("length is : " + length);
By Slacki, 2015-07-22 14:25:02
switch (numberOfQuestionsToAnswer) {
        case 0:
            displayGrid1 = false;
            displayGrid2 = false;
            displayGrid3 = false;
            displayGrid4 = false;
            displayGrid5 = false;
            displayGrid6 = false;
            displayGrid7 = false;
            displayGrid8 = false;
            displayGrid9 = false;
            displayGrid10 = false;
            break;
        case 1:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayGrid1 = true;
            break;
        case 2:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            break;
        case 3:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            break;
        case 4:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            break;
        case 5:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            break;
        case 6:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayAnsInputTextBox6 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            displayGrid6 = true;
            break;
        case 7:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayAnsInputTextBox6 = displayPreselectedAnsBox();
            displayAnsInputTextBox7 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            displayGrid6 = true;
            displayGrid7 = true;
            break;
        case 8:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayAnsInputTextBox6 = displayPreselectedAnsBox();
            displayAnsInputTextBox7 = displayPreselectedAnsBox();
            displayAnsInputTextBox8 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            displayGrid6 = true;
            displayGrid7 = true;
            displayGrid8 = true;
            break;
        case 9:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayAnsInputTextBox6 = displayPreselectedAnsBox();
            displayAnsInputTextBox7 = displayPreselectedAnsBox();
            displayAnsInputTextBox8 = displayPreselectedAnsBox();
            displayAnsInputTextBox9 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            displayGrid6 = true;
            displayGrid7 = true;
            displayGrid8 = true;
            displayGrid9 = true;
            break;
        case 10:
            displayAnsInputTextBox1 = displayPreselectedAnsBox();
            displayAnsInputTextBox2 = displayPreselectedAnsBox();
            displayAnsInputTextBox3 = displayPreselectedAnsBox();
            displayAnsInputTextBox4 = displayPreselectedAnsBox();
            displayAnsInputTextBox5 = displayPreselectedAnsBox();
            displayAnsInputTextBox6 = displayPreselectedAnsBox();
            displayAnsInputTextBox7 = displayPreselectedAnsBox();
            displayAnsInputTextBox8 = displayPreselectedAnsBox();
            displayAnsInputTextBox9 = displayPreselectedAnsBox();
            displayAnsInputTextBox10 = displayPreselectedAnsBox();
            displayGrid1 = true;
            displayGrid2 = true;
            displayGrid3 = true;
            displayGrid4 = true;
            displayGrid5 = true;
            displayGrid6 = true;
            displayGrid7 = true;
            displayGrid8 = true;
            displayGrid9 = true;
            displayGrid10 = true;
            break;
}

This was for a wizard type questionnaire where there could be up to 10 questions.

By Anonymous, 2017-12-12 10:57:52
final boolean True = true;   
final boolean False = false;
//why

:v

By Memz, 2019-12-31 03:25:05
int i=0;

                        for (i=0; i<msg.length;i++){

                            switch (i){

                                  case 0:

                                  case 1:

                                  case 2:

                                  case 3:

                                  case 4:

                                  case 5:

                                  case 6:

                                  case 7:

                                  case 8:

                                  case 9:

                                  case 10:

                                  case 11:

                                  case 18:

                                  case 19:

                                  case 26:

                                  case 27:

                                  case 34:

                                  case 35:

                                  case 42:

                                  case 43:

                                  case 50:

                                  case 51:

                                  case 52:

                                  case 53:

                                  case 54:

                                  case 55:

                                  case 58:

                                  case 59:

                                  case 62:

                                  case 63: log.debug("******** TRAZA-BEA: autenticacion ntlm. mensaje[" + i + "]: " + msg[i] + " SINSIGNO: " + (int)(msg[i] & 0x00ff) + "   " + new String(msg,i,1, "UTF-16LE")); break;

                                  case 12:

                                  case 14:

                                  case 16:

                                  case 20:

                                  case 22:

                                  case 24:

                                  case 28:

                                  case 30:

                                  case 32:

                                  case 36:

                                  case 38:

                                  case 40:

                                  case 44:

                                  case 46:

                                  case 48:

                                  case 56:

                                  case 60:log.debug("******** TRAZA-BEA: autenticacion ntlm. mensaje[" + i + "]: " + msg[i] + " SINSIGNO: " + (int)(msg[i] & 0x00ff) + "   " + new String(msg,i,2, "UTF-16LE")); break;

                                  case 13:

                                  case 15:

                                  case 17:

                                  case 21:

                                  case 23:

                                  case 25:

                                  case 29:

                                  case 31:

                                  case 33:

                                  case 37:

                                  case 39:

                                  case 41:

                                  case 45:

                                  case 47:

                                  case 49:

                                  case 57:

Why not case 60? LOL

By Pabs, 2017-12-26 14:03:33
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.


   O | O | O 
  -----------
   O | O | O 
  -----------
   O | O | O 
     

 */
package tictactoe;

import java.util.Scanner;

public class TicTacToe {

    /**
     * @param args the command line arguments
     * @throws java.lang.InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        Scanner input = new Scanner(System.in);
        String a1 = "1";
        String a2 = "2";
        String a3 = "3";
        String a4 = "4";
        String a5 = "5";
        String a6 = "6";
        String a7 = "7";
        String a8 = "8";
        String a9 = "9";
        int inO;
        int inX = 0;
        boolean winner = false;
        PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
        System.out.printf("How to play - wait for your turn and when it comes write the number of the field that you want to draw in (from 1 to 9)\n");
        System.out.printf("Player O's turn: ");
        inO = input.nextInt();
        while (true) {
            switch (inO) {
                case 1:
                    if (a1 == "1") {
                        a1 = "O";
                    }
                    break;
                case 2:
                    if (a2 == "2") {
                    a2 = "O";
                    }
                    break;
                case 3:
                    if (a3 == "3") {
                    a3 = "O";
                    }
                    break;
                case 4:
                    if (a4 == "4") {
                    a4 = "O";
                    }
                    break;
                case 5:
                    if (a5 == "5") {
                    a5 = "O";
                    }
                    break;
                case 6:
                    if (a6 == "6") {
                    a6 = "O";
                    }
                    break;
                case 7:
                    if (a7 == "7") {
                    a7 = "O";
                    }
                    break;
                case 8:
                    if (a8 == "8") {
                    a8 = "O";                        
                    }
                    break;
                case 9:
                    if (a9 == "9") {
                    a9 = "O";
                    }
                    break;
                default:
                    System.out.printf("An error occured. Please accept it politely and restart the game.");
                    break;
            }
            System.out.printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
            if (null != Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9))switch (Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9)) {
                case "NONE":
                    if (a1 != "1" && a2 != "2" && a3 != "3" && a4 != "4" && a5 != "5" && a6 != "6" && a7 != "7" && a8 != "8" && a9 != "9") {
                        winner = true;
                        System.out.println("DRAW!");
                        Thread.sleep(3000);
                        break;
                    } else {
                    PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
                    System.out.printf("Player X's turn: ");
                    inX = input.nextInt();
                    break;
                    }
                case "X":
                    winner = true;
                    System.out.println("X HAS WON!!!");
                    Thread.sleep(3000);
                    break;
                case "O":
                    winner = true;
                    System.out.printf("O HAS WON!!!");
                    Thread.sleep(3000);
                    break;
                default:
                    break;
            }
            if (winner) {
                break;
            }
            switch (inX) {
                case 1:
                    if (a1 == "1") {
                    a1 = "X";
                    }
                    break;
                case 2:
                    if (a2 == "2") {
                    a2 = "X";
                    }
                    break;
                case 3:
                    if (a3 == "3") {
                    a3 = "X";
                    }
                    break;
                case 4:
                    if (a4 == "4") {
                    a4 = "X";
                    }
                    break;
                case 5:
                    if (a5 == "5") {
                    a5 = "X";
                    }
                    break;
                case 6:
                    if (a6 == "6") {
                    a6 = "X";
                    }
                    break;
                case 7:
                    if (a7 == "7") {
                    a7 = "X";
                    }
                    break;
                case 8:
                    if (a8 == "8") {
                    a8 = "X";
                    }
                    break;
                case 9:
                    if (a9 == "9") {
                    a9 = "X";
                    }
                    break;
                default:
                    System.out.printf("An error occured. Please accept it politely and restart the game.");
                    break;
            }
            System.out.printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
            if (null != Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9))switch (Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9)) {
                case "NONE":
                    if (a1 != "1" && a2 != "2" && a3 != "3" && a4 != "4" && a5 != "5" && a6 != "6" && a7 != "7" && a8 != "8" && a9 != "9") {
                        winner = true;
                        System.out.println("DRAW!");
                        Thread.sleep(3000);
                        break;
                    } else {
                    PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
                    System.out.printf("Player O's turn: ");
                    inO = input.nextInt();
                    break;
                    }
                case "X":
                    winner = true;
                    System.out.println("X HAS WON!!!");
                    Thread.sleep(3000);
                    break;
                case "O":
                    winner = true;
                    System.out.println("O HAS WON!!!");
                    Thread.sleep(3000);
                    break;
                default:
                    break;
            }
            if (winner) {
                break;
            }
        }    
    }
    
    public static void PrintBoard(String f1, String f2, String f3, String f4, String f5, String f6, String f7, String f8, String f9) {  
        System.out.printf("   %s | %s | %s \n",f1,f2,f3);
        System.out.printf("  ----------- \n");
        System.out.printf("   %s | %s | %s \n",f4,f5,f6);
        System.out.printf("  ----------- \n");
        System.out.printf("   %s | %s | %s \n",f7,f8,f9);
        System.out.printf(" \n");
    }
    
    public static String Winners(String f1, String f2, String f3, String f4, String f5, String f6, String f7, String f8, String f9) {
        if (f1 == f2 && f2 == f3 && f3 == "O") {
            return "O";
        } else if (f4 == f5 && f5 == f6 && f6 == "O") {
            return "O";
        } else if (f7 == f8 && f8 == f9 && f9 == "O") {
            return "O";
        } else if (f1 == f4 && f4 == f7 && f7 == "O") {
            return "O";
        } else if (f2 == f5 && f5 == f8 && f8 == "O") {
            return "O";
        } else if (f3 == f6 && f6 == f9 && f9 == "O") {
            return "O";
        } else if (f1 == f5 && f5 == f9 && f9 == "O") {
            return "O";
        } else if (f3 == f5 && f5 == f7 && f7 == "O") {
            return "O";
        } else if (f1 == f2 && f2 == f3 && f3 == "X") {
            return "X";
        } else if (f4 == f5 && f5 == f6 && f6 == "X") {
            return "X";
        } else if (f7 == f8 && f8 == f9 && f9 == "X") {
            return "X";
        } else if (f1 == f4 && f4 == f7 && f7 == "X") {
            return "X";
        } else if (f2 == f5 && f5 == f8 && f8 == "X") {
            return "X";
        } else if (f3 == f6 && f6 == f9 && f9 == "X") {
            return "X";
        } else if (f1 == f5 && f5 == f9 && f9 == "X") {
            return "X";
        } else if (f3 == f5 && f5 == f7 && f7 == "X") {
            return "X";
        } else {
            return "NONE";
        }
    }
}

There are so many problems with this...

By umnikos, 2017-12-12 17:38:50
private boolean check_if_valid_login(Login login) {
    boolean validLogin = false;
    if (login.isValid(login)) {
        validLogin = true;
    }
    
    if (!(login.isValid(login) == true)) {
        validLogin = false;
    }
    
    return validLogin ? true : false;
}
By Anonymous, 2021-07-06 20:22:47
if (logger.isDebugEnabled()) {
			logger.debug("process (FollettPojo) - start");	
		}
String dnum = StringUtil.toCapitalizedString(pojo.getDnum().toString()); 
pojo.setDnum(new String(dnum));
	    
if (logger.isDebugEnabled()) {
    logger.debug("process (FollettPojo) - middle ");
}

String rawI = StringUtil.toCapitalizedString(pojo.getRawInput().trim().toString()); 
pojo.setRawInput(new String(rawI));

if (logger.isDebugEnabled()) {
	logger.debug("process (FollettPojo) - end ");
}
		
		
/* And you may ask what is this toCapitalizedString? Well here you go a separate class to boot */
	public static String toCapitalizedString(String string){
		StringBuilder strb = new StringBuilder();
		if(string != null && string.trim().length() > 0
				&& Character.isLetter(string.charAt(0))
				&& Character.isLowerCase(string.charAt(0))){

			strb.append(string.substring(0,1).toUpperCase()).append(string.substring(1));
			return strb.toString();
		}
		return string;

	}

SpringBatch this is the processor for each record...dnum example D00000000

By Albert, 2017-12-15 23:53:41
Double value = item.getPrice() * loyaltyPointMultiplier;
String[] s = String.split(value.toString(), "\\.");
points = Integer.parseInt(s[0]);
if(Integer.parseInt(s[1]) > 0) {
    points++;
}
    
return points;

Want to round up? Math.ceil() uses too little memory! Use this instead!

By phytyca, 2017-12-12 05:02:48
@Override
public void afterTextChanged(Editable s) {
    switch (paymentType) {
        case 0:
            if (s.length() == 9) etPaymentAmount.requestFocus();
            break;
        case 1:
            if (s.length() == 9) etPaymentAmount.requestFocus();
            break;
    }
}
By Anonymous, 2017-12-22 12:41:02
public boolean logout(String token)
{
    LogedUser user = logedUsers.remove(token);
    return (user != null) ? true : false;
}
By Slacki, 2015-11-17 17:58:53