You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2023/09/16 13:22:00 UTC
[jira] [Updated] (PDFBOX-5673) Refactor Stream operations and operations on collections
[ https://issues.apache.org/jira/browse/PDFBOX-5673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr updated PDFBOX-5673:
------------------------------------
Affects Version/s: 3.0.0 PDFBox
4.0.0
> Refactor Stream operations and operations on collections
> --------------------------------------------------------
>
> Key: PDFBOX-5673
> URL: https://issues.apache.org/jira/browse/PDFBOX-5673
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 3.0.0 PDFBox, 4.0.0
> Reporter: Axel Howind
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 3.0.1 PDFBox, 4.0.0
>
> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org