You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/03/20 13:19:27 UTC
(commons-jxpath) 03/08: Make the private NullPointer.id field final
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jxpath.git
commit c717c176f88becd9c6f905820d03aef8ee12d491
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Mar 20 08:38:20 2025 -0400
Make the private NullPointer.id field final
Make the private NullPointer.qname field final.
---
src/changes/changes.xml | 2 ++
.../org/apache/commons/jxpath/ri/model/beans/NullPointer.java | 9 ++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9ac5c3f..f1f4e9e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -129,6 +129,8 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate Parser.Parser().</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">JXPathException.JXPathException(Throwable) now remembers its Throwable cause argument.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Make the private DOMNodePointer.id field final.</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">Make the private NullPointer.id field final.</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">Make the private NullPointer.qname field final.</action>
<!-- ADD -->
<action issue="JXPATH-123" dev="mbenson" type="add">
XPath function "ends-with" is not implemented (although "starts-with" is).
diff --git a/src/main/java/org/apache/commons/jxpath/ri/model/beans/NullPointer.java b/src/main/java/org/apache/commons/jxpath/ri/model/beans/NullPointer.java
index 3adb05f..554d294 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/model/beans/NullPointer.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/model/beans/NullPointer.java
@@ -33,12 +33,12 @@ public class NullPointer extends PropertyOwnerPointer {
/**
* The name of this node
*/
- private QName name;
+ private final QName name;
/**
- * ID.
+ * Optional ID, may be null.
*/
- private String id;
+ private final String id;
/**
* Constructs a new NullPointer.
@@ -49,6 +49,7 @@ public class NullPointer extends PropertyOwnerPointer {
public NullPointer(final Locale locale, final String id) {
super(null, locale);
this.id = id;
+ this.name = null;
}
/**
@@ -60,6 +61,7 @@ public class NullPointer extends PropertyOwnerPointer {
public NullPointer(final NodePointer parent, final QName name) {
super(parent);
this.name = name;
+ this.id = null;
}
/**
@@ -71,6 +73,7 @@ public class NullPointer extends PropertyOwnerPointer {
public NullPointer(final QName name, final Locale locale) {
super(null, locale);
this.name = name;
+ this.id = null;
}
@Override