{"record":{"id":"17c6fd59e9a979e1","repo":"Netflix/Hystrix","slug":"not-implemented-anymore-will-be-implemented-in-a-17c6fd","errorCode":null,"errorMessage":"Not implemented anymore.  Will be implemented in a new class shortly","messagePattern":"Not implemented anymore\\.  Will be implemented in a new class shortly","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixDashboardData.java","lineNumber":44,"sourceCode":"import com.netflix.hystrix.HystrixThreadPoolKey;\nimport com.netflix.hystrix.HystrixThreadPoolMetrics;\nimport com.netflix.hystrix.metric.consumer.HystrixDashboardStream;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport rx.functions.Func0;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class SerialHystrixDashboardData extends SerialHystrixMetric {\n\n    private static final Logger logger = LoggerFactory.getLogger(SerialHystrixDashboardData.class);\n\n    @Deprecated\n    public static byte[] toBytes(HystrixDashboardStream.DashboardData dashboardData) {\n        throw new UnsupportedOperationException(\"Not implemented anymore.  Will be implemented in a new class shortly\");\n    }\n\n    public static String toJsonString(HystrixDashboardStream.DashboardData dashboardData) {\n        StringWriter jsonString = new StringWriter();\n\n        try {\n            JsonGenerator json = jsonFactory.createGenerator(jsonString);\n            writeDashboardData(json, dashboardData);\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n\n        return jsonString.getBuffer().toString();\n    }\n\n    public static List<String> toMultipleJsonStrings(HystrixDashboardStream.DashboardData dashboardData) {\n        List<String> jsonStrings = new ArrayList<String>();\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixDashboardData.java#L26-L62","documentation":"SerialHystrixDashboardData.toBytes(HystrixDashboardStream.DashboardData) is a deprecated stub that always throws UnsupportedOperationException. During the Hystrix 1.5.x serialization refactor, Netflix dropped the custom binary (byte[]) wire format in favor of JSON, and this method was hollowed out pending a rewrite that never landed in this class. The sibling method toJsonString(DashboardData) is the implemented replacement. The exception is unconditional: any call fails at runtime despite the code compiling.","triggerScenarios":"Calling the static method SerialHystrixDashboardData.toBytes(dashboardData) with any HystrixDashboardStream.DashboardData argument. This happens when code written against Hystrix < 1.5.0 (or against the old binary-metric pipeline) is recompiled/run against 1.5.x — the method still exists and compiles (it is @Deprecated, not removed), but the very first invocation throws.","commonSituations":"Upgrading an application or dashboard/turbine consumer from Hystrix 1.4.x to 1.5.x without migrating serialization calls; copy-pasted sample code from old Netflix wiki/blog posts demonstrating byte-array metric publishing; IDE autocomplete picking toBytes over toJsonString because the deprecated method still appears in the API surface; custom metrics sinks that packed DashboardData into byte[] for a message bus.","solutions":["Replace the call with SerialHystrixDashboardData.toJsonString(dashboardData) and transmit the JSON string (e.g. getBytes(StandardCharsets.UTF_8)) instead of the binary blob.","If a byte[] is strictly required downstream, serialize the JSON string: dashboardJson.getBytes(StandardCharsets.UTF_8).","Search the codebase for other byte-based serial calls from the same refactor (SerialHystrixRequestEvents.toBytes, SerialHystrixUtilization.toBytes/fromByteBuffer, SerialHystrixMetric.fromByteBufferToString, SerialHystrixConfiguration.toBytes/fromByteBuffer) and migrate them all in one pass.","Enable -Werror=deprecation or deprecation warnings in the build so @Deprecated stubs like this fail (or at least warn) at compile time instead of at runtime."],"exampleFix":"// before\nbyte[] payload = SerialHystrixDashboardData.toBytes(dashboardData);\n\n// after\nbyte[] payload = SerialHystrixDashboardData.toJsonString(dashboardData)\n        .getBytes(java.nio.charset.StandardCharsets.UTF_8);","handlingStrategy":"try-catch","validationCode":"// Reflective guard: refuse to call stubbed serial methods before invoking them.\nstatic boolean isImplemented(Class<?> clazz, String methodName, Class<?>... params) {\n    try {\n        java.lang.reflect.Method m = clazz.getMethod(methodName, params);\n        if (m.getAnnotation(Deprecated.class) == null) return true;\n        // deprecated serial stubs in com.netflix.hystrix.serial always throw\n        return false;\n    } catch (NoSuchMethodException e) {\n        return false;\n    }\n}\n\nif (isImplemented(SerialHystrixDashboardData.class, \"toBytes\", HystrixDashboardStream.DashboardData.class)) {\n    payload = SerialHystrixDashboardData.toBytes(dashboardData);\n} else {\n    payload = SerialHystrixDashboardData.toJsonString(dashboardData)\n            .getBytes(java.nio.charset.StandardCharsets.UTF_8);\n}","typeGuard":null,"tryCatchPattern":"try {\n    payload = SerialHystrixDashboardData.toBytes(dashboardData);\n} catch (UnsupportedOperationException e) {\n    // deprecated binary stub in Hystrix 1.5.x — fall back to the JSON API\n    payload = SerialHystrixDashboardData.toJsonString(dashboardData)\n            .getBytes(java.nio.charset.StandardCharsets.UTF_8);\n}","preventionTips":["Compile with -Xlint:deprecation (or -Werror=deprecation) so calls to @Deprecated serial methods surface at build time.","When upgrading Hystrix 1.4.x -> 1.5.x, grep the codebase for 'SerialHystrix' and migrate every toBytes/fromByteBuffer call to the toJsonString JSON API.","Prefer the JSON overloads (toJsonString) even when the byte[] overload compiles — in 1.5.x it is a guaranteed throw.","Pin the Hystrix version explicitly in the build (no version ranges) so a transitive upgrade cannot silently swap in the stubbed implementation."],"tags":["hystrix","serialization","deprecated-api","unsupportedoperation","migration","runtime"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}