[Spoon-discuss] Bug with enums

Renaud Pawlak renaud.pawlak at gmail.com
Wed Apr 1 11:43:25 CEST 2009


Please do :)

Thanks!
/Renaud

On Wed, Apr 1, 2009 at 8:21 AM, Lionel Seinturier
<Lionel.Seinturier at univ-lille1.fr> wrote:
> Dear all,
>
> I'm proposing the attached patch for bug:
>
> https://gforge.inria.fr/tracker/index.php?func=detail&aid=7291&group_id=73&atid=371
>
> I've run the examples and the patch does not seem to introduce regression.
>
> Does anymore mind if I commit the patch in trunk/spoon-core?
>
> Lionel.
> --
> Lionel Seinturier
> Univ. Lille - Lab. LIFL - INRIA ADAM
> http://www.lifl.fr/~seinturi
>
>
> Index: src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
> ===================================================================
> --- src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
> (revision 2033)
> +++ src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
> (working copy)
> @@ -816,7 +816,13 @@
>                if (f.getDefaultExpression() != null) {
>                        CtNewClass<?> nc = (CtNewClass<?>)
> f.getDefaultExpression();
>                        if (nc.getArguments().size() > 0) {
> -                               write("(" + nc.getArguments().get(0) + ")");
> +                               write("(");
> +                               boolean first=true;
> +                               for (CtExpression<?> ctexpr :
> nc.getArguments()) {
> +                                       if(first) first=false; else
> write(",");
> +                                       write(ctexpr.toString());
> +                               }
> +                               write(")");
>                        }
>                        scan(nc.getAnonymousClass());
>                }
>
> _______________________________________________
> Spoon-discuss mailing list
> Spoon-discuss at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/spoon-discuss
>



-- 
Renaud Pawlak, Professor
ISEP - 21 rue d’Assas 75006 Paris, France
Head of the Computer Engineering Department
Head of ISEP Research and Consulting for Computer Engineering
Phone: +33 149 54 52 78
Cell #1: +33 6 37 29 12 15
Cell #2: +33 6 36 47 06 01
Fax: +33 1 49 54 52 51
http://renaudpawlak.wikidot.com




More information about the Spoon-discuss mailing list