此規則會標示下列已淘汰的方法:
CommandMgrInitializer 方法在 WebSphere Application Server 6.0 版中已淘汰,CommandMgr 方法在 7.0 版中已淘汰。 它們可能在將來的版本中移除。
對於這四個方法,請全部改用 CommandMgr.getCommandMgr(AdminClient)。
在原始檔掃描器中,快速修正程式會將已淘汰的方法變更為偏好的方法。 如果有 com.ibm.websphere.management.cmdframework.CommandMgr 類別的匯入項目,快速修正程式會在取代項目中使用簡式類別名稱 (CommandMgr)。 如果找不到匯入項目,就會使用完整名稱 (com.ibm.websphere.management.cmdframework.CommandMgr)。
範例:
|
import com.ibm.websphere.management.cmdframework.*;
public class MyClass { // some code CommandMgrInitializer.initializeLocalMode(); // some code } |
前述範例將變更成:
|
import com.ibm.websphere.management.cmdframework.*;
public class MyClass { // some code CommandMgr.getCommandMgr(); // some code } |
|
import com.ibm.websphere.management.cmdframework.CommandMgrInitializer;
public class MyClass { // some code com.ibm.websphere.management.cmdframework.CommandMgr.getCommandMgr(); // some code } |
如需類別的相關資訊,請參閱
完整 已淘汰的 API 清單位於說明文件中。