• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kikione
V2EX  ›  程序员

枚举类为何报这个提示

  •  
  •   kikione · Oct 23, 2021 · 1676 views
    This topic created in 1697 days ago, the information mentioned may be changed or developed.

    java.net.URLDecoder 中的方法 decode(String encodeStr) 这个方法已经过时,应该使用双参数 decode(String source, String encode)。接口提供方既然明确是过时接口,那么有义务同时提供新的接口;作为调用方来说,有义务去考证过时方法的新实现是什么。

    AoEiuV020
        1
    AoEiuV020  
       Oct 23, 2021 via Android
    有人觉得是有的,所以 kotlin 里的 Deprecated 就要求配上 ReplaceWith ,以便 ide 自动更换新接口,
    但也有些方法并不是换了写法而是出于安全或者其他考虑完全不建议使用,就没有替代了,
    总之不能一竿子打死,一般能在注释里提一下就挺好的了,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   935 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:10 · PVG 05:10 · LAX 14:10 · JFK 17:10
    ♥ Do have faith in what you're doing.