Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions hbase-shaded-protobuf/src/main/patches/HBASE-15789_V2.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/main/java/com/google/protobuf/ByteBufferWriter.java b/src/main/java/com/google/protobuf/ByteBufferWriter.java
index 3970b0ea5..571b0a975 100644
index e7d9eec8e..e17fefd39 100644
--- a/src/main/java/com/google/protobuf/ByteBufferWriter.java
+++ b/src/main/java/com/google/protobuf/ByteBufferWriter.java
@@ -111,7 +111,7 @@ final class ByteBufferWriter {
@@ -88,7 +88,7 @@ final class ByteBufferWriter {
}
}

Expand Down Expand Up @@ -359,13 +359,13 @@ index 000000000..320977290
+ }
+}
diff --git a/src/main/java/com/google/protobuf/ByteString.java b/src/main/java/com/google/protobuf/ByteString.java
index 2569d5dad..bebee3373 100644
index 8ba729c8e..62aae86ee 100644
--- a/src/main/java/com/google/protobuf/ByteString.java
+++ b/src/main/java/com/google/protobuf/ByteString.java
@@ -445,6 +445,13 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
@@ -422,6 +422,13 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
}
}

+ /**
+ * Wraps the given bytes into a {@code ByteString}. Intended for internal only usage.
+ */
Expand All @@ -377,14 +377,13 @@ index 2569d5dad..bebee3373 100644
* Wraps the given bytes into a {@code ByteString}. Intended for internal usage within the library
* to force a classload of ByteString before LiteralByteString.
diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java
index ae94ee887..ce1d05875 100644
index 224ced529..64c3efa37 100644
--- a/src/main/java/com/google/protobuf/CodedInputStream.java
+++ b/src/main/java/com/google/protobuf/CodedInputStream.java
@@ -200,6 +200,16 @@ public abstract class CodedInputStream {
throw InvalidProtocolBufferException.recursionLimitExceeded();
@@ -178,6 +178,15 @@ public abstract class CodedInputStream {
}
}
+

+ /** Create a new CodedInputStream wrapping the given {@link ByteInput}. */
+ public static CodedInputStream newInstance(ByteInput buf, boolean bufferIsImmutable) {
+ return new ByteInputDecoder(buf, bufferIsImmutable);
Expand All @@ -397,7 +396,7 @@ index ae94ee887..ce1d05875 100644
/** Disable construction/inheritance outside of this class. */
private CodedInputStream() {}

@@ -3965,4 +3975,652 @@ public abstract class CodedInputStream {
@@ -3957,4 +3966,652 @@ public abstract class CodedInputStream {
}
}
}
Expand Down Expand Up @@ -1051,10 +1050,10 @@ index ae94ee887..ce1d05875 100644
+ }
}
diff --git a/src/main/java/com/google/protobuf/Utf8.java b/src/main/java/com/google/protobuf/Utf8.java
index 7c6823d91..20afe8255 100644
index d52006754..92ed1f1f7 100644
--- a/src/main/java/com/google/protobuf/Utf8.java
+++ b/src/main/java/com/google/protobuf/Utf8.java
@@ -219,6 +219,16 @@ final class Utf8 {
@@ -196,6 +196,16 @@ final class Utf8 {
}
}

Expand All @@ -1071,7 +1070,7 @@ index 7c6823d91..20afe8255 100644
// These UTF-8 handling methods are copied from Guava's Utf8 class with a modification to throw
// a protocol buffer local exception. This exception is then caught in CodedOutputStream so it can
// fallback to more lenient behavior.
@@ -341,6 +351,24 @@ final class Utf8 {
@@ -318,6 +328,24 @@ final class Utf8 {
return processor.decodeUtf8(bytes, index, size);
}

Expand All @@ -1096,10 +1095,10 @@ index 7c6823d91..20afe8255 100644
/**
* Encodes the given characters to the target {@link ByteBuffer} using UTF-8 encoding.
*
@@ -717,6 +745,169 @@ final class Utf8 {
@@ -694,6 +722,169 @@ final class Utf8 {
return new String(resultArr, 0, resultPos);
}

+ public boolean isValidUtf8(ByteInput buffer, int index, int limit) {
+ return partialIsValidUtf8(COMPLETE, buffer, index, limit) == COMPLETE;
+ }
Expand Down
8 changes: 4 additions & 4 deletions hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java
index ce1d05875..5d74971ff 100644
index 64c3efa37..a5455e7f5 100644
--- a/src/main/java/com/google/protobuf/CodedInputStream.java
+++ b/src/main/java/com/google/protobuf/CodedInputStream.java
@@ -202,11 +202,7 @@ public abstract class CodedInputStream {
@@ -179,11 +179,7 @@ public abstract class CodedInputStream {
}

/** Create a new CodedInputStream wrapping the given {@link ByteInput}. */
Expand All @@ -16,10 +16,10 @@ index ce1d05875..5d74971ff 100644
}

diff --git a/src/main/java/com/google/protobuf/UnsafeByteOperations.java b/src/main/java/com/google/protobuf/UnsafeByteOperations.java
index 164010e43..8b3857069 100644
index 06121780f..3afb65965 100644
--- a/src/main/java/com/google/protobuf/UnsafeByteOperations.java
+++ b/src/main/java/com/google/protobuf/UnsafeByteOperations.java
@@ -98,6 +98,17 @@ public final class UnsafeByteOperations {
@@ -75,6 +75,17 @@ public final class UnsafeByteOperations {
return ByteString.wrap(buffer);
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<maven.min.version>3.3.3</maven.min.version>
<os.maven.version>1.7.1</os.maven.version>
<rename.offset>org.apache.hbase.thirdparty</rename.offset>
<protobuf.version>3.25.2</protobuf.version>
<protobuf.version>4.26.1</protobuf.version>
<netty.version>4.1.108.Final</netty.version>
<netty.tcnative.version>2.0.61.Final</netty.tcnative.version>
<guava.version>33.0.0-jre</guava.version>
Expand Down