{"record":{"id":"4d8f88a828f7b06d","repo":"apple/pkl","slug":"method-qualifiedname-is-deprecated-depreca","errorCode":null,"errorMessage":"Method `${qualifiedName}` is deprecated: ${deprecation}","messagePattern":"Method `(.+?)` is deprecated: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkl-core/src/main/java/org/pkl/core/ast/member/ClassMethod.java","lineNumber":80,"sourceCode":"    this.deprecation = deprecation;\n  }\n\n  public void initFunctionNode(FunctionNode functionNode) {\n    //noinspection ConstantValue\n    assert this.functionNode == null;\n    this.functionNode = functionNode;\n  }\n\n  public CallTarget getCallTarget() {\n    return functionNode.getCallTarget();\n  }\n\n  @TruffleBoundary\n  private void reportDeprecation(SourceSection callSite) {\n    assert deprecation != null;\n\n    var logger = VmContext.get(null).getLogger();\n    logger.warn(\n        \"Method `\"\n            + qualifiedName\n            + \"` is deprecated\"\n            + (deprecation.isEmpty() ? \"\" : \": \" + deprecation),\n        VmUtils.createStackFrame(callSite, null));\n  }\n\n  public CallTarget getCallTarget(SourceSection callSite) {\n    if (deprecation != null) {\n      reportDeprecation(callSite);\n    }\n    return functionNode.getCallTarget();\n  }\n\n  @Override\n  public CallTarget getCallTarget(SourceSection callSite, VmObjectLike owner) {\n    return getCallTarget(callSite);\n  }","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/member/ClassMethod.java#L62-L98","documentation":"ClassMethod.reportDeprecation fires when Pkl code calls a class method marked deprecated. It logs a warning naming the qualified method and any custom deprecation text, with a stack frame at the call site; evaluation continues normally.","triggerScenarios":"Any Pkl evaluation whose code calls a method annotated with @Deprecated { ... } — the warning is emitted at the call site each time getCallTarget resolves a deprecated method.","commonSituations":"Using library or stdlib methods superseded by newer APIs, upgrading a Pkl dependency where methods were deprecated, static-analysis sweeps for future removals.","solutions":["Replace calls to the deprecated method with the replacement named in the deprecation text.","Check the class/method documentation for the recommended alternative.","Suppress only if intentional, and plan removal before the next major release.","Enable warning visibility in your tooling to find all call sites."],"exampleFix":"// before (Pkl)\noldList.sortInPlace() // deprecated\n// after\nnewList.sort() // use replacement per deprecation message","handlingStrategy":"validation","validationCode":"// grep Pkl sources for known deprecated method calls before evaluation\ngrep -rn \"oldList.sortInPlace\\|deprecatedMethod\" src/main/pkl && exit 1 || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read deprecation messages for the recommended replacement","Track pkl dependency changelogs for new deprecations","Fail builds on deprecation warnings where feasible","Prefer stable/replacement APIs in new code"],"tags":["deprecation","pkl","method"],"backgroundTag":"deprecated-api-usage","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}