diff --git a/.github/instructions/moderne-run-recipe.instructions.md b/.github/instructions/moderne-run-recipe.instructions.md index 1a1543d..575f5fe 100644 --- a/.github/instructions/moderne-run-recipe.instructions.md +++ b/.github/instructions/moderne-run-recipe.instructions.md @@ -26,10 +26,10 @@ If the user already knows the exact recipe name or provides a path to a local re **Never guess recipe names.** Only use names returned by a search or that the user explicitly provides. -**If `search_recipes` and `learn_recipe` MCP tools are available** (provided by `mod mcp`): +**If `edit_code` / `analyze_code` and `learn_recipe` MCP tools are available** (provided by `mod mcp`): -1. Use `search_recipes` with natural-language queries to find recipes by keyword: - - Example queries: "migrate to Spring Boot 3", "remove unused imports", "upgrade JUnit 5" +1. Use `edit_code` (to modify the codebase) or `analyze_code` (to examine it without changes) with natural-language queries to find recipes by keyword: + - Example queries: "migrate persistence namespace", "remove unused imports", "upgrade test framework" - Results include the fully-qualified recipe name and display name - Paginate with the `offset` parameter (25 results per page) @@ -242,7 +242,7 @@ If recipe needs fixes: ## Reference -Search recipes: `search_recipes` MCP tool, or ` config recipes search ""` +Search recipes: `edit_code` (for modifications) or `analyze_code` (for non-modifying analysis) MCP tool, or ` config recipes search ""` Learn recipe details: `learn_recipe` MCP tool with the fully-qualified recipe name diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2e1e9d..80c464e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK 25 uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '25' distribution: 'temurin' cache: maven diff --git a/pom.xml b/pom.xml index 99c0f48..2bafeec 100644 --- a/pom.xml +++ b/pom.xml @@ -13,10 +13,9 @@ Ministry of Magic — Registered Wizards Management Service + 25 UTF-8 - 11 - 11 - 11 + 25 4.0.2 2.2.224 org.ministry.magic.WizardRegistryApplication @@ -117,9 +116,9 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.15.0 - 11 + 25 @@ -159,18 +158,18 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.5.5 **/*IT.java - -Dnet.bytebuddy.experimental=true + -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED org.apache.maven.plugins maven-failsafe-plugin - 3.2.2 + 3.5.5 @@ -179,6 +178,9 @@ + + --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED -Dnet.bytebuddy.experimental=true + diff --git a/src/main/java/org/ministry/magic/WizardRegistryApplication.java b/src/main/java/org/ministry/magic/WizardRegistryApplication.java index 5fd55a6..bd1e82f 100644 --- a/src/main/java/org/ministry/magic/WizardRegistryApplication.java +++ b/src/main/java/org/ministry/magic/WizardRegistryApplication.java @@ -27,7 +27,7 @@ public class WizardRegistryApplication extends Application { - public static void main(String[] args) throws Exception { + void main(String[] args) throws Exception { new WizardRegistryApplication().run(args); } diff --git a/src/main/java/org/ministry/magic/resources/WizardResource.java b/src/main/java/org/ministry/magic/resources/WizardResource.java index b831959..23b9118 100644 --- a/src/main/java/org/ministry/magic/resources/WizardResource.java +++ b/src/main/java/org/ministry/magic/resources/WizardResource.java @@ -85,7 +85,7 @@ public WizardResponse updateStatus(@PathParam("id") UUID id, String newStatus) { try { RegistrationStatus status = RegistrationStatus.valueOf(newStatus.trim().toUpperCase()); return WizardResponse.fromWizard(service.updateStatus(id, status)); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException _) { throw new WebApplicationException("Invalid status: " + newStatus, Response.Status.BAD_REQUEST); } } diff --git a/src/main/java/org/ministry/magic/service/WizardAuthService.java b/src/main/java/org/ministry/magic/service/WizardAuthService.java index f5c43a5..a69846a 100644 --- a/src/main/java/org/ministry/magic/service/WizardAuthService.java +++ b/src/main/java/org/ministry/magic/service/WizardAuthService.java @@ -22,7 +22,7 @@ public String hashPassword(String password) { byte[] hash = md.digest(password.getBytes()); StringBuilder sb = new StringBuilder(); for (byte b : hash) { - sb.append(String.format("%02x", b)); + sb.append("%02x".formatted(b)); } return sb.toString(); } catch (NoSuchAlgorithmException e) { diff --git a/src/main/java/org/ministry/magic/service/WizardService.java b/src/main/java/org/ministry/magic/service/WizardService.java index 487e433..58940f1 100644 --- a/src/main/java/org/ministry/magic/service/WizardService.java +++ b/src/main/java/org/ministry/magic/service/WizardService.java @@ -59,7 +59,7 @@ public List listWizards() { public List findByHouse(String house) { try { return dao.findByHouse(org.ministry.magic.core.House.valueOf(house.toUpperCase())); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException _) { throw new WebApplicationException("Invalid house: " + house, Response.Status.BAD_REQUEST); } } @@ -67,7 +67,7 @@ public List findByHouse(String house) { public List findByStatus(String status) { try { return dao.findByStatus(RegistrationStatus.valueOf(status.toUpperCase())); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException _) { throw new WebApplicationException("Invalid status: " + status, Response.Status.BAD_REQUEST); } } @@ -123,38 +123,24 @@ public long countActiveWizards() { } public String describeRegistrationEvent(Object event) { - if (event instanceof Wizard) { - Wizard w = (Wizard) event; + if (event instanceof Wizard w) { return "Wizard registration: " + w.getFirstName() + " " + w.getLastName(); - } else if (event instanceof String) { - String msg = (String) event; + } else if (event instanceof String msg) { return "Registry message: " + msg; - } else if (event instanceof List) { - List list = (List) event; + } else if (event instanceof List list) { return "Batch event: " + list.size() + " records"; } return "Unknown event type"; } public String getHouseDescription(org.ministry.magic.core.House house) { - String description; - switch (house) { - case GRYFFINDOR: - description = "Brave at heart, dwell in nerve and chivalry"; - break; - case HUFFLEPUFF: - description = "Just and loyal, patient and true"; - break; - case RAVENCLAW: - description = "Wit beyond measure is man's greatest treasure"; - break; - case SLYTHERIN: - description = "Cunning folk use any means to achieve their ends"; - break; - default: - description = "Unaffiliated with a Hogwarts house"; - } - return description; + return switch (house) { + case GRYFFINDOR -> "Brave at heart, dwell in nerve and chivalry"; + case HUFFLEPUFF -> "Just and loyal, patient and true"; + case RAVENCLAW -> "Wit beyond measure is man's greatest treasure"; + case SLYTHERIN -> "Cunning folk use any means to achieve their ends"; + default -> "Unaffiliated with a Hogwarts house"; + }; } public String buildWizardSummaryHtml(Wizard wizard) {