You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Uwe Schindler <uw...@thetaphi.de> on 2009/10/17 12:55:32 UTC

Whitespace inside Generics parameters

Just because I came along a lot of new Generics declarations:
How should we handle generics parameters in the source code? There are more
possibilities:

1. Map<ClassA, ClassB>
2. Map <ClassA, ClassB>
3. Map<ClassA,ClassB>

Sun's Java code in src.jar of their JDK always uses (3)[only in some special
cases, when it gets complicated, like when ? and generics inside generics
are used), which I also prefer and I used it that way during my last
patches. But e.g. Kay Kay used (1) in his original patches (I also
transformed it to 3).

I prefer (3) because the generics are not like function parameters and are
itself only identifiers never expressions (they are more annotations to the
class name) and in my opinion are part of the class name used. Because of
that, there is also no space between base class and "<". As it is part of
the declaration and the type itsself, it should be compact.

Other opinions?

+1 for (3) from my side

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Whitespace inside Generics parameters

Posted by Mark Miller <ma...@gmail.com>.
Uwe Schindler wrote:
> Just because I came along a lot of new Generics declarations:
> How should we handle generics parameters in the source code? There are more
> possibilities:
>
> 1. Map<ClassA, ClassB>
> 2. Map <ClassA, ClassB>
> 3. Map<ClassA,ClassB>
>
> Sun's Java code in src.jar of their JDK always uses (3)[only in some special
> cases, when it gets complicated, like when ? and generics inside generics
> are used), which I also prefer and I used it that way during my last
> patches. But e.g. Kay Kay used (1) in his original patches (I also
> transformed it to 3).
>
> I prefer (3) because the generics are not like function parameters and are
> itself only identifiers never expressions (they are more annotations to the
> class name) and in my opinion are part of the class name used. Because of
> that, there is also no space between base class and "<". As it is part of
> the declaration and the type itsself, it should be compact.
>
> Other opinions?
>
> +1 for (3) from my side
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>   
+1 for (3). The eclipse formatting settings floating around for lucene
use (1) though - +1 for changing them ;)

-- 
- Mark

http://www.lucidimagination.com




---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Whitespace inside Generics parameters

Posted by Earwin Burrfoot <ea...@gmail.com>.
Always used 1.
That's also the default for many autoformatters, which probably
explains why people use it.

On Sat, Oct 17, 2009 at 14:55, Uwe Schindler <uw...@thetaphi.de> wrote:
> Just because I came along a lot of new Generics declarations:
> How should we handle generics parameters in the source code? There are more
> possibilities:
>
> 1. Map<ClassA, ClassB>
> 2. Map <ClassA, ClassB>
> 3. Map<ClassA,ClassB>
>
> Sun's Java code in src.jar of their JDK always uses (3)[only in some special
> cases, when it gets complicated, like when ? and generics inside generics
> are used), which I also prefer and I used it that way during my last
> patches. But e.g. Kay Kay used (1) in his original patches (I also
> transformed it to 3).
>
> I prefer (3) because the generics are not like function parameters and are
> itself only identifiers never expressions (they are more annotations to the
> class name) and in my opinion are part of the class name used. Because of
> that, there is also no space between base class and "<". As it is part of
> the declaration and the type itsself, it should be compact.
>
> Other opinions?
>
> +1 for (3) from my side
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>



-- 
Kirill Zakharenko/Кирилл Захаренко (earwin@gmail.com)
Home / Mobile: +7 (495) 683-567-4 / +7 (903) 5-888-423
ICQ: 104465785

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Whitespace inside Generics parameters

Posted by Michael Busch <bu...@gmail.com>.
+1 for (3)

  Michael


On 10/17/09 3:55 AM, Uwe Schindler wrote:
> Just because I came along a lot of new Generics declarations:
> How should we handle generics parameters in the source code? There are more
> possibilities:
>
> 1. Map<ClassA, ClassB>
> 2. Map<ClassA, ClassB>
> 3. Map<ClassA,ClassB>
>
> Sun's Java code in src.jar of their JDK always uses (3)[only in some special
> cases, when it gets complicated, like when ? and generics inside generics
> are used), which I also prefer and I used it that way during my last
> patches. But e.g. Kay Kay used (1) in his original patches (I also
> transformed it to 3).
>
> I prefer (3) because the generics are not like function parameters and are
> itself only identifiers never expressions (they are more annotations to the
> class name) and in my opinion are part of the class name used. Because of
> that, there is also no space between base class and "<". As it is part of
> the declaration and the type itsself, it should be compact.
>
> Other opinions?
>
> +1 for (3) from my side
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Whitespace inside Generics parameters

Posted by Michael McCandless <lu...@mikemccandless.com>.
+1 for option 3

Mike

On Sat, Oct 17, 2009 at 6:55 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Just because I came along a lot of new Generics declarations:
> How should we handle generics parameters in the source code? There are more
> possibilities:
>
> 1. Map<ClassA, ClassB>
> 2. Map <ClassA, ClassB>
> 3. Map<ClassA,ClassB>
>
> Sun's Java code in src.jar of their JDK always uses (3)[only in some special
> cases, when it gets complicated, like when ? and generics inside generics
> are used), which I also prefer and I used it that way during my last
> patches. But e.g. Kay Kay used (1) in his original patches (I also
> transformed it to 3).
>
> I prefer (3) because the generics are not like function parameters and are
> itself only identifiers never expressions (they are more annotations to the
> class name) and in my opinion are part of the class name used. Because of
> that, there is also no space between base class and "<". As it is part of
> the declaration and the type itsself, it should be compact.
>
> Other opinions?
>
> +1 for (3) from my side
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org