gpt4 book ai didi

java - NEW 是内部专有 API

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:32:34 28 4
gpt4 key购买 nike

在我们项目的构建过程中,我们收到一个相当无法解释的警告:

    [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]                                ^

附加信息:

  • 2012 年 5 月 22 日编译的 Apache Ant(TM) 版本 1.8.4
  • Java(TM) SE 运行时环境(build 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;

[edit] 由于有不少人要求提供源代码,因此我将其附在此处(24 小时后过期): http://pastebin.com/t2M5mgd0

[edit] 目前已经尝试过的:

  • 内联常量 -> 错误转到上面的行
  • 重构 SessionKeeper 以不扩展任何类 -> 同样的错误
  • 删除 CLASS_NAME 和日志语句

最佳答案

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

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

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

所以我建议遇到此错误的任何人在整个工作区中搜索新的

关于java - NEW 是内部专有 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18125792/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com