felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: [Quick vote] Coding Standard for Import Statements
Date Thu, 20 Dec 2007 11:00:37 GMT
Hi Marcel,

Am Dienstag, den 18.12.2007, 21:07 +0100 schrieb Marcel Offermans:
> However, I think the real discussion we should have is about  
> formatting source code. Do we want to somehow make sure all code is  
> formatted exactly the same? Does this mean we need to standardize on a  
> single IDE or a separate formatting tool?

No, I don't think we should be this strict :-)

> I don't mind voting on this issue, but my next question would be, are  
> you now going to checkout all code, do an "organize imports" on all  
> files, and commit that back? This is not only related to organizing  
> imports, but to other things mentioned in the coding style too (naming  
> of variables, spacing, indentation, ...).

I don't think so, but probably should the import lists be touched when a
file is touched ?

I think "formatting" of the import list is not the same as spacing and
indentation. IMHO it has much to do with stability and being able to
read the code. Consider for example, there is a Class existing in two
separate packages [The Apache Jackrabbit project has an
org.apache.jackrabbit.uuid.UUID class, which clashes with Java 5
java.util.UUID ]. If we have explicit imports for these classes, we can
tell very easily which instance is used. Otherwise we have to guess. In
addition, compiling on Java 5 a class which defines

    import java.util.*;
    import org.apache.jackrabbit.uuid.*;
       UUID uuid;

will lead to a compile error, because the Compiler is not able to tell
which UUID class to use.


View raw message