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 2019/10/23 00:02:18 UTC
[GitHub] [pulsar] merlimat opened a new pull request #5445: Fixed
StringSchema static initialization
merlimat opened a new pull request #5445: Fixed StringSchema static initialization
URL: https://github.com/apache/pulsar/pull/5445
### Motivation
Java doesn't guarantee the initialization order of the static fields of a class. Depending on the JVM version and race conditions, the StringSchema could be initialized with a null `DEFAULT_SCHEMA_INFO`.
Eg:
```
-------------------------------------------------------------------------------
Tests run: 6, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 1.444 s <<< FAILURE! - in org.apache.pulsar.client.impl.schema.SchemaInfoTest
testSchemaInfoToString(org.apache.pulsar.client.impl.schema.SchemaInfoTest) Time elapsed: 0.03 s <<< FAILURE!
java.lang.NullPointerException
at org.apache.pulsar.client.impl.schema.SchemaInfoTest.testSchemaInfoToString(SchemaInfoTest.java:276)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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