Optimized array allocation
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -74,8 +74,13 @@ public class ActionUpdateStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean addMessage(final Collection<String> messages) {
|
public boolean addMessage(final Collection<String> messages) {
|
||||||
|
if (messages == null || messages.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.message == null) {
|
if (this.message == null) {
|
||||||
this.message = new ArrayList<>();
|
this.message = new ArrayList<>(messages);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.message.addAll(messages);
|
return this.message.addAll(messages);
|
||||||
|
|||||||
Reference in New Issue
Block a user