Mistři v programování na #hovnokod

Java #4665

Holy crap. Co takhle kolekce pouzit kdyz uz je pouzivas kamo?! Tohle je zahravani si s peklem...

		eb.setRecipients(StringUtils.join(recipients, "; "));
		eb.setRecipients2(StringUtils.join(recipients2, "; "));
		eb.setRecipients3(recipients3);
		eb.setSubject(subject);
		eb.setBody(body);
		eb.setType("Outage");
		eb.setSentBy(user.getUserName());
		eb.setSentDate(now);
		eb.setUpdatedBy(user.getUserName());
		eb.setUpdatedDate(now);

		emailsDao.save(eb);
		emailsCache.put(eb.getId(), eb);

		// send email(s)
		try {
			Email email = new Email(subject, body, "text/html");
			if (!recipients.isEmpty()) {
				for (String recipient : recipients) {
					email.addTo(recipient + "@ourdomain.com");
				}
			}
			if (!recipients2.isEmpty()) {
				for (String recipient : recipients2) {
					email.addTo(recipient + "@ourdomain.com");
				}
			}
			if (recipients3.length() != 0) {
				String[] recipients3AsArray = recipients3.split(";");
				for (String recipient : recipients3AsArray) {
					email.addTo(recipient.trim());
				}
			}
			email.send();
		}

Anonymous,