You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/03/13 13:47:32 UTC

[GitHub] maskit closed pull request #1258: Fix CID 262329

maskit closed pull request #1258: Fix CID 262329
URL: https://github.com/apache/incubator-pulsar/pull/1258
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStream.java b/pulsar-common/src/main/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStream.java
index 600c60711..bf838d8b6 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStream.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStream.java
@@ -216,7 +216,7 @@ public boolean skipField(final int tag) throws IOException {
      */
     public void checkLastTagWas(final int value) throws InvalidProtocolBufferException {
         if (lastTag != value) {
-            new InvalidProtocolBufferException("Protocol message end-group tag did not match expected tag.");
+            throw new InvalidProtocolBufferException("Protocol message end-group tag did not match expected tag.");
         }
     }
 
diff --git a/pulsar-common/src/test/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStreamTest.java b/pulsar-common/src/test/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStreamTest.java
index 5c775bf84..ff1cbb756 100644
--- a/pulsar-common/src/test/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStreamTest.java
+++ b/pulsar-common/src/test/java/org/apache/pulsar/common/util/protobuf/ByteBufCodedInputStreamTest.java
@@ -46,8 +46,13 @@ public void testByteBufCondedInputStreamTest() throws IOException {
         assertFalse(inputStream.skipField(WireFormat.WIRETYPE_END_GROUP));
         inputStream = ByteBufCodedInputStream.get(Unpooled.wrappedBuffer("1000".getBytes()));
         assertTrue(inputStream.skipField(WireFormat.WIRETYPE_FIXED32));
-        assertTrue(inputStream.skipField(WireFormat.WIRETYPE_START_GROUP));
 
+        try {
+            inputStream.skipField(WireFormat.WIRETYPE_START_GROUP);
+            fail("Should not happend");
+        } catch (Exception e) {
+            // pass
+        }
         try {
             assertTrue(inputStream.skipField(-1));
             fail("Should not happend");


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services