geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gareth Bryan" <garethbr...@fastmail.fm>
Subject Re: Coding standards: import thing.* or thing.Class?
Date Wed, 13 Aug 2003 16:52:18 GMT
Definately a +1 for more specific imports.

In other projects I have worked on, we defined a number of classes
required to be imported from the same package before "import blah.*" was
considered acceptable.

On Wed, 13 Aug 2003 12:48:52 -0400, "Berin Loritsch"
<bloritsch@apache.org> said:
> Alex Blewitt wrote:
> 
> > Has anyone got any preferences between using:
> > 
> > import java.util.*
> > 
> > or
> > 
> > import java.util.Vector
> > import java.util.Enumeration
> > 
> > etc.
> > 
> > Any votes on which one is better/worse/standard?
> > 
> 
> 
> Yep:
> 
> I vote to be more specific.
> 
> Reason:
> 
> When Java 1.3 came out and introduced the java.util.Timer class it broke
> code bases that imported both java.awt.* and java.util.* (like ArgoUML).
> 
> When you are more specific you are less likely to run into these issues
> in the future.
> 
> -- 
> 
> "They that give up essential liberty to obtain a little temporary safety
>   deserve neither liberty nor safety."
>                  - Benjamin Franklin
> 
-- 
  Gareth Bryan
  garethbryan@fastmail.fm

-- 
http://www.fastmail.fm - Consolidate POP email and Hotmail in one place

Mime
View raw message