Problem Description
The getter method for metadata properties in OSHDBJdbc currently returns null when a property is not present. This could lead to unexpected NullpointerExceptions when one does not know about this.
Expected Solution
If the method returns an Optional<String> it can/must be checked if a property was actually found by testing the return value accordingly.
Alternative Solutions
Just return an empty string ("") instead. This is not optimal, because one could not distinguish a situation where the actual value stored in the metadata table is an empty string. If a user doesn't care they can get this behaviour in the solution above by using returnedOptional.getOrDefault("").
Additional Context
see #419 (comment)
Problem Description
The getter method for metadata properties in
OSHDBJdbccurrently returnsnullwhen a property is not present. This could lead to unexpected NullpointerExceptions when one does not know about this.Expected Solution
If the method returns an
Optional<String>it can/must be checked if a property was actually found by testing the return value accordingly.Alternative Solutions
Just return an empty string (
"") instead. This is not optimal, because one could not distinguish a situation where the actual value stored in the metadata table is an empty string. If a user doesn't care they can get this behaviour in the solution above by usingreturnedOptional.getOrDefault("").Additional Context
see #419 (comment)