{"record":{"id":"ef2b4be92514b407","repo":"quarkusio/quarkus","slug":"no-order-set","errorCode":null,"errorMessage":"No order set","messagePattern":"No order set","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/vertx-http/deployment-spi/src/main/java/io/quarkus/vertx/http/deployment/spi/RouteBuildItem.java","lineNumber":137,"sourceCode":"        this.notFoundPageTitle = builder.notFoundPageTitle;\n        this.routeConfigKey = builder.routeConfigKey;\n        this.customizer = builder.customizer;\n        this.isManagement = builder.isManagement;\n    }\n\n    public RouteType getTypeOfRoute() {\n        return typeOfRoute;\n    }\n\n    public boolean hasOrder() {\n        return order.isPresent();\n    }\n\n    public int getOrder() {\n        if (order.isPresent()) {\n            return order.getAsInt();\n        } else {\n            throw new IllegalStateException(\"No order set\");\n        }\n    }\n\n    public boolean hasRouteConfigKey() {\n        return routeConfigKey != null;\n    }\n\n    public String getRouteConfigKey() {\n        return routeConfigKey;\n    }\n\n    public Handler<RoutingContext> getHandler() {\n        return handler;\n    }\n\n    public HandlerType getHandlerType() {\n        return typeOfHandler;\n    }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx-http/deployment-spi/src/main/java/io/quarkus/vertx/http/deployment/spi/RouteBuildItem.java#L119-L155","documentation":"RouteBuildItem.getOrder returns the build item's ordering priority, but only if one was explicitly set via the builder's order(); otherwise the OptionalInt is empty and this IllegalStateException is thrown. Consumers (e.g. route conversion) require an order to sort routes deterministically.","triggerScenarios":"Calling getOrder() (directly or via convert) on a RouteBuildItem built without RouteBuildItem.Builder.order(int).","commonSituations":"Custom extension build step creating a route item and forgetting to set an order; downstream build step consuming routes assuming an order was always assigned; refactors replacing a default order with an OptionalInt.","solutions":["Set an explicit order when building the route: RouteBuildItem.builder().route(...).order(DEFAULT_ROUTE_ORDER)","Check order().isPresent() before calling getOrder","Pick a sensible constant such as RouteBuildItem.DEFAULT_ROUTE_ORDER or a named ordinal constant"],"exampleFix":"// before\nRouteBuildItem item = RouteBuildItem.builder().route(route).build();\n// after\nRouteBuildItem item = RouteBuildItem.builder().route(route).order(RouteBuildItem.DEFAULT_ROUTE_ORDER).build();","handlingStrategy":"type-guard","validationCode":"if (routeBuildItem.order().isPresent()) {\n    int order = routeBuildItem.getOrder();\n}","typeGuard":"static boolean hasOrder(RouteBuildItem item) {\n    return item.order().isPresent();\n}","tryCatchPattern":null,"preventionTips":["Always call .order(...) when building RouteBuildItems","Prefer DEFAULT_ROUTE_ORDER or named ordinal constants","Add build-step tests that consume routes via getOrder"],"tags":["build-time","routes","state","illegal-state"],"backgroundTag":"required-value-not-set","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}