Skip to content

Commit cd7f95f

Browse files
authored
Merge branch 'main' into dependabot/gradle/plugins/repository-azure/com.azure-azure-storage-common-12.29.1
Signed-off-by: gaobinlong <gbinlong@amazon.com>
2 parents b63496d + 3cda341 commit cd7f95f

File tree

5 files changed

+29
-53
lines changed

5 files changed

+29
-53
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5252
- Bump `com.password4j:password4j` from 1.8.2 to 1.8.3 ([#18668](https://github.com/opensearch-project/OpenSearch/pull/18668))
5353
- Bump `com.azure:azure-core` from 1.55.3 to 1.55.5 ([#18691](https://github.com/opensearch-project/OpenSearch/pull/18691))
5454
- Bump `com.azure:azure-storage-common` from 12.29.0 to 12.29.1 ([#18742](https://github.com/opensearch-project/OpenSearch/pull/18742))
55+
- Bump `org.apache.commons:commons-lang3` from 3.17.0 to 3.18.0 ([#18745](https://github.com/opensearch-project/OpenSearch/pull/18745))
5556

5657
### Deprecated
5758

plugins/repository-hdfs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ dependencies {
7272
api "org.apache.commons:commons-compress:${versions.commonscompress}"
7373
api 'org.apache.commons:commons-configuration2:2.12.0'
7474
api "commons-io:commons-io:${versions.commonsio}"
75-
api 'org.apache.commons:commons-lang3:3.17.0'
75+
api 'org.apache.commons:commons-lang3:3.18.0'
7676
implementation 'com.google.re2j:re2j:1.8'
7777
api 'javax.servlet:servlet-api:2.5'
7878
api "org.slf4j:slf4j-api:${versions.slf4j}"

plugins/repository-hdfs/licenses/commons-lang3-3.17.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fb14946f0e39748a6571de0635acbe44e7885491

server/src/main/java/org/opensearch/common/lucene/Lucene.java

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -357,63 +357,38 @@ public static TopDocsAndMaxScore readTopDocs(StreamInput in) throws IOException
357357
public static FieldDoc readFieldDoc(StreamInput in) throws IOException {
358358
Comparable[] cFields = new Comparable[in.readVInt()];
359359
for (int j = 0; j < cFields.length; j++) {
360-
byte type = in.readByte();
361-
if (type == 0) {
362-
cFields[j] = null;
363-
} else if (type == 1) {
364-
cFields[j] = in.readString();
365-
} else if (type == 2) {
366-
cFields[j] = in.readInt();
367-
} else if (type == 3) {
368-
cFields[j] = in.readLong();
369-
} else if (type == 4) {
370-
cFields[j] = in.readFloat();
371-
} else if (type == 5) {
372-
cFields[j] = in.readDouble();
373-
} else if (type == 6) {
374-
cFields[j] = in.readByte();
375-
} else if (type == 7) {
376-
cFields[j] = in.readShort();
377-
} else if (type == 8) {
378-
cFields[j] = in.readBoolean();
379-
} else if (type == 9) {
380-
cFields[j] = in.readBytesRef();
381-
} else if (type == 10) {
382-
cFields[j] = new BigInteger(in.readString());
383-
} else {
384-
throw new IOException("Can't match type [" + type + "]");
385-
}
360+
cFields[j] = readTypedValue(in);
386361
}
387362
return new FieldDoc(in.readVInt(), in.readFloat(), cFields);
388363
}
389364

390365
public static Comparable readSortValue(StreamInput in) throws IOException {
366+
return readTypedValue(in);
367+
}
368+
369+
/**
370+
* Reads a typed value from the stream based on a type byte prefix.
371+
*
372+
* @param in the input stream
373+
* @return the deserialized Comparable value
374+
* @throws IOException if reading fails or type is unknown
375+
*/
376+
private static Comparable readTypedValue(StreamInput in) throws IOException {
391377
byte type = in.readByte();
392-
if (type == 0) {
393-
return null;
394-
} else if (type == 1) {
395-
return in.readString();
396-
} else if (type == 2) {
397-
return in.readInt();
398-
} else if (type == 3) {
399-
return in.readLong();
400-
} else if (type == 4) {
401-
return in.readFloat();
402-
} else if (type == 5) {
403-
return in.readDouble();
404-
} else if (type == 6) {
405-
return in.readByte();
406-
} else if (type == 7) {
407-
return in.readShort();
408-
} else if (type == 8) {
409-
return in.readBoolean();
410-
} else if (type == 9) {
411-
return in.readBytesRef();
412-
} else if (type == 10) {
413-
return new BigInteger(in.readString());
414-
} else {
415-
throw new IOException("Can't match type [" + type + "]");
416-
}
378+
return switch (type) {
379+
case 0 -> null;
380+
case 1 -> in.readString();
381+
case 2 -> in.readInt();
382+
case 3 -> in.readLong();
383+
case 4 -> in.readFloat();
384+
case 5 -> in.readDouble();
385+
case 6 -> in.readByte();
386+
case 7 -> in.readShort();
387+
case 8 -> in.readBoolean();
388+
case 9 -> in.readBytesRef();
389+
case 10 -> new BigInteger(in.readString());
390+
default -> throw new IOException("Can't match type [" + type + "]");
391+
};
417392
}
418393

419394
public static ScoreDoc readScoreDoc(StreamInput in) throws IOException {

0 commit comments

Comments
 (0)