Skip to content

Commit 48afe5f

Browse files
committed
PDFBOX-5660: replace lambda with method reference
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1923548 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7af7c20 commit 48afe5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ private List<String> getStringsFromStream(PDField field) throws IOException
141141
// trimming as Acrobat adds spaces to strings
142142
// where we don't
143143
return tokens.stream() //
144-
.filter(t -> t instanceof COSString) //
145-
.map(t -> ((COSString) t).getString().trim()) //
144+
.filter(COSString.class::isInstance) //
145+
.map(COSString.class::cast) //
146+
.map(COSString::getString) //
147+
.map(String::trim) //
146148
.collect(Collectors.toList());
147149
}
148150
}

0 commit comments

Comments
 (0)