I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 0325f6c4 authored by zzz's avatar zzz
Browse files

more isEmpty and a static

parent 8225ce06
No related branches found
No related tags found
No related merge requests found
...@@ -85,16 +85,16 @@ public class FormHandler { ...@@ -85,16 +85,16 @@ public class FormHandler {
public String getAllMessages() { public String getAllMessages() {
validate(); validate();
process(); process();
if (_errors.size() <= 0 && _notices.size() <= 0) if (_errors.isEmpty() && _notices.isEmpty())
return ""; return "";
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
buf.append("<div class=\"messages\" id=\"messages\"><p>"); buf.append("<div class=\"messages\" id=\"messages\"><p>");
if (_errors.size() > 0) { if (!_errors.isEmpty()) {
buf.append("<span class=\"error\">"); buf.append("<span class=\"error\">");
buf.append(render(_errors)); buf.append(render(_errors));
buf.append("</span>"); buf.append("</span>");
} }
if (_notices.size() > 0) { if (!_notices.isEmpty()) {
buf.append("<span class=\"notice\">"); buf.append("<span class=\"notice\">");
buf.append(render(_notices)); buf.append(render(_notices));
buf.append("</span>"); buf.append("</span>");
...@@ -174,8 +174,8 @@ public class FormHandler { ...@@ -174,8 +174,8 @@ public class FormHandler {
} }
} }
private String render(List<String> source) { private static String render(List<String> source) {
if (source.size() <= 0) { if (source.isEmpty()) {
return ""; return "";
} else { } else {
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment