此規則會偵測是否在 Java 檔中使用 WebLogic weblogic.transaction.Transaction 物件。 檢閱 WebSphere Application Server 說明文件中的 JTA 支援主題。
會偵測到下列情況:
欄位宣告(物件層次)
範例:private Transaction t ;
方法變數
範例:
private void doX(){
Transaction t;
}
強制轉型表示式
範例:Transaction t = (Transaction) someOtherObject;
如果將物件用作完整名稱(例如,weblogic.transaction.Transaction),則會偵測到該物件。
如果將物件用作簡稱(例如,Transaction),並且存在下列其中一個 import 陳述式時,也會偵測到該物件。
import weblogic.transaction.*;
或
import weblogic.transaction.Transaction;