この規則は、XML の構文解析で WebLogic setAttribute および getAttribute 属性が使用されている場合にそれを検出します。 この規則は、Java コードを検出します。別の規則は、WebLogic weblogic.servlet.XMLParsingHelper が使用されている場合にそれを検出します。 これにより、以下のフィーチャーが使用可能になります。
例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", someObject)
例:
String handler = "org.xml.sax.helpers.DefaultHandler";
request.setAttribute(handler, someObject);
例: Document myDocument = request.getAttribute("org.w3c.dom.Document")
例:
String handler = "org.w3c.dom.Document";
Document myDoc = request.getAttribute(handler);
例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", myHandler);
request.getAttribute("org.w3c.dom.Document");
クイック・フィックスが前述の行に適用されると、それらの行は削除されます。
注: オブジェクト myHandler がコード内で後に使用される場合は、別の方法で初期化されることを確認します。
例:
Document myDocument = request.getAttribute("org.w3c.dom.Document");
クイック・フィックスが適用されると、前述のコードは次のように変更されます。
Document myDocument;
注: オブジェクト myDocument がコード内で後に使用される場合は、別の方法で初期化されることを確認します。