diff --git a/.gitignore b/.gitignore index 9af20ec..8f1e942 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ **/target **/dependency-reduced-pom.xml -hbase-shaded-protobuf/src/main/ +hbase-shaded-protobuf/src/main/java +hbase-shaded-protobuf/src/main/resources .project .settings .classpath diff --git a/README.md b/README.md index 8352d2e..e070c1f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ rather than to a dir under target because the jar plugin wants src here (its hard to convince it otherwise). We also apply some patches. Current set are: ``` -HBASE-15789_V3.patch +HBASE-15789_V4.patch HBASE-17087.patch HBASE-17239.patch ``` diff --git a/hbase-shaded-protobuf/src/main/patches/HBASE-15789_V3.patch b/hbase-shaded-protobuf/src/main/patches/HBASE-15789_V4.patch similarity index 98% rename from hbase-shaded-protobuf/src/main/patches/HBASE-15789_V3.patch rename to hbase-shaded-protobuf/src/main/patches/HBASE-15789_V4.patch index 6f9fd05..c02bbb8 100644 --- a/hbase-shaded-protobuf/src/main/patches/HBASE-15789_V3.patch +++ b/hbase-shaded-protobuf/src/main/patches/HBASE-15789_V4.patch @@ -359,10 +359,10 @@ index 000000000..320977290 + } +} diff --git a/src/main/java/com/google/protobuf/ByteString.java b/src/main/java/com/google/protobuf/ByteString.java -index 7b2455f12..f906a4774 100644 +index 558d5a6ab..28795acc2 100644 --- a/src/main/java/com/google/protobuf/ByteString.java +++ b/src/main/java/com/google/protobuf/ByteString.java -@@ -430,6 +430,13 @@ public abstract class ByteString implements Iterable, Serializable { +@@ -429,6 +429,13 @@ public abstract class ByteString implements Iterable, Serializable { return new NioByteString(buffer); } @@ -383,13 +383,13 @@ index 7b2455f12..f906a4774 100644 - - private LeafByteString() {} } - + /** diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java -index 81da41778..80fd9153c 100644 +index fbdabf225..cd6f80779 100644 --- a/src/main/java/com/google/protobuf/CodedInputStream.java +++ b/src/main/java/com/google/protobuf/CodedInputStream.java -@@ -178,6 +178,15 @@ public abstract class CodedInputStream { +@@ -191,6 +191,15 @@ public abstract class CodedInputStream { } } @@ -404,8 +404,8 @@ index 81da41778..80fd9153c 100644 + /** Disable construction/inheritance outside of this class. */ private CodedInputStream() {} - -@@ -3970,4 +3979,652 @@ public abstract class CodedInputStream { + +@@ -3943,4 +3952,652 @@ public abstract class CodedInputStream { } } } @@ -643,25 +643,25 @@ index 81da41778..80fd9153c 100644 + @Override + public void readGroup(int fieldNumber, MessageLite.Builder builder, + ExtensionRegistryLite extensionRegistry) throws IOException { -+ if (recursionDepth >= recursionLimit) { ++ if (messageDepth + groupDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } -+ ++recursionDepth; ++ ++groupDepth; + builder.mergeFrom(this, extensionRegistry); + checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); -+ --recursionDepth; ++ --groupDepth; + } + + @Override + public T readGroup(int fieldNumber, Parser parser, + ExtensionRegistryLite extensionRegistry) throws IOException { -+ if (recursionDepth >= recursionLimit) { ++ if (messageDepth + groupDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } -+ ++recursionDepth; ++ ++groupDepth; + T result = parser.parsePartialFrom(this, extensionRegistry); + checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); -+ --recursionDepth; ++ --groupDepth; + return result; + } + @@ -675,14 +675,14 @@ index 81da41778..80fd9153c 100644 + public void readMessage(MessageLite.Builder builder, ExtensionRegistryLite extensionRegistry) + throws IOException { + final int length = readRawVarint32(); -+ if (recursionDepth >= recursionLimit) { ++ if (messageDepth + groupDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + final int oldLimit = pushLimit(length); -+ ++recursionDepth; ++ ++messageDepth; + builder.mergeFrom(this, extensionRegistry); + checkLastTagWas(0); -+ --recursionDepth; ++ --messageDepth; + popLimit(oldLimit); + } + @@ -690,14 +690,14 @@ index 81da41778..80fd9153c 100644 + public T readMessage(Parser parser, + ExtensionRegistryLite extensionRegistry) throws IOException { + int length = readRawVarint32(); -+ if (recursionDepth >= recursionLimit) { ++ if (messageDepth + groupDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + final int oldLimit = pushLimit(length); -+ ++recursionDepth; ++ ++messageDepth; + T result = parser.parsePartialFrom(this, extensionRegistry); + checkLastTagWas(0); -+ --recursionDepth; ++ --messageDepth; + popLimit(oldLimit); + return result; + } @@ -1065,7 +1065,7 @@ index d52006754..92ed1f1f7 100644 @@ -196,6 +196,16 @@ final class Utf8 { } } - + + private static int incompleteStateFor(ByteInput bytes, int index, int limit) { + int byte1 = bytes.read(index - 1); + switch (limit - index) { @@ -1082,7 +1082,7 @@ index d52006754..92ed1f1f7 100644 @@ -318,6 +328,24 @@ final class Utf8 { return processor.decodeUtf8(bytes, index, size); } - + + /** + * Determines if the given {@link ByteInput} is a valid UTF-8 string. + * diff --git a/hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch b/hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch index fc2a172..19bb9eb 100644 --- a/hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch +++ b/hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch @@ -1,10 +1,10 @@ diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java -index 80fd9153c..11de874dd 100644 +index cd6f80779..3c6d8e878 100644 --- a/src/main/java/com/google/protobuf/CodedInputStream.java +++ b/src/main/java/com/google/protobuf/CodedInputStream.java -@@ -179,11 +179,7 @@ public abstract class CodedInputStream { +@@ -192,11 +192,7 @@ 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); @@ -14,7 +14,7 @@ index 80fd9153c..11de874dd 100644 + static CodedInputStream newInstance(ByteInput buf, int off, int len, boolean bufferIsImmutable) { return new ByteInputDecoder(buf, off, len, bufferIsImmutable); } - + diff --git a/src/main/java/com/google/protobuf/UnsafeByteOperations.java b/src/main/java/com/google/protobuf/UnsafeByteOperations.java index 15c1da969..54d2f975a 100644 --- a/src/main/java/com/google/protobuf/UnsafeByteOperations.java @@ -22,7 +22,7 @@ index 15c1da969..54d2f975a 100644 @@ -74,6 +74,17 @@ public final class UnsafeByteOperations { return ByteString.wrap(buffer); } - + + /** + * An unsafe operation that returns a {@link ByteString} that is backed by the provided buffer. + * @param buffer the ByteInput buffer to be wrapped diff --git a/pom.xml b/pom.xml index eba66ea..80dbc37 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ 3.3.3 1.7.1 org.apache.hbase.thirdparty - 4.29.2 + 4.30.2 4.1.121.Final 2.0.71.Final 33.4.8-jre