vert-x3 / vertx-config

Vert.x Configuration Service
Apache License 2.0
54 stars 64 forks source link

Bug fix - hierarchical properties exception when having comments #73

Closed Zru-B closed 5 years ago

Zru-B commented 5 years ago

Hi,

I commited a bug fix that I found while trying to use the vertx-config hierachical properties file with comments and blank lines. While having such properties file, vertx-config throw an exception: io.vertx.config.impl.ConfigRetrieverImpl SEVERE: Error while scanning configuration java.lang.ArrayIndexOutOfBoundsException: 1

The flat properties file works fine with comments and blank line since it was implemented with the java's Properties object which already takes care of these.

The fix was to add a filter for blank lines and lines starting with either "#" or "!" (after triming spaces) inside the toJson method while using the streamer api.

Best Regards Shlomi Muzafi

Zru-B commented 5 years ago

Will it be good enough to add comments to the existing hierarchical.properties file and make sure that the HierarchicalPropertiesStoreProcessorTest unitest runs ok with no errors?

Zru-B commented 5 years ago

I've commited an update to the hierarchical.properties file (which is being used by HierarchicalPropertiesStoreProcessorTest unitest) to include comments and blank lines.

The test unit run without errors

cescoffier commented 5 years ago

Final check, did you sign the Eclipse CLA?

Zru-B commented 5 years ago

Yes I did

cescoffier commented 5 years ago

Thanks!