[ 
https://issues.apache.org/jira/browse/PDFBOX-5673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17765959#comment-17765959
 ] 

ASF subversion and git services commented on PDFBOX-5673:
---------------------------------------------------------

Commit 1912347 from Tilman Hausherr in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1912347 ]

PDFBOX-5673: refactor stream operations, as suggested by Axel Howind

> Refactor Stream operations and operations on collections
> --------------------------------------------------------
>
>                 Key: PDFBOX-5673
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5673
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Axel Howind
>            Priority: Minor
>         Attachments: Refactor_operations_on_collections.patch, 
> Refactored_stream_operations.patch
>
>
> *Refactored Stream operations*
> In PageDrawer.java, the logic checking visibility conditions was simplified. 
> The .noneMatch() method was replaced with .allMatch() on the 'visibles' 
> stream. This altered phraseology from "no elements shouldn't match a 
> condition" to "all elements should match a condition", enhancing clarity.
> In COSArray.java, the use of StreamSupport.stream() to create streams from 
> the object collection 'objects' was replaced by direct .stream() calls on the 
> collection.
> *Refactored operations on Collections*
> Several changes have been made such as using the 'Arrays.fill()' method to 
> initialize arrays rather than looping through each element. 'List.of()' has 
> been used to create lists more succinctly and 'Collections.emptyList()' has 
> replaced 'Collections.<T>emptyList()' for brevity. Conditional removal from 
> collections has been simplified by directly calling 'collection.remove()' 
> instead of preceding it with an 'if' statement checking for the presence of 
> an element. The 'Comparator.comparingInt' lambda expression has been used to 
> simplify comparisons during sorting.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to