diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-08-06 21:12:49 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-08-06 21:12:49 +0000 |
commit | bbfd7b9ec86e1912d2adf61fc77c800e6a8a074e (patch) | |
tree | 6b1f1367951d35f50b393e6dfa4006cbcd9b429e /poi-ooxml | |
parent | eaa27548fa4f1d374cfb68c9a3f51b6d0e6b8d3d (diff) | |
download | poi-bbfd7b9ec86e1912d2adf61fc77c800e6a8a074e.tar.gz poi-bbfd7b9ec86e1912d2adf61fc77c800e6a8a074e.zip |
[github-365] use lambdas. Thanks to Arturo Bernal. This closes #365
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903258 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java | 7 | ||||
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/util/CTColComparator.java | 22 |
2 files changed, 9 insertions, 20 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java index 2e4d89647d..158927e7ef 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java @@ -43,12 +43,7 @@ public abstract class ShapeVisitor { * mixing visitors and acceptors */ protected ShapeVisitorAcceptor getAcceptor() { - return new ShapeVisitorAcceptor() { - @Override - public boolean accept(XDGFShape shape) { - return !shape.isDeleted(); - } - }; + return shape -> !shape.isDeleted(); } public void setAcceptor(ShapeVisitorAcceptor acceptor) { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/util/CTColComparator.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/util/CTColComparator.java index ef8e526a43..bc6d7dde97 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/util/CTColComparator.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/util/CTColComparator.java @@ -25,22 +25,16 @@ public class CTColComparator { private CTColComparator() {} - public static final Comparator<CTCol> BY_MAX = new Comparator<CTCol>() { - @Override - public int compare(CTCol col1, CTCol col2) { - long col1max = col1.getMax(); - long col2max = col2.getMax(); - return Long.compare(col1max, col2max); - } + public static final Comparator<CTCol> BY_MAX = (col1, col2) -> { + long col1max = col1.getMax(); + long col2max = col2.getMax(); + return Long.compare(col1max, col2max); }; - public static final Comparator<CTCol> BY_MIN_MAX = new Comparator<CTCol>() { - @Override - public int compare(CTCol col1, CTCol col2) { - long col11min = col1.getMin(); - long col2min = col2.getMin(); - return col11min < col2min ? -1 : col11min > col2min ? 1 : BY_MAX.compare(col1, col2); - } + public static final Comparator<CTCol> BY_MIN_MAX = (col1, col2) -> { + long col11min = col1.getMin(); + long col2min = col2.getMin(); + return col11min < col2min ? -1 : col11min > col2min ? 1 : BY_MAX.compare(col1, col2); }; } |