diff --git a/Dockerfile b/Dockerfile index f1e2e90..ca7f76f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM eclipse-temurin:17-jdk AS builder-base +FROM eclipse-temurin:21-jdk AS builder-base RUN apt-get update && \ apt-get install -y --no-install-recommends \ - dos2unix \ binutils \ + dos2unix \ fakeroot \ rpm && \ rm -rf /var/lib/apt/lists/* diff --git a/src/test/java/com/github/mfl28/boundingboxeditor/BoundingBoxEditorTestBase.java b/src/test/java/com/github/mfl28/boundingboxeditor/BoundingBoxEditorTestBase.java index ce875cb..be49459 100644 --- a/src/test/java/com/github/mfl28/boundingboxeditor/BoundingBoxEditorTestBase.java +++ b/src/test/java/com/github/mfl28/boundingboxeditor/BoundingBoxEditorTestBase.java @@ -113,8 +113,8 @@ protected static Stage getTopModalStage(FxRobot robot, String title) { // It is needed to get the first found modal window. return robot.listWindows() .stream() - .filter(window -> window instanceof Stage) - .map(window -> (Stage) window) + .filter(Stage.class::isInstance) + .map(Stage.class::cast) .filter(stage -> stage.getModality() == Modality.APPLICATION_MODAL) .filter(stage -> stage.getTitle().equals(title)) .findFirst() @@ -247,7 +247,7 @@ protected void onStart(Stage stage) { } @AfterEach - protected void tearDown() throws TimeoutException { + void tearDown() throws TimeoutException { FxToolkit.cleanupStages(); FxToolkit.hideStage(); // Make sure FileChangeWatcher is interrupted. @@ -554,8 +554,8 @@ private boolean nodePresentAndVisibleAs(FxRobot robot, String i private boolean isTopModalStagePresent(FxRobot robot) { return robot.listWindows() .stream() - .filter(window -> window instanceof Stage) - .map(window -> (Stage) window) + .filter(Stage.class::isInstance) + .map(Stage.class::cast) .anyMatch(stage -> stage.getModality() == Modality.APPLICATION_MODAL); } diff --git a/src/test/java/com/github/mfl28/boundingboxeditor/controller/ControllerTests.java b/src/test/java/com/github/mfl28/boundingboxeditor/controller/ControllerTests.java index 1a1f964..8761d84 100644 --- a/src/test/java/com/github/mfl28/boundingboxeditor/controller/ControllerTests.java +++ b/src/test/java/com/github/mfl28/boundingboxeditor/controller/ControllerTests.java @@ -129,11 +129,11 @@ void onExportAnnotation_PVOC_WhenPreviouslyImportedAnnotation_ShouldProduceEquiv .isHasAssignedBoundingShapes() && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingBoxView) + .filter(BoundingBoxView.class::isInstance) .count() == 8 && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingPolygonView) + .filter(BoundingPolygonView.class::isInstance) .count() == 1), () -> saveScreenshotAndReturnMessage(testinfo, "Bounding shape counts did not match " + @@ -273,11 +273,11 @@ void onExportAnnotation_YOLO_WhenPreviouslyImportedAnnotation_ShouldProduceEquiv .isHasAssignedBoundingShapes() && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingBoxView) + .filter(BoundingBoxView.class::isInstance) .count() == 9 && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingPolygonView) + .filter(BoundingPolygonView.class::isInstance) .count() == 1), () -> saveScreenshotAndReturnMessage(testinfo, "Bounding shape counts did not match " + @@ -407,11 +407,11 @@ void onExportAnnotation_JSON_WhenPreviouslyImportedAnnotation_ShouldProduceEquiv .isHasAssignedBoundingShapes() && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingBoxView) + .filter(BoundingBoxView.class::isInstance) .count() == 8 && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingPolygonView) + .filter(BoundingPolygonView.class::isInstance) .count() == 1), () -> saveScreenshotAndReturnMessage(testinfo, "Bounding shape counts did not match " + @@ -1227,10 +1227,10 @@ void onExportAnnotation_CSV_WhenPreviouslyImportedAnnotation_ShouldProduceEquiva .isHasAssignedBoundingShapes() && mainView.getCurrentBoundingShapes() .stream() - .filter(viewable -> viewable instanceof BoundingBoxView) + .filter(BoundingBoxView.class::isInstance) .count() == 3 && mainView.getCurrentBoundingShapes() - .stream().noneMatch(viewable -> viewable instanceof BoundingPolygonView)), + .stream().noneMatch(BoundingPolygonView.class::isInstance)), () -> saveScreenshotAndReturnMessage(testinfo, "Bounding shape counts did not match " + "within " + TIMEOUT_DURATION_IN_SEC +