aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-08 15:28:34 -0800
committerGravatar GitHub <noreply@github.com>2017-03-08 15:28:34 -0800
commitfa1788026cf7c7310f068dbee7fbf71958ec1290 (patch)
tree6816271fb61c32bd726248392c9293dcf401cb80
parent920af75d1c1709ab97b082dd06ef49c3399647b7 (diff)
parent24908e1b32ecf08ed8469ce83d0118fb3f3b403e (diff)
Merge pull request #2602 from GreatFruitOmsk/issue-2428
Method Builder#clone() has been changed to bypass Java 1.6 compiler issue.
-rw-r--r--java/core/src/main/java/com/google/protobuf/AbstractMessage.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/AbstractMessage.java b/java/core/src/main/java/com/google/protobuf/AbstractMessage.java
index 7639efcf..37180da8 100644
--- a/java/core/src/main/java/com/google/protobuf/AbstractMessage.java
+++ b/java/core/src/main/java/com/google/protobuf/AbstractMessage.java
@@ -328,8 +328,11 @@ public abstract class AbstractMessage
extends AbstractMessageLite.Builder
implements Message.Builder {
// The compiler produces an error if this is not declared explicitly.
+ // Method isn't abstract to bypass Java 1.6 compiler issue http://bugs.java.com/view_bug.do?bug_id=6908259
@Override
- public abstract BuilderType clone();
+ public BuilderType clone() {
+ throw new UnsupportedOperationException("clone() should be implemented in subclasses.");
+ }
/** TODO(jieluo): Clear it when all subclasses have implemented this method. */
@Override