diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-13 16:05:18 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-13 15:18:56 +0000 |
commit | d0be30e8eec9d982501e8727df05962572c7acc6 (patch) | |
tree | b906024d4c2da051f2d0712f7347c5dde4eb51c0 /qadevOOo | |
parent | f6388e15bf95326d2a712453dc2c17b010801533 (diff) |
java: Collections.addAll for adding an array of elements to a Collection
Change-Id: I4689aa73e1e261c6461e04b9e814ffefa5817c09
Reviewed-on: https://gerrit.libreoffice.org/11953
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/graphical/IniFile.java | 7 | ||||
-rw-r--r-- | qadevOOo/runner/share/DescGetter.java | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java index f6b371f342e2..fe2df6e62878 100644 --- a/qadevOOo/runner/graphical/IniFile.java +++ b/qadevOOo/runner/graphical/IniFile.java @@ -19,7 +19,9 @@ package graphical; import java.io.File; import java.io.RandomAccessFile; + import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; /** @@ -55,10 +57,7 @@ public class IniFile implements Enumeration<String> if (m_aList.isEmpty()) { // can only insert if there is nothing else already in the ini file - for (int i = 0; i < _aList.length; i++) - { - m_aList.add(_aList[i]); - } + m_aList.addAll(Arrays.asList(_aList)); } } diff --git a/qadevOOo/runner/share/DescGetter.java b/qadevOOo/runner/share/DescGetter.java index 53e0f93c0e28..892a33dc50e0 100644 --- a/qadevOOo/runner/share/DescGetter.java +++ b/qadevOOo/runner/share/DescGetter.java @@ -19,7 +19,9 @@ package share; import java.io.BufferedReader; import java.io.FileReader; + import java.util.ArrayList; +import java.util.Arrays; import java.util.StringTokenizer; /** @@ -108,10 +110,7 @@ public abstract class DescGetter line.length()).trim(), descPath, debug); - for (int i = 0; i < subs.length; i++) - { - entryList.add(subs[i]); - } + entryList.addAll(Arrays.asList(subs)); } else if (line.startsWith("-p")) { |