WSPrincipal.getCredential( )

この規則により、以下の非推奨のメソッドにフラグを立てます。

このメソッドは WebSphere Application Server バージョン 5.1

を使用する必要があります com.ibm.websphere.security.auth.WSSubject.getRunAsSubject() または com.ibm.websphere.security.auth.WSSubject.getCallerSubject() メソッドに置き換えた。

次の例は、自動修正によって レガシー WSPrincipal.getCredential( ) を推奨の WSSubject.getCallerSubject( ) :

com.ibm.websphere.security.cred.WSCredential クレデンシャル = null; を試すjavax.security.auth.Subject subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject(); if (subject!= null) {
        credential = subject.getPublicCredentials(WSCredential.class).iterator().next();
    } } catch (Exception e) { { e.printStackTrace() e.printStackTrace(); // 適切なロギングを考慮する。 } return credential;

このルールには、名前空間値を更新するための自動修正があります。 カスタム構成をアプリケーション・ビルド・ファイルにコピーして、フィックスの自動化を有効にします。

追加のクラス情報については、以下を参照してください。