Skip to content

Commit 3e376a9

Browse files
authored
Merge pull request #77 from jfisbein/feat/migrate_to_java_17
Feat/migrate to java 17
2 parents b192d6f + 8a31470 commit 3e376a9

File tree

7 files changed

+227
-20
lines changed

7 files changed

+227
-20
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2.4.0
1717

18-
- name: Set up JDK 11
18+
- name: Set up JDK 17
1919
uses: actions/setup-java@v2
2020
with:
21-
java-version: 11
22-
distribution: 'adopt'
21+
java-version: 17
22+
distribution: 'temurin'
2323

2424
- name: Cache Maven packages
2525
uses: actions/cache@v2.1.7
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM maven:3.6-jdk-11 as maven
1+
FROM maven:3.8-eclipse-temurin-17 as maven
22
COPY ./pom.xml ./pom.xml
33
COPY ./src ./src
44
RUN mvn package --batch-mode
55

6-
FROM openjdk:11-jre-slim
6+
FROM eclipse-temurin:17
77
COPY --from=maven target/imapcopy-*.jar /imapcopy.jar
88
ENTRYPOINT ["java", "-jar", "/imapcopy.jar"]

mvnw

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mvnw.cmd

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</scm>
1414

1515
<properties>
16-
<java.version>11</java.version>
16+
<java.version>17</java.version>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1919
<maven.compiler.source>${java.version}</maven.compiler.source>

src/main/java/com/fisbein/joan/model/ImapCopier.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fisbein.joan.model;
22

3+
import java.util.Objects;
34
import lombok.extern.slf4j.Slf4j;
45
import org.apache.commons.collections4.ListUtils;
56
import org.apache.commons.collections4.Predicate;
@@ -59,11 +60,7 @@ public static void main(String[] args) {
5960
private void init() throws MessagingException {
6061
openSourceConnection(imapSource);
6162
openTargetConnection(imapTarget);
62-
if (toDate != null) {
63-
toDate = toDate.plusDays(1);
64-
} else {
65-
toDate = LocalDate.now().plusDays(1);
66-
}
63+
toDate = Objects.requireNonNullElseGet(toDate, LocalDate::now).plusDays(1);
6764

6865
Set<String> aux = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
6966
aux.addAll(filteredFolders);
@@ -383,7 +380,7 @@ public void run() {
383380
}
384381
}
385382

386-
class MessageFilterPredicate implements Predicate<Message> {
383+
static class MessageFilterPredicate implements Predicate<Message> {
387384
Set<String> messagesId = new HashSet<>();
388385

389386
MessageFilterPredicate(Message[] filterMessages) {

0 commit comments

Comments
 (0)