简体   繁体   English

java.util.HashMap的Intellij弃用警告

[英]Intellij deprecation warning for java.util.HashMap

IntelliJ seems to think that the no-arg constructor of java.util.HashMap is deprecated, as judged by the style in which it marks up the constructor name: IntelliJ似乎认为java.util.HashMap的no-arg构造函数已被弃用,这是由它标记构造函数名称的样式判断的:

在此处输入图片说明

How can I fix it, if I don't want to disable inspections? 如果我不想禁用检查,该如何解决?

UPD: IntelliJ seems to think that the java.util.HashMap class is deprecated UPD:IntelliJ似乎认为java.util.HashMap 已被弃用

在此处输入图片说明

I had this issue with java.util.List marked as deprecated. 我在将java.util.List标记为已弃用时遇到了这个问题。 Somehow I had marked it as such via an "external annotation". 我以某种方式通过“外部注释”将其标记为此类。

To remove it: 删除它:

  • Click through to the source (in my case java.util.List) 单击进入源(在我的情况下为java.util.List)
  • There should be a @ beside the type, click on it ... 类型旁边应该有一个@,单击它...
  • Deannotate java.lang.Deprecated 取消对java.lang.Deannotate的注释

List上的外部注释

I've just downloaded and set the latest JDK 1.8_131 and problem has been solved. 我刚刚下载并设置了最新的JDK 1.8_131,问题已解决。 Thank you for attention 感谢您的关注

UPD: When I choose again former JDK the problem no longer occurs UPD:当我再次选择以前的JDK时,该问题不再发生

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM