Skip to content

Commit

Permalink
8282761: XPathFactoryImpl remove setProperty and getProperty methods
Browse files Browse the repository at this point in the history
Reviewed-by: clanger, yan
  • Loading branch information
GoeLin committed Mar 17, 2022
1 parent 47f29a3 commit c3ea7ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author Ramesh Mandava
*
* @LastModified: Nov 2021
* @LastModified: May 2021
*/
public class XPathFactoryImpl extends XPathFactory {

Expand Down Expand Up @@ -310,36 +310,4 @@ public void setXPathVariableResolver(XPathVariableResolver resolver) {

xPathVariableResolver = resolver;
}

public void setProperty(String name, String value) {
// property name cannot be null
if (name == null) {
String fmsg = XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_PROPERTY_NAME_NULL,
new Object[] {CLASS_NAME, value} );
throw new NullPointerException(fmsg);
}

// property name not recognized
String fmsg = XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_PROPERTY_UNKNOWN,
new Object[] {name, CLASS_NAME, value} );
throw new IllegalArgumentException(fmsg);
}

public String getProperty(String name) {
// property name cannot be null
if (name == null) {
String fmsg = XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_GETTING_NULL_PROPERTY,
new Object[] {CLASS_NAME} );
throw new NullPointerException(fmsg);
}

// unknown property
String fmsg = XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_GETTING_UNKNOWN_PROPERTY,
new Object[] {name, CLASS_NAME} );
throw new IllegalArgumentException(fmsg);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down Expand Up @@ -31,7 +31,7 @@
* Also you need to update the count of messages(MAX_CODE)or
* the count of warnings(MAX_WARNING) [ Information purpose only]
* @xsl.usage advanced
* @LastModified: Nov 2021
* @LastModified: May 2019
*/
public class XPATHErrorResources extends ListResourceBundle
{
Expand Down Expand Up @@ -322,10 +322,6 @@ public class XPATHErrorResources extends ListResourceBundle
public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
public static final String ER_PROPERTY_NAME_NULL = "ER_PROPERTY_NAME_NULL";
public static final String ER_PROPERTY_UNKNOWN = "ER_PROPERTY_UNKNOWN";
public static final String ER_GETTING_NULL_PROPERTY = "ER_GETTING_NULL_PROPERTY";
public static final String ER_GETTING_UNKNOWN_PROPERTY = "ER_GETTING_UNKNOWN_PROPERTY";
//END: Keys needed for exception messages of JAXP 1.3 XPath API implementation

public static final String WG_LOCALE_NAME_NOT_HANDLED =
Expand Down Expand Up @@ -840,26 +836,6 @@ public class XPATHErrorResources extends ListResourceBundle
{ ER_NULL_XPATH_VARIABLE_RESOLVER,
"Attempting to set a null XPathVariableResolver:{0}#setXPathVariableResolver(null)"},

/** Field ER_PROPERTY_NAME_NULL */

{ ER_PROPERTY_NAME_NULL,
"Trying to set a property with a null name: {0}#setProperty( null, {1})"},

/** Field ER_PROPERTY_UNKNOWN */

{ ER_PROPERTY_UNKNOWN,
"Trying to set the unknown property \"{0}\":{1}#setProperty({0},{2})"},

/** Field ER_GETTING_NULL_PROPERTY */

{ ER_GETTING_NULL_PROPERTY,
"Trying to get a property with a null name: {0}#getProperty(null)"},

/** Field ER_GETTING_NULL_PROPERTY */

{ ER_GETTING_UNKNOWN_PROPERTY,
"Trying to get the unknown property \"{0}\":{1}#getProperty({0})"},

//END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation

// Warnings...
Expand Down

1 comment on commit c3ea7ca

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.