NEW是内部专有API

Alb*_*ros 7 java compiler-warnings

在我们的项目构建期间,我们得到一个相当无法解释的警告:

    [javac] (...)\SessionKeeper.java:39: warning: NEW is internal proprietary API and may be removed in a future release
    [javac]     private static final int timeOfInactivity = 1000 * 60 * 9; // allowed time of inactivity
    [javac]                                ^

附加信息:

  • Apache Ant(TM)版本1.8.4于2012年5月22日编译
  • Java(TM)SE运行时环境(版本1.7.0_25-b16)

任何人都可以解释为什么编译器发出此警告,以及我应该改变什么以避免它?

[编辑]添加了附近的代码

private static final String CLASS_NAME = SessionKeeper.class.getName();

    private static final int logoutDelaySeconds = 1000 * 60; // logout after 1 min. from the point when dialog was shown to the user
    private static final int timeOfInactivity = 1000 * 60 * 9; // allowed time of inactivity

    private boolean isSchedulerStarted = false; // indicates if SessionKeeper was started or not

    private static SessionKeeper instance;

[编辑]由于不少人请求我在这里附加的源(24小时后到期):http: //pastebin.com/t2M5mgd0

到目前为止已经尝试过的内容:

  • 内联常量 - >错误转到上面的行
  • Reactoring SessionKeeper不扩展任何类 - >相同的错误
  • 删除CLASS_NAME并记录语句

Alb*_*ros 3

解决方案发现我删除了文件中的所有导入,并用存根替换了所有内容。

这使得java在另一个文件中报告错误。

另一个文件的导入错误且未使用(导入 com.sun.org.apache.bcel.internal.generic.NEW)。

因此,我建议任何收到此错误的人在整个工作区中搜索新内容

  • 建议在每次更改源代码后检查未使用的导入。这些新内容可能是误用 IDE 快速修复的结果。 (3认同)