I think you are still looking at things in isolation and trying to separate one issue from the other, when they are joined at the hip.
We have already seen a SIMPLE example of the problem from the...
Type: Posts; User: cyberion
I think you are still looking at things in isolation and trying to separate one issue from the other, when they are joined at the hip.
We have already seen a SIMPLE example of the problem from the...
No. The "nonsense" suggestion is entirely your own. Nowhere have I suggested flag all casts. If a cast fails at runtime, you know exactly where to look in the source code because it will tell you.
...
I know it has been there since day 1. Object is at the top of the reference type hierarchy and can be assigned any reference type.
But, when you evolve a language, there is impact. You can't just...
Huh? Heap corruption has nothing to do with type erasure??? ***scratches head***
I am not conflating the issues. I am looking at them as a whole. You are looking at the assignment in isolation. Of...
Yes it would. The documentation states that the assignment introduces possible heap pollution. If you classes are stamped with their type at runtime, their wouldn't be any heap pollution. It would...
Well that is your opinion and I think it sidesteps the issue. The documentation says that it can lead to heap pollution and you are saying it doesn't need checking.
And as for what you think it...
You are right. It does not give an unchecked warning. Question is, shouldn't it?
I find this ambiguous..
So we have a "valid" statement which can potentially introduce heap pollution. What...
Heap pollution is a result of the implemented solution and not the requirement.
The documentation fails to mention that type erasure is a compromise that is more than just ensuring backward...
But c) is not a consequence of a) and b). Nor is type erasure the only solution.
Throwing a runtime exception at the point of heap pollution (which requires runtime generic type information)...
Then that is what the documentation should say ;-)
It shouldn't obfuscate the "weakness" with excuses about backward compatibility. Backward compatibility does not force type erasure.
But generics are not a "compiler issue". They've only implemented it as compiler issue and worded the documentation to make it sound OK.
I do not believe it is correct for the runtime to place...
My point about heap pollution is this. If a non-compatible type parameter is used for a generic type through being aliased with a raw type, the runtime allows heap pollution. The runtime will put the...
thank you very much :)
The presence of the cast adds weight to the argument that the compiler generates the same code as it does for a raw type. I just don't know why this isn't being stated...
Java 5 and onwards allows type variables and parametrized types to be used in declarations. 'Type Erasure' is a grandiose term describing a "process" whereby the compiler eliminates all references to...