Unchecked cleanup notes
Jody Garnett edited this page Oct 16, 2020
·
4 revisions
This page contains notes about the unchecked cleanup work, a mix of observations and potential issues. Jira was not used to avoid creating yet another cemetery of unresolvable issues in it (as it has happened, pretty much regularly, for each large endeavour that tried to use Jira to track progress and TODOs).
- Converter implementations are rife of unchecked cast warnings. So far solved them by using
targetClass.cast(object)
, which solves the issue, but I'm worried it might present a visible runtime overhead down the road (in theory, it's really just a different way of doing a cast, but the JVM might not be specifically optimizing for it) - There is a WKTReader able to read ISO geometries, that has a bunch of unchecked casts I cannot solve in the "multi" geometry parsing. I have a feeling the API behind ISO geometries is badly designed... For the moment I've just suppressed the warnings, also considering the class is probably not in active use.
- An issue about
DataAccessFactory
/DataStoreFactorySpi
asking parameter values to be Serializable is being discussed on the list. -
DiffFeatureReader
is designed to work against genericFeature
, butDiff
, used by the reader, is coded specifically against SimpleFeature. Looks like a broken design case. In fact, only simple feature stores can do transactions, so probably the easiest approach is to accept reality and makeDiffFeatureReader
also work againstSimpleFeature
. GenerifyingDiff
is another possibility, made less simple than it seems byDiff.NULL
, a null object constant, that cannot be generic itself. For the time being, suppressed warnings inDiffFeatureReader
.
The use of json simple library ends up with JSONArray (extends ArrayList) and JSONObject (extends HashMap) without the use of generics:
@SupressWarning("unchecked")
ArrayList<Object> array = (ArrayList<Object>) jsonArray;
array.put(1L);