pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1874395 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
Date Sat, 22 Feb 2020 17:58:48 GMT
Author: tilman
Date: Sat Feb 22 17:58:48 2020
New Revision: 1874395

URL: http://svn.apache.org/viewvc?rev=1874395&view=rev
Log:
PDFBOX-4071: use jdk8 method

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java?rev=1874395&r1=1874394&r2=1874395&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFMarkedContentExtractor.java
Sat Feb 22 17:58:48 2020
@@ -133,12 +133,8 @@ public class PDFMarkedContentExtractor e
             String textCharacter = text.getUnicode();
             float textX = text.getX();
             float textY = text.getY();
-            List<TextPosition> sameTextCharacters = this.characterListMapping.get(
textCharacter );
-            if( sameTextCharacters == null )
-            {
-                sameTextCharacters = new ArrayList<>();
-                this.characterListMapping.put( textCharacter, sameTextCharacters );
-            }
+            List<TextPosition> sameTextCharacters =
+                    this.characterListMapping.computeIfAbsent(textCharacter, k -> new
ArrayList<>());
 
             // RDD - Here we compute the value that represents the end of the rendered
             // text.  This value is used to determine whether subsequent text rendered



Mime
View raw message