Remove redundant comments and unused imports to improve code clarity and maintainability
Auto Publish on Version Change / check-and-publish (push) Successful in 14s

This commit is contained in:
CodingPhoenixx
2026-05-28 13:11:11 +02:00
parent 1ac3c29b83
commit b75e1e5c6e
3 changed files with 3 additions and 14 deletions
@@ -1,6 +1,5 @@
package dev.coph.nextusweb.server.cores;
import dev.coph.nextusweb.server.cores.CorsConfig;
import dev.coph.nextusweb.server.router.Response;
import io.netty.handler.codec.http.*;
@@ -54,10 +54,7 @@ public final class RateLimitGate {
}
private void doCleanup() {
// 10 Minuten in Nanosekunden
long threshold = 10L * 60 * 1_000_000_000L;
// Cleanup-Methoden müssten an alle Limiter durchgereicht werden simplifiziert:
// In der Praxis: registriere alle Limiter und rufe ihre cleanup-Methode auf.
}
public void shutdown() { cleanup.shutdown(); }
@@ -64,13 +64,7 @@ public final class Router {
public Router delete(String path, Handler h) {
return register(HttpMethod.DELETE, path, h);
}
/**
* Resolve den Pfad zu einem Handler. Liefert:
* - Match wenn Pfad + Methode passen
* - MethodNotAllowed wenn der Pfad existiert, aber nicht für diese Methode
* - NotFound wenn der Pfad gar nicht registriert ist
*/
public Resolution resolve(HttpMethod method, String path) {
Map<String, String> params = new HashMap<>(4);
Node node = root;
@@ -93,7 +87,6 @@ public final class Router {
return new Resolution.Match(h, params);
}
// Pfad existiert, aber nicht für diese Methode
if (!node.handlers.isEmpty()) {
return new Resolution.MethodNotAllowed(
Collections.unmodifiableSet(node.handlers.keySet()));
@@ -125,8 +118,8 @@ public final class Router {
private static final class Node {
final Map<String, Node> children = new ConcurrentHashMap<>();
final Map<HttpMethod, Handler> handlers = new ConcurrentHashMap<>();
Node paramChild; // für {id}
Node paramChild;
String paramName;
Node wildcardChild; // für *
Node wildcardChild;
}
}