You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2021/04/25 21:50:46 UTC

[commons-imaging] branch master updated (d1d8d1f -> 79ec5d8)

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git.


    from d1d8d1f  Merge branch 'pr-131'
     new 5fce159  [IMAGING-295] Use 'compare()' method to compare numbers
     new 3453a8f  [IMAGING-295] Changelog
     new 79ec5d8  Merge branch 'pr-140'

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                                        |  3 +++
 .../org/apache/commons/imaging/formats/tiff/TiffElement.java   | 10 +---------
 .../imaging/formats/tiff/write/TiffOutputDirectory.java        | 10 +---------
 3 files changed, 5 insertions(+), 18 deletions(-)

[commons-imaging] 01/03: [IMAGING-295] Use 'compare()' method to compare numbers

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 5fce159e9017c5f13f77bf14cc2ec43ae764962f
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Sun Apr 25 15:51:44 2021 +0200

    [IMAGING-295] Use 'compare()' method to compare numbers
---
 .../org/apache/commons/imaging/formats/tiff/TiffElement.java   | 10 +---------
 .../imaging/formats/tiff/write/TiffOutputDirectory.java        | 10 +---------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffElement.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffElement.java
index 4439173..35b5118 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffElement.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffElement.java
@@ -21,15 +21,7 @@ import java.util.Comparator;
 public abstract class TiffElement {
     public final long offset;
     public final int length;
-    public static final Comparator<TiffElement> COMPARATOR = (e1, e2) -> {
-        if (e1.offset < e2.offset) {
-            return -1;
-        }
-        if (e1.offset > e2.offset) {
-            return 1;
-        }
-        return 0;
-    };
+    public static final Comparator<TiffElement> COMPARATOR = Comparator.comparingLong(e -> e.offset);
 
     public TiffElement(final long offset, final int length) {
         this.offset = offset;
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java
index a9a1515..4913878 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java
@@ -74,15 +74,7 @@ public final class TiffOutputDirectory extends TiffOutputItem {
     private final List<TiffOutputField> fields = new ArrayList<>();
     private final ByteOrder byteOrder;
     private TiffOutputDirectory nextDirectory;
-    public static final Comparator<TiffOutputDirectory> COMPARATOR = (o1, o2) -> {
-        if (o1.type < o2.type) {
-            return -1;
-        }
-        if (o1.type > o2.type) {
-            return 1;
-        }
-        return 0;
-    };
+    public static final Comparator<TiffOutputDirectory> COMPARATOR = Comparator.comparingInt(o -> o.type);
     private JpegImageData jpegImageData;
     private TiffImageData tiffImageData;
 

[commons-imaging] 03/03: Merge branch 'pr-140'

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 79ec5d8bf6fe2a993ef7a757fb9698d86fca8b52
Merge: d1d8d1f 3453a8f
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Mon Apr 26 09:50:20 2021 +1200

    Merge branch 'pr-140'
    
    This closes #140

 src/changes/changes.xml                                        |  3 +++
 .../org/apache/commons/imaging/formats/tiff/TiffElement.java   | 10 +---------
 .../imaging/formats/tiff/write/TiffOutputDirectory.java        | 10 +---------
 3 files changed, 5 insertions(+), 18 deletions(-)

[commons-imaging] 02/03: [IMAGING-295] Changelog

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 3453a8fc21291222714a8de8266d676f0a2d50b2
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Mon Apr 26 09:50:04 2021 +1200

    [IMAGING-295] Changelog
---
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 69c0aab..40f1796 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -114,6 +114,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="IMAGING-287" dev="kinow" type="update" due-to="Arturo Bernal">
         Simplify assertions in tests
       </action>
+      <action issue="IMAGING-295" dev="kinow" type="update" due-to="Arturo Bernal">
+        Use 'compare()' method to compare numbers
+      </action>
     </release>
     <release version="1.0-alpha2" date="2020-08-01" description="Second 1.0 alpha release">
       <action issue="IMAGING-258" dev="kinow" type="update" due-to="Gary Lucas">