{"action":"created","issue":{"url":"https://api.github.com/repos/google/protobuf/issues/4314","repository_url":"https://api.github.com/repos/google/protobuf","labels_url":"https://api.github.com/repos/google/protobuf/issues/4314/labels{/name}","comments_url":"https://api.github.com/repos/google/protobuf/issues/4314/comments","events_url":"https://api.github.com/repos/google/protobuf/issues/4314/events","html_url":"https://github.com/google/protobuf/issues/4314","id":297574192,"number":4314,"title":"Incompatibility between generated files with protoc 3.1.0 and runtime deps com.google.protobuf:protobuf-java:3.5.1","user":{"login":"bogdandrutu","id":1373887,"avatar_url":"https://avatars0.githubusercontent.com/u/1373887?v=4","gravatar_id":"","url":"https://api.github.com/users/bogdandrutu","html_url":"https://github.com/bogdandrutu","followers_url":"https://api.github.com/users/bogdandrutu/followers","following_url":"https://api.github.com/users/bogdandrutu/following{/other_user}","gists_url":"https://api.github.com/users/bogdandrutu/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdandrutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdandrutu/subscriptions","organizations_url":"https://api.github.com/users/bogdandrutu/orgs","repos_url":"https://api.github.com/users/bogdandrutu/repos","events_url":"https://api.github.com/users/bogdandrutu/events{/privacy}","received_events_url":"https://api.github.com/users/bogdandrutu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-15T19:48:58Z","updated_at":"2018-02-15T22:39:21Z","closed_at":null,"author_association":"NONE","body":"Here is a commit that shows the problem:\r\nhttps://github.com/bogdandrutu/cloud-trace-java/commit/ad047fc5123360d95043d111f41dcc5e4133f8bf\r\n\r\nThe proto file is generated using [protoc:3.1.0](https://github.com/bogdandrutu/cloud-trace-java/commit/ad047fc5123360d95043d111f41dcc5e4133f8bf#diff-26184927fe459b93c9b7934e14784b33R107) and the tests are run with [com.google.protobuf:protobuf-java:3.5.1](https://github.com/bogdandrutu/cloud-trace-java/commit/ad047fc5123360d95043d111f41dcc5e4133f8bf#diff-26184927fe459b93c9b7934e14784b33R60)\r\n\r\nThe error that I get:\r\nTests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!\r\ngetCurrent(com.google.cloud.trace.service.AppEngineSpanContextHandleTest)  Time elapsed: 0.02 sec  <<< ERROR!\r\njava.lang.UnsupportedOperationException\r\n\tat com.google.protos.cloud.trace.TraceId$TraceIdProto.dynamicMethod(TraceId.java:319)\r\n\tat com.google.protobuf.GeneratedMessageLite.dynamicMethod(GeneratedMessageLite.java:332)\r\n\tat com.google.protobuf.GeneratedMessageLite.isInitialized(GeneratedMessageLite.java:1458)\r\n\tat com.google.protobuf.GeneratedMessageLite.isInitialized(GeneratedMessageLite.java:254)\r\n\tat com.google.protobuf.GeneratedMessageLite.checkMessageInitialized(GeneratedMessageLite.java:1596)\r\n\tat com.google.protobuf.GeneratedMessageLite.parseFrom(GeneratedMessageLite.java:1677)\r\n\tat com.google.protos.cloud.trace.TraceId$TraceIdProto.parseFrom(TraceId.java:123)\r\n\tat com.google.cloud.trace.service.AppEngineSpanContextHandle.getSpanContext(AppEngineSpanContextHandle.java:60)\r\n\tat com.google.cloud.trace.service.AppEngineSpanContextHandle.getCurrentSpanContext(AppEngineSpanContextHandle.java:43)\r\n\tat com.google.cloud.trace.service.AppEngineSpanContextHandleTest.getCurrent(AppEngineSpanContextHandleTest.java:63)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:300)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)\r\n\tat org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)\r\n\tat org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)"},"comment":{"url":"https://api.github.com/repos/google/protobuf/issues/comments/366085784","html_url":"https://github.com/google/protobuf/issues/4314#issuecomment-366085784","issue_url":"https://api.github.com/repos/google/protobuf/issues/4314","id":366085784,"user":{"login":"xfxyjwf","id":8551050,"avatar_url":"https://avatars0.githubusercontent.com/u/8551050?v=4","gravatar_id":"","url":"https://api.github.com/users/xfxyjwf","html_url":"https://github.com/xfxyjwf","followers_url":"https://api.github.com/users/xfxyjwf/followers","following_url":"https://api.github.com/users/xfxyjwf/following{/other_user}","gists_url":"https://api.github.com/users/xfxyjwf/gists{/gist_id}","starred_url":"https://api.github.com/users/xfxyjwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xfxyjwf/subscriptions","organizations_url":"https://api.github.com/users/xfxyjwf/orgs","repos_url":"https://api.github.com/users/xfxyjwf/repos","events_url":"https://api.github.com/users/xfxyjwf/events{/privacy}","received_events_url":"https://api.github.com/users/xfxyjwf/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T22:39:21Z","updated_at":"2018-02-15T22:39:21Z","author_association":"MEMBER","body":"If you use non-lite version everywhere, we guarantee the generated code of older protoc will work with newer version of protobuf-java runtime. So no problem there.\r\n\r\nHowever, we no longer support 'optimize_for = LITE_RUNTIME' any more with protobuf-java so there is no guarantee of such compatibilities if you have 'optimize_for = LITE_RUNTIME' in your proto. And that's the exception you are seeing here.\r\n\r\nAnd yes, I agree that we should start to disallow 'optimize_for = LITE_RUNTIME' for Java so you will get a compile failure instead of runtime failure."}}
{"actor":{"display_login":"xfxyjwf"}}