TypeConvert violates its own rules, need a major cleanup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TestPlan |
Confirmed
|
Medium
|
Unassigned |
Bug Description
TypeConvert has many conversions that don't satisfy it's rules. Furthermore, the rules in some case would prevent some common conversion (like asOutputStream) from even existing.
Changing the behaviour here is quite risky as many things rely on this. Rather the entire class should just be marked as deprecated and a new cleaner class should take its place.
There are a few different types of conversion:
1. Syntactic : the syntax or in-memory form of the underlying value is changed but it retains the same semantic value. These must be reversible without change in semantic meaning. A common case is converting from Integers to Strings and back.
2. Semantic Resolution : the underlying value is converted to a new type which may add additional semantic value. A common situation is where a relative path can be converted to absolute, conversion back can't yield the relative path anymore.
3. Operational : the underlying value is converted to a usable instance of a new type. Common case is to get an outputStream from an object. Reverse conversion is not possible in practice (though might be in theory).
4. Translation : the underlying value is converted to a new value by means of parsing or other translation which may discard certain information. Reverse translation may not be possible, or can well yield a different semantic meaning.
With the new class all itnernal TestPlan references to TypeConvert should be removed and TypeConvert left as depcrated.