mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8138721: ElementTraversal: javadoc warning; also, hasFeature shall return true
Reviewed-by: lancea, dfuchs
This commit is contained in:
parent
df9e1bc8f7
commit
6b8fd86fa1
4 changed files with 41 additions and 16 deletions
|
@ -101,7 +101,7 @@ public class CoreDOMImplementationImpl
|
|||
* This is interpreted as "Version of the DOM API supported for the
|
||||
* specified Feature", and in Level 1 should be "1.0"
|
||||
*
|
||||
* @return true iff this implementation is compatable with the specified
|
||||
* @return true if this implementation is compatible with the specified
|
||||
* feature and version.
|
||||
*/
|
||||
public boolean hasFeature(String feature, String version) {
|
||||
|
@ -111,19 +111,22 @@ public class CoreDOMImplementationImpl
|
|||
if (feature.startsWith("+")) {
|
||||
feature = feature.substring(1);
|
||||
}
|
||||
return (
|
||||
feature.equalsIgnoreCase("Core")
|
||||
&& (anyVersion
|
||||
|| version.equals("1.0")
|
||||
|| version.equals("2.0")
|
||||
|| version.equals("3.0")))
|
||||
|| (feature.equalsIgnoreCase("XML")
|
||||
&& (anyVersion
|
||||
|| version.equals("1.0")
|
||||
|| version.equals("2.0")
|
||||
|| version.equals("3.0")))
|
||||
|| (feature.equalsIgnoreCase("LS")
|
||||
&& (anyVersion || version.equals("3.0")));
|
||||
return (feature.equalsIgnoreCase("Core")
|
||||
&& (anyVersion
|
||||
|| version.equals("1.0")
|
||||
|| version.equals("2.0")
|
||||
|| version.equals("3.0")))
|
||||
|| (feature.equalsIgnoreCase("XML")
|
||||
&& (anyVersion
|
||||
|| version.equals("1.0")
|
||||
|| version.equals("2.0")
|
||||
|| version.equals("3.0")))
|
||||
|| (feature.equalsIgnoreCase("LS")
|
||||
&& (anyVersion
|
||||
|| version.equals("3.0")))
|
||||
|| (feature.equalsIgnoreCase("ElementTraversal")
|
||||
&& (anyVersion
|
||||
|| version.equals("1.0")));
|
||||
} // hasFeature(String,String):boolean
|
||||
|
||||
|
||||
|
|
|
@ -83,6 +83,9 @@ public class DOMImplementationImpl extends CoreDOMImplementationImpl
|
|||
* specified feature and version.
|
||||
*/
|
||||
public boolean hasFeature(String feature, String version) {
|
||||
if (feature == null || feature.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean result = super.hasFeature(feature, version);
|
||||
if (!result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue