[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-jdk8-dev
Subject:    =?utf-8?B?UmU6IEZlYXR1cmUgcmVxdWVzdDogYWxpYXNpbmcgY2xhc3NlcyBhdCBpbXBvcnQ=?=
From:       neugens.limasoftware () gmail ! com (=?utf-8?B?bmV1Z2Vucy5saW1hc29mdHdhcmVAZ21haWwuY2
Date:       2011-07-15 0:17:53
Message-ID: 4e1f873f.4ccfe30a.3517.2d16 () mx ! google ! com
[Download RAW message or body]

I king like this idea too, although the situations where this problem really occurs \
are probably limited and can be addressed by some simple factoring of the code, I \
think this could be a nice addition.

Said that, I also see a high risk as drawback, in that this could provide a \
maintainance problem, making the code less readable and more difficult to follow \
without a proper IDE.

Mario
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


----- Reply message -----
Da: "Ivan Krylov" <Ivan.Krylov at oracle.com>
Data: ven, lug 15, 2011 01:51
Oggetto: Feature request: aliasing classes at import
A: <jdk8-dev at openjdk.java.net>

I would not limit this than just to class names but rather expand idea 
of selective alliasing to methods and fields.

just my 0.02

On 7/10/11 6:02 AM, Behrang Saeedzadeh wrote:
> Hi,
> 
> For a long time it was not very common to encounter a situation in
> which two classes with the same name but in different packages had to
> be imported and used frequently in the same file. In fact till
> recently the only case I used to encounter every now and then was when
> I had to import java.util.Date and java.sql.Date in the same class.
> 
> However recently it's more likely to encounter a situation like this.
> Some libraries have annotations and classes that use the same name.
> Also some APIs such as Eclipse EMF use class names (e.g. Package) that
> clash with Java class names and there are cases that both of them
> should be used frequently and using FQ names makes the source code
> very verbose and ugly.
> 
> It would be nice to be able to import a class under a desired name at
> import time, e.g.:
> 
> import java.util.Date : UDate;
> import java.sql.Date : SDate;
> 
> Some other languages support this feature and I think it's a small
> coin-scale feature that would be nice to be added to Java. What do you
> think?
> 
> Cheers,
> Behrang Saeedzadeh
> http://www.behrang.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic