相关疑难解决方法(0)

Java中有效的@SuppressWarnings警告名称列表是什么?

@SuppressWarningsJava 中有效警告名称的列表是什么?

进来之间的("")@SuppressWarnings("").

java eclipse warnings compiler-warnings suppress-warnings

251
推荐指数
5
解决办法
14万
查看次数

收集的内容从未在Intellij IDEA中更新警告

我创建了一个简单的Counter类:

public class Counter<T> extends HashMap<T, Long> {
    public Counter() {
    }

    public void increase(T key) {
        put(key, getOrDefault(key, 0l) + 1);
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的代码中,我调用increase()方法,然后使用Map方法访问数据,例如

  Counter<Integer> counter = new Counter<>();
  for (Integer i: ... some collection ...)
      counter.increase(i);
Run Code Online (Sandbox Code Playgroud)

Intellij counter用警告颜色突出显示(最后一行代码片段)的声明,工具提示消息说明

查询集合的内容,但从未更新.

显然我可以忽略这个警告,但有没有办法说服Intellij我的代码没有任何问题?

我正在使用14.0.2社区版.

java intellij-idea

11
推荐指数
2
解决办法
1万
查看次数