From 5ef31765a1ceda75f0ca6e1191f2d01d1f652542 Mon Sep 17 00:00:00 2001 From: Tim Bernhard Date: Tue, 2 Dec 2025 17:59:23 +0100 Subject: [PATCH 1/3] Upgrade project to use using openrewrite. --- .classpath | 2 +- pom.xml | 5 ++- .../mcz/imagecapture/ImageCaptureApp.java | 36 +++++++++++-------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.classpath b/.classpath index 6f4a0e2..415d5af 100644 --- a/.classpath +++ b/.classpath @@ -25,7 +25,7 @@ - + diff --git a/pom.xml b/pom.xml index 5c39f49..4cec012 100644 --- a/pom.xml +++ b/pom.xml @@ -430,12 +430,11 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.14.1 true true - 16 - 16 + 21 diff --git a/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java b/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java index 7937a86..9b4ff43 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java @@ -55,20 +55,28 @@ public class ImageCaptureApp { public static final String APP_COPYRIGHT = "Copyright © 2009-2017 President and Fellows of Harvard College"; public static final String APP_LICENSE = - "This program is free software; you can redistribute it and/or modify \n " - + "it under the terms of Version 2 of the GNU General Public License \n" - + "as published by the Free Software Foundation" - + " \n " - + "This program is distributed in the hope that it will be useful,\n " - + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n " - + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n " - + "GNU General Public License for more details.\n " - + "\n " - + - "You should have received a copy of the GNU General Public License along\n " - + - "with this program; if not, write to the Free Software Foundation, Inc.,\n " - + "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n "; + """ + This program is free software; you can redistribute it and/or modify\s + \ + it under the terms of Version 2 of the GNU General Public License\s + as published by the Free Software Foundation\ + \s + \ + This program is distributed in the hope that it will be useful, + \ + but WITHOUT ANY WARRANTY; without even the implied warranty of + \ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + \ + GNU General Public License for more details. + \s + \ + You should have received a copy of the GNU General Public License along + \ + with this program; if not, write to the Free Software Foundation, Inc., + \ + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + """; public static final String APP_CONTRIBUTORS = "Brendan Haley, Linda Ford, Rodney Eastwood, Paul J. Morris, Tim Bernhard."; public static final String APP_LIBRARIES = From 625b2e862d724edd7d2dd824d494e958f3ca86ba Mon Sep 17 00:00:00 2001 From: Tim Bernhard Date: Tue, 2 Dec 2025 18:11:06 +0100 Subject: [PATCH 2/3] Fix license string --- .../mcz/imagecapture/ImageCaptureApp.java | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java b/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java index 9b4ff43..231e930 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/ImageCaptureApp.java @@ -23,21 +23,24 @@ */ package edu.harvard.mcz.imagecapture; +import java.awt.Cursor; +import java.io.IOException; +import java.util.Properties; + +import javax.swing.JOptionPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +import org.hibernate.HibernateException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import edu.harvard.mcz.imagecapture.entity.Specimen; import edu.harvard.mcz.imagecapture.exceptions.ConnectionException; import edu.harvard.mcz.imagecapture.lifecycle.AllowedVersionLifeCycle; import edu.harvard.mcz.imagecapture.lifecycle.SpecimenLifeCycle; import edu.harvard.mcz.imagecapture.ui.frame.MainFrame; import edu.harvard.mcz.imagecapture.ui.tablemodel.RunnableJobTableModel; -import org.hibernate.HibernateException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.swing.*; -import java.awt.*; -import java.io.IOException; -import java.util.Locale; -import java.util.Properties; /** * Main entry point for user interface of ImageCapture Java Application. Creates @@ -56,25 +59,17 @@ public class ImageCaptureApp { "Copyright © 2009-2017 President and Fellows of Harvard College"; public static final String APP_LICENSE = """ - This program is free software; you can redistribute it and/or modify\s - \ - it under the terms of Version 2 of the GNU General Public License\s - as published by the Free Software Foundation\ - \s - \ + This program is free software; you can redistribute it and/or modify + it under the terms of Version 2 of the GNU General Public License + as published by the Free Software Foundation. + This program is distributed in the hope that it will be useful, - \ but WITHOUT ANY WARRANTY; without even the implied warranty of - \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - \ GNU General Public License for more details. - \s - \ + You should have received a copy of the GNU General Public License along - \ with this program; if not, write to the Free Software Foundation, Inc., - \ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """; public static final String APP_CONTRIBUTORS = From 2a815e05022d003c2736a50dd46dbf751076105e Mon Sep 17 00:00:00 2001 From: Tim Bernhard Date: Tue, 2 Dec 2025 18:32:55 +0100 Subject: [PATCH 3/3] Upgrade java also in workflow --- .github/workflows/maven-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-test.yml b/.github/workflows/maven-test.yml index 080d5fd..88ac742 100644 --- a/.github/workflows/maven-test.yml +++ b/.github/workflows/maven-test.yml @@ -12,13 +12,13 @@ jobs: strategy: matrix: - java: [ 17, 21 ] + java: [ 21, 23 ] steps: - uses: actions/checkout@v2 - name: Set up JDK for java ${{matrix.java}} - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: ${{matrix.java}} distribution: 'temurin'