[Spoon-discuss] Spoon eats enum methods
Renaud Pawlak
renaud.pawlak at gmail.com
Wed Oct 28 12:14:33 CET 2009
Could you be more specific on the version you use and your
environement? Have you tried with the Eclipse plugin?
Thanks.
2009/10/28 Matías Costa <m.costacano at gmail.com>:
> On Wed, Oct 28, 2009 at 8:09 AM, Renaud Pawlak <renaud.pawlak at gmail.com> wrote:
>> Hi Matias,
>>
>> I have a hard time believing that this bug was found only now as many
>> tests were performed on enums.
>
> Yes, me too. That's the reason I have done the mini test and I have
> not filled a bug the forge.
>
>> If you declare several methods with other names, are they eaten also?
>> Why is value() not public? What happens if you change the name and the
>> visibility? Typically I would name it getValue() for a try.
>
> package test;
>
> public enum NormalEnum {
> One(1);
>
> int v;
>
> public int getValue() {
> return v;
> };
>
> public void someMethod() {
> System.out.println("spoon!");
> };
>
> public String anotherThing() {
> return v+"";
> };
>
> NormalEnum(int i) {
> v = i;
> }
> }
>
> All methods are removed. The build.xml:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <project name="test" default="spoonize" basedir=".">
> <path id="project.class.path">
> <fileset dir="lib" includes="*.jar" />
> </path>
>
> <!-- define spoon task -->
> <taskdef name="spoon" classname="spoon.SpoonTask"
> classpathref="project.class.path" />
>
> <target name="spoonize" description="Spoon!">
> <spoon classpathref="project.class.path" verbose="true" debug="true"
> output="src">
> <sourceSet dir="src" includes="test/*.java" />
> <!--templateset dir="src"
> includes="omega/generate/fieldaccess/template/*.java" /-->
> </spoon>
> </target>
> </project>
>
> _______________________________________________
> 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