Skip to content

Commit 0bd2f55

Browse files
ConvoluteHumanBotasturio
authored andcommitted
Changed return type to generic List
1 parent bd93b77 commit 0bd2f55

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

openpdf-core/src/main/java/org/openpdf/text/pdf/parser/PdfContentTextLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
4343

4444
import java.nio.charset.StandardCharsets;
4545
import java.util.ArrayList;
46+
import java.util.List;
4647
import java.util.Stack;
4748
import java.util.regex.Matcher;
4849
import java.util.regex.Pattern;
@@ -256,7 +257,7 @@ public String getResultantText() {
256257
/**
257258
* @return list of text strips that matches
258259
*/
259-
public ArrayList<MatchedPattern> getMatchedPatterns() {
260+
public List<MatchedPattern> getMatchedPatterns() {
260261
return this.accumulator;
261262
}
262263
}

openpdf-core/src/main/java/org/openpdf/text/pdf/parser/PdfTextLocator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private byte[] getContentBytesFromContentObject(PdfObject contentObject) throws
145145
* @return <CODE>ArrayList<MatchedPattern></CODE> List of matched text patterns with coordinates.
146146
* @throws IOException on error
147147
*/
148-
public ArrayList<MatchedPattern> searchPage(int page, String pattern) throws IOException {
148+
public List<MatchedPattern> searchPage(int page, String pattern) throws IOException {
149149
PdfDictionary pageDict = reader.getPageN(page);
150150
if (pageDict == null) {
151151
return new ArrayList<>();
@@ -165,8 +165,8 @@ public ArrayList<MatchedPattern> searchPage(int page, String pattern) throws IOE
165165
* @return <CODE>ArrayList<MatchedPattern></CODE> List of matched text patterns with coordinates.
166166
* @throws IOException on error
167167
*/
168-
public ArrayList<MatchedPattern> searchFile(String pattern) throws IOException {
169-
ArrayList<MatchedPattern> res = new ArrayList<>();
168+
public List<MatchedPattern> searchFile(String pattern) throws IOException {
169+
List<MatchedPattern> res = new ArrayList<>();
170170
for (int page = 1; page <= reader.getNumberOfPages(); page++) {
171171
res.addAll(searchPage(page, pattern));
172172
}
@@ -181,7 +181,7 @@ public ArrayList<MatchedPattern> searchFile(String pattern) throws IOException {
181181
* @return <CODE>ArrayList<MatchedPattern></CODE> List of matched text patterns with coordinates.
182182
* @throws IOException on error
183183
*/
184-
public ArrayList<MatchedPattern> searchPage(int page, float[] coordinates) throws IOException {
184+
public List<MatchedPattern> searchPage(int page, float[] coordinates) throws IOException {
185185
PdfDictionary pageDict = reader.getPageN(page);
186186
if (pageDict == null) {
187187
return new ArrayList<>();
@@ -201,8 +201,8 @@ public ArrayList<MatchedPattern> searchPage(int page, float[] coordinates) throw
201201
* @return <CODE>ArrayList<MatchedPattern></CODE> List of matched text patterns with coordinates.
202202
* @throws IOException on error
203203
*/
204-
public ArrayList<MatchedPattern> searchFile(float[] coordinates) throws IOException {
205-
ArrayList<MatchedPattern> res = new ArrayList<>();
204+
public List<MatchedPattern> searchFile(float[] coordinates) throws IOException {
205+
List<MatchedPattern> res = new ArrayList<>();
206206
for (int page = 1; page <= reader.getNumberOfPages(); page++) {
207207
res.addAll(searchPage(page, coordinates));
208208
}

0 commit comments

Comments
 (0)