Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4391

Re: Sharing ListSelection

From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: Sharing ListSelection
Message-ID <Da6dnaXMo6vSCGfVnZ2dnUVZ_r-dnZ2d@comcast.com> (permalink)
Newsgroups comp.lang.java.gui
References <nospam-DD2B5B.21352418102008@nntp.motzarella.org>
Date 2011-04-27 15:50 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Lew wrote:
>> nit:  the second initialization to 'false' is redundant, as 'false' 
>> is the default value.

John B. Matthews wrote:
> Correct and interesting. I sometimes indulge in gratuitous 
> initialization to signify that the code relies on that initial value 
> (and no other). By analogy, these expressions all evaluate to 10

While it is a nit, it is interesting to me that the compiler and runtime are 
actually forbidden to remove the extra initialization.

JLS 12.5,
<http://java.sun.com/docs/books/jls/third_edition/html/execution.html#12.5>
Just after memory is allocated for the instance,
> all the instance variables in the new object, including those declared in 
> superclasses, are initialized to their default values (-o4.12.5). 
then, initialization procedure step 4 is to
> Execute the instance initializers and instance variable initializers 
> for this class, ... (In some early implementations, the compiler 
> incorrectly omitted the code to initialize a field if the field 
> initializer expression was a constant expression whose value was 
> equal to the default initialization value for its type.) 

-- 
Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

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


Thread

Sharing ListSelectionMode "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
  Re: Sharing ListSelection "Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
    Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
      Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
        Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
          Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
            Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
              Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
                Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
            Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000

csiph-web