Skip to content

Commit fd8aeba

Browse files
committed
[refactor] Use new ByteConversion APIs
1 parent f35b408 commit fd8aeba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

extensions/indexes/lucene/src/main/java/org/exist/indexing/lucene/LuceneUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static byte[] createId(final NodeId nodeId) {
7272

7373
public static NodeId readNodeId(final int doc, final BinaryDocValues nodeIdValues, final BrokerPool pool) {
7474
final BytesRef ref = nodeIdValues.get(doc);
75-
final int units = ByteConversion.byteToShort(ref.bytes, ref.offset);
75+
final int units = ByteConversion.byteToShortH(ref.bytes, ref.offset);
7676
return pool.getNodeFactory().createFromData(units, ref.bytes, ref.offset + 2);
7777
}
7878

extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexWorker.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ private void write() {
468468
// store the node id
469469
int nodeIdLen = pending.getNodeId().size();
470470
byte[] data = new byte[nodeIdLen + 2];
471-
ByteConversion.shortToByte((short) pending.getNodeId().units(), data, 0);
471+
ByteConversion.shortToByteH((short) pending.getNodeId().units(), data, 0);
472472
pending.getNodeId().serialize(data, 2);
473473
fNodeId.setBytesValue(data);
474474
doc.add(fNodeId);
@@ -633,8 +633,8 @@ public void collect(int doc) throws IOException {
633633
}
634634
final BytesRef ref = this.nodeIdValues.get(doc);
635635

636-
int units = ByteConversion.byteToShort(ref.bytes, ref.offset);
637-
NodeId nodeId = index.getBrokerPool().getNodeFactory().createFromData(units, ref.bytes, ref.offset + 2);
636+
final int units = ByteConversion.byteToShortH(ref.bytes, ref.offset);
637+
final NodeId nodeId = index.getBrokerPool().getNodeFactory().createFromData(units, ref.bytes, ref.offset + 2);
638638

639639
// if a context set is specified, we can directly check if the
640640
// matching node is a descendant of one of the nodes
@@ -1019,7 +1019,7 @@ private void scan(DocumentSet docs, NodeSet nodes, String start, String end, lon
10191019
NodeId nodeId = null;
10201020
if (nodes != null) {
10211021
final BytesRef nodeIdRef = nodeIdValues.get(docsEnum.docID());
1022-
int units = ByteConversion.byteToShort(nodeIdRef.bytes, nodeIdRef.offset);
1022+
final int units = ByteConversion.byteToShortH(nodeIdRef.bytes, nodeIdRef.offset);
10231023
nodeId = index.getBrokerPool().getNodeFactory().createFromData(units, nodeIdRef.bytes, nodeIdRef.offset + 2);
10241024
}
10251025
if (nodeId == null || nodes.get(storedDocument, nodeId) != null) {

0 commit comments

Comments
 (0)