Code review comment: There is no guard around this any more, so it looks like if the key already exists it will be set twice?

Code under review:
DevConsoleRouteBuildItem handlePost() {
        return new DevConsoleRouteBuildItem("config", "POST", new DevConsolePostHandler() {
            @Override
            protected void handlePost(RoutingContext event, MultiMap form) throws Exception {
                String key = event.request().getFormAttribute("name");
                String value = event.request().getFormAttribute("value");

                List<Path> resourcesDir = DevConsoleManager.getHotReplacementContext().getResourcesDir();
                if (resourcesDir.isEmpty()) {
                    throw new IllegalStateException("Unable to manage configurations - no resource directory found");
                }

                
                Path path = resourcesDir.get(0);
                Path configPath = path.resolve("application.properties");
                if (!Files.exists(configPath)) {
                    configPath = Files.createFile(path.resolve("application.properties"));
                }

                String profile = ProfileManager.getActiveProfile();
                String profileKey = !profile.equals(DEVELOPMENT.getDefaultProfile()) ? "%" + profile + "." + key : key;
                List<String> lines = Files.readAllLines(configPath);
                for (int i = 0, linesSize = lines.size(); i < linesSize; i++) {
                    final String line = lines.get(i);
                    if (line.startsWith(profileKey)) {
                        lines.set(i, profileKey + "=" + value);
                        break;
                    }
                }

                lines.add(profileKey + "=" + value);

                try (BufferedWriter writer = Files.newBufferedWriter(configPath)) {
                    for (String i : lines) {
                        writer.write(i);
                        writer.newLine();
                    }
                }

                DevConsoleManager.getHotReplacementContext().doScan(true);
                flashMessage(event, "Configuration updated");
            }
        });
    }

Line commented on: lines.add(profileKey + "=" + value);

Revised code:
DevConsoleRouteBuildItem handlePost() {
        return new DevConsoleRouteBuildItem("config", "POST", new DevConsolePostHandler() {
            @Override
            protected void handlePost(RoutingContext event, MultiMap form) throws Exception {
                String name = event.request().getFormAttribute("name");
                String value = event.request().getFormAttribute("value");

                List<Path> resourcesDir = DevConsoleManager.getHotReplacementContext().getResourcesDir();
                if (resourcesDir.isEmpty()) {
                    throw new IllegalStateException("Unable to manage configurations - no resource directory found");
                }

                
                Path path = resourcesDir.get(0);
                Path configPath = path.resolve("application.properties");
                if (!Files.exists(configPath)) {
                    configPath = Files.createFile(path.resolve("application.properties"));
                }

                String profile = ProfileManager.getActiveProfile();
                name = !profile.equals(DEVELOPMENT.getDefaultProfile()) ? "%" + profile + "." + name : name;
                List<String> lines = Files.readAllLines(configPath);
                int nameLine = -1;
                for (int i = 0, linesSize = lines.size(); i < linesSize; i++) {
                    final String line = lines.get(i);
                    if (line.startsWith(name + "=")) {
                        nameLine = i;
                        break;
                    }
                }

                if (nameLine != -1) {
                    if (value.isEmpty()) {
                        lines.remove(nameLine);
                    } else {
                        lines.set(nameLine, name + "=" + value);
                    }
                } else {
                    if (!value.isEmpty()) {
                        lines.add(name + "=" + value);
                    }
                }

                try (BufferedWriter writer = Files.newBufferedWriter(configPath)) {
                    for (String i : lines) {
                        writer.write(i);
                        writer.newLine();
                    }
                }

                DevConsoleManager.getHotReplacementContext().doScan(true);
                flashMessage(event, "Configuration updated");
            }
        });
    }