Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #4638

Re: Java generics and type erasure

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Java generics and type erasure
Date 2011-05-27 01:27 -0400
Organization albasani.net
Message-ID <irncmt$k84$1@news.albasani.net> (permalink)
References (12 earlier) <4dde10b0$0$67777$c30e37c6@exi-reader.telstra.net> <irlega$3kp$1@news.albasani.net> <4ddf0617$0$67777$c30e37c6@exi-reader.telstra.net> <irn1e0$gtb$1@news.albasani.net> <4ddf14c8$0$67785$c30e37c6@exi-reader.telstra.net>

Show all headers | View raw


On 05/26/2011 11:04 PM, Esmond Pitt wrote:
> On 27/05/2011 12:15 PM, Lew wrote:
>> Generics make a difference at compile time. They don't make a difference
>> at run time.
>
> Correct.
>
>> Then I can ignore what is and isn't in the bytecode.
>
> Unless you are asserting, and I quote, that 'it really does happen at
> runtime'. If there is no bytecode that executes that action, it really doesn't
> happen at runtime.

What I'm asserting is that there are no generics at runtime, and that there 
are at compile time, so the state of things having been erased already happens 
at runtime and the state of things not having yet been erased happens at 
compile time.  It follows from this that the erasure itself happens between 
compile time and runtime, i.e., during the process of compilation as you and 
Ian said.

The meaning of the assertion you cite was that the generics information that 
is present in the bytecode is ignored at runtime, as you yourself said, so 
that's the "it" that happens at runtime.  My statement thereof was far from 
clear.  I should have indicated that then.

I am most emphatically not saying that it is not compilation that performs the 
erasure.  As I stated upthread, my perspective has to do with when generics 
are relevant, not when they cease to be.  They are relevant at compilation; 
they are not relevant at runtime.  It is in that sense that I think of erasure 
as being a runtime phenomenon.  I am more interested in the state of having 
been erased vs. not having been erased than in the brief moment during which 
the erasure happens.  Pfft.

So generics are a compile-time phenomenon; the condition of them having been 
erased is a runtime phenomenon.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Java generics and type erasure Marcin Pietraszek <m.pietraszek@gmail.com> - 2011-05-23 13:18 -0700
  Re: Java generics and type erasure "John B. Matthews" <nospam@nospam.invalid> - 2011-05-23 22:54 -0400
    Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-24 01:45 -0400
      Re: Java generics and type erasure Marcin Pietraszek <m.pietraszek@gmail.com> - 2011-05-24 12:39 -0700
      Re: Java generics and type erasure Ian Shef <invalid@avoiding.spam> - 2011-05-24 20:04 +0000
        Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-24 17:06 -0400
          Re: Java generics and type erasure Ian Shef <invalid@avoiding.spam> - 2011-05-24 23:05 +0000
            Re: Java generics and type erasure Susan Calvin <s.calvin@usr.invalid> - 2011-05-25 00:13 +0000
              Re: Java generics and type erasure Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-05-26 10:18 +1200
                Re: Java generics and type erasure Susan Calvin <s.calvin@usr.invalid> - 2011-05-26 01:12 +0000
                Re: Java generics and type erasure Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-05-26 13:59 +1200
                Re: Java generics and type erasure Susan Calvin <s.calvin@usr.invalid> - 2011-05-26 04:18 +0000
                Re: Java generics and type erasure Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-05-26 18:48 +1200
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-26 18:34 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-26 07:45 -0400
                Re: Java generics and type erasure "John B. Matthews" <nospam@nospam.invalid> - 2011-05-26 15:25 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-27 12:01 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-26 22:15 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-27 13:04 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-27 01:27 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-27 18:07 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-27 10:18 -0400
                Re: Java generics and type erasure Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-05-27 17:03 +0000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-27 13:27 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-30 15:19 +1000
                Re: Java generics and type erasure Tom McGlynn <taqmcg@gmail.com> - 2011-05-26 19:53 -0700
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-27 01:30 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-27 18:09 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-27 10:22 -0400
                Re: Java generics and type erasure Esmond Pitt <esmond.pitt@bigpond.com> - 2011-05-30 15:23 +1000
                Re: Java generics and type erasure Lew <noone@lewscanon.com> - 2011-05-30 02:35 -0400

csiph-web