OpenHFT / Chronicle-Values

http://chronicle.software
Other
104 stars 37 forks source link

Values.newHeapInstance throws NPE if value interface is in default package #6

Closed AlexBischof closed 8 years ago

AlexBischof commented 8 years ago

Propably a minor issue ;),

and i only stumbled upon it because i needed a quick and dirty example, but if a value interface like PostalCodeRange is part of the default package then the following stacktrace appears

Exception in thread "main" java.lang.NullPointerException
    at net.openhft.chronicle.values.ValueModel.createClass(ValueModel.java:340)
    at net.openhft.chronicle.values.ValueModel.createHeapClass(ValueModel.java:326)
    at net.openhft.chronicle.values.ValueModel.heapClass(ValueModel.java:316)
    at net.openhft.chronicle.values.Values.heapClassFor(Values.java:67)
    at net.openhft.chronicle.values.Values.newHeapInstance(Values.java:36)
...snip...
leventov commented 8 years ago

Thanks for the spot. As far as I remember this is a very long-standing issue, dating back to Java-Lang times. As it is anyway a bad practice to place anything in the default package, and it should never be a big deal to create a one-off package like tests, I'm not going to fix this. I've added a clarification note in the README though.