From 5a93f6d6d8e7cbf8b5498969df6aa87a60484c0d Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre <contact@b3dgs.com> Date: Thu, 14 Dec 2023 16:05:22 +0100 Subject: [PATCH] Code cleanup. --- .../editor/ApplicationConfiguration.java | 76 +++++++++---------- .../java/com/b3dgs/sample/ConstantTest.java | 4 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/com.b3dgs.sample.editor/src/com/b3dgs/sample/editor/ApplicationConfiguration.java b/com.b3dgs.sample.editor/src/com/b3dgs/sample/editor/ApplicationConfiguration.java index 71d26f0..56f29fa 100644 --- a/com.b3dgs.sample.editor/src/com/b3dgs/sample/editor/ApplicationConfiguration.java +++ b/com.b3dgs.sample.editor/src/com/b3dgs/sample/editor/ApplicationConfiguration.java @@ -48,44 +48,6 @@ public class ApplicationConfiguration /** Logger. */ private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationConfiguration.class); - /** - * Import a project from a path. - * - * @param projectPath The project path. - */ - private static void importProject(String projectPath) - { - final File path = new File(projectPath); - try - { - final Project project = ProjectFactory.create(path.getCanonicalFile()); - ProjectImportHandler.importProject(project); - } - catch (final IOException exception) - { - LOGGER.error("importProject error", exception); - } - } - - /** - * Check if there is a project to import. - */ - private static void checkProjectImport() - { - final String[] args = Platform.getApplicationArgs(); - for (int i = 0; i < args.length; i++) - { - if (ARG_IMPORT.equals(args[i])) - { - i++; // CHECKSTYLE IGNORE LINE: TrailingComment|ModifiedControlVariable - if (i < args.length) - { - importProject(args[i]); - } - } - } - } - /** Application reference. */ private final MApplication application; @@ -120,6 +82,44 @@ public void execute(IEventBroker eventBroker) */ private static final class AppStartupCompleteEventHandler implements EventHandler { + /** + * Import a project from a path. + * + * @param projectPath The project path. + */ + private static void importProject(String projectPath) + { + final File path = new File(projectPath); + try + { + final Project project = ProjectFactory.create(path.getCanonicalFile()); + ProjectImportHandler.importProject(project); + } + catch (final IOException exception) + { + LOGGER.error("importProject error", exception); + } + } + + /** + * Check if there is a project to import. + */ + private static void checkProjectImport() + { + final String[] args = Platform.getApplicationArgs(); + for (int i = 0; i < args.length; i++) + { + if (ARG_IMPORT.equals(args[i])) + { + i++; // CHECKSTYLE IGNORE LINE: TrailingComment|ModifiedControlVariable + if (i < args.length) + { + importProject(args[i]); + } + } + } + } + /** * Constructor. */ diff --git a/sample-game/src/test/java/com/b3dgs/sample/ConstantTest.java b/sample-game/src/test/java/com/b3dgs/sample/ConstantTest.java index 2c2d16e..0f91027 100644 --- a/sample-game/src/test/java/com/b3dgs/sample/ConstantTest.java +++ b/sample-game/src/test/java/com/b3dgs/sample/ConstantTest.java @@ -22,13 +22,13 @@ /** * Test {@link Constant}. */ -public class ConstantTest +final class ConstantTest { /** * Test all. */ @Test - public void testAll() + void testAll() { Assertions.assertEquals("Sample", Constant.PROGRAM_NAME); Assertions.assertEquals("1.0.0", Constant.PROGRAM_VERSION.toString());