From ab38ef001e2cccfd3bc6d739695aa6e725dc36d2 Mon Sep 17 00:00:00 2001
From: Ronald Ngounou <74538524+ronaldngounou@users.noreply.github.com>
Date: Fri, 24 Jan 2025 00:04:43 -0500
Subject: [PATCH 1/2] Suggested a solution for TODO: "sort empty types".
Contributes to issue141.
---
.../oracle/nosql/driver/values/NullValue.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/driver/src/main/java/oracle/nosql/driver/values/NullValue.java b/driver/src/main/java/oracle/nosql/driver/values/NullValue.java
index 413bc592..66bbad45 100644
--- a/driver/src/main/java/oracle/nosql/driver/values/NullValue.java
+++ b/driver/src/main/java/oracle/nosql/driver/values/NullValue.java
@@ -34,15 +34,29 @@ public static NullValue getInstance() {
return INSTANCE;
}
+ private boolean isEmptyType(FieldValue value){
+ return value instanceof EmptyValue ||
+ value instanceof ArrayValue ||
+ value instanceof BinaryValue ||
+ value instanceof BooleanValue ||
+ value instanceof IntegerValue ||
+ value instanceof JsonNullValue ||
+ value instanceof LongValue ||
+ value instanceof MapValue;
+ }
+
@Override
public int compareTo(FieldValue other) {
if (other instanceof NullValue) {
return 0;
}
- /* TODO: sort empty types? */
+ if (isEmptyType(other)){
+ return 0;
+ }
return -1;
}
+
@Override
public String getString() {
return toJson(null);
From 5128b72d62f1f99711f50e9ff5230ccd0cdc7978 Mon Sep 17 00:00:00 2001
From: Ronald Ngounou <74538524+ronaldngounou@users.noreply.github.com>
Date: Fri, 24 Jan 2025 00:07:49 -0500
Subject: [PATCH 2/2] include .idea file in commit
---
.idea/.gitignore | 3 +++
.idea/compiler.xml | 19 +++++++++++++++++++
.idea/encodings.xml | 9 +++++++++
.idea/jarRepositories.xml | 20 ++++++++++++++++++++
.idea/misc.xml | 12 ++++++++++++
.idea/vcs.xml | 6 ++++++
6 files changed, 69 insertions(+)
create mode 100644 .idea/.gitignore
create mode 100644 .idea/compiler.xml
create mode 100644 .idea/encodings.xml
create mode 100644 .idea/jarRepositories.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/vcs.xml
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 00000000..19a9b8d1
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 00000000..6e7e3720
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 00000000..712ab9d9
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..e24323ed
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file