Search:

Type: Posts; User: cyberion

Search: Search took 0.18 seconds.

  1. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  2. Re: Generics & 'Type Erasure': disingenuous documentation?

    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.
    ...
  3. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  4. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  5. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  6. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  7. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  8. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  9. Re: Generics & 'Type Erasure': disingenuous documentation?

    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)...
  10. Re: Generics & 'Type Erasure': disingenuous documentation?

    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.
  11. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  12. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  13. Re: Generics & 'Type Erasure': disingenuous documentation?

    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...
  14. Generics & 'Type Erasure': disingenuous documentation?

    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...
Results 1 to 14 of 16