diff --git a/cli/src/main/java/com/devonfw/tools/ide/merge/FileMerger.java b/cli/src/main/java/com/devonfw/tools/ide/merge/FileMerger.java index 93807b53c..a1333585a 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/merge/FileMerger.java +++ b/cli/src/main/java/com/devonfw/tools/ide/merge/FileMerger.java @@ -27,7 +27,7 @@ public abstract class FileMerger extends AbstractWorkspaceMerger { public FileMerger(IdeContext context) { super(context); - this.legacySupport = IdeVariables.IDE_VARIABLE_SYNTAX_LEGACY_SUPPORT_ENABLED.get(context).booleanValue(); + this.legacySupport = Boolean.TRUE.equals(IdeVariables.IDE_VARIABLE_SYNTAX_LEGACY_SUPPORT_ENABLED.get(context)); } /** @@ -106,6 +106,10 @@ protected boolean doUpgradeTextContent(Path workspaceFile) throws IOException { return modified; } + /** + * @param content the content from a workspace template file that may contain legacy stuff like old variable syntax. + * @return the given {@link String} with potential legacy constructs being resolved. + */ protected String upgradeWorkspaceContent(String content) { VariableSyntax syntax = VariableSyntax.CURLY; diff --git a/cli/src/main/java/com/devonfw/tools/ide/merge/JsonMerger.java b/cli/src/main/java/com/devonfw/tools/ide/merge/JsonMerger.java index 18b6cdfc6..9b9e88392 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/merge/JsonMerger.java +++ b/cli/src/main/java/com/devonfw/tools/ide/merge/JsonMerger.java @@ -360,7 +360,10 @@ private Status(boolean inverse, boolean addNewProperties) { } - public static class JsonPrettyPrinter extends DefaultPrettyPrinter { + /** + * Extends {@link DefaultPrettyPrinter} to get nicely formatted JSON output. + */ + private static class JsonPrettyPrinter extends DefaultPrettyPrinter { public JsonPrettyPrinter() { DefaultPrettyPrinter.Indenter indenter = new DefaultIndenter(" ", "\n"); diff --git a/cli/src/main/java/com/devonfw/tools/ide/merge/WorkspaceMerger.java b/cli/src/main/java/com/devonfw/tools/ide/merge/WorkspaceMerger.java index 031384ea8..dfee5ed1d 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/merge/WorkspaceMerger.java +++ b/cli/src/main/java/com/devonfw/tools/ide/merge/WorkspaceMerger.java @@ -27,6 +27,10 @@ public interface WorkspaceMerger { */ void inverseMerge(Path workspace, EnvironmentVariables variables, boolean addNewProperties, Path update); + /** + * @param workspace the {@link Path} to the {@link com.devonfw.tools.ide.context.IdeContext#FOLDER_WORKSPACE workspace} with IDE templates to upgrade + * (migrate and replace legacy constructs). + */ void upgrade(Path workspace); }