Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: moacsjr on August 12, 2005, 04:57:04 am

Title: JAVA Code Generation Problem - Comments
Post by: moacsjr on August 12, 2005, 04:57:04 am
Hello,

I'm still having problems with JAVA code generation.

Create a class then put some attributes on it.
Add some comments for each attributes.
Now try to generate this class. [ctrl + g]
Please note that the option "Allways synchronize with existing flies" needs to be selected.

Ok now you have successfull generated the JAVA class.
Now generate it again, and you will have duplicated comments.


package br.syndeo.dms.domain.servico;

/**
* @author Marcelo Dutra
* @version 1.0
* @created 12-ago-2005 08:36:14
*/
public class Defeito {


/**

* É o código que identifica o defeito

*/

/**

* É o código que identifica o defeito

*/

private int codDefeito;

/**

* É a descrição do defeito

*/

/**

* É a descrição do defeito

*/

private String dscDefeito;

/**

* Indica se o defeito

*/

/**

* Indica se o defeito

*/

private boolean trinca;


public Defeito(){


}


/**

* É o código que identifica o defeito

*/

/**

* É o código que identifica o defeito

*/

public int getCodDefeito(){


return codDefeito;

}


/**

* É a descrição do defeito

*/

/**

* É a descrição do defeito

*/

public String getDscDefeito(){


return dscDefeito;

}


/**

* Indica se o defeito

*/

/**

* Indica se o defeito

*/

public boolean isTrinca(){


return trinca;

}


/**

* É o código que identifica o defeito

*

* @param newVal

*/

/**

* É o código que identifica o defeito

*

* @param newVal

*/

public void setCodDefeito(int newVal){


codDefeito = newVal;

}


/**

* É a descrição do defeito

*

* @param newVal

*/

/**

* É a descrição do defeito

*

* @param newVal

*/

public void setDscDefeito(String newVal){


dscDefeito = newVal;

}


/**

* Indica se o defeito

*

* @param newVal

*/

/**

* Indica se o defeito

*

* @param newVal

*/

public void setTrinca(boolean newVal){


trinca = newVal;

}

}
Title: Re: JAVA Code Generation Problem - Comments
Post by: bvyn on February 07, 2006, 08:36:29 am
I've been experiencing the same problem with duplicate comments when generating code for C++.  Did you ever find a resolution to the problem?
Title: Re: JAVA Code Generation Problem - Comments
Post by: Eve on February 07, 2006, 01:04:16 pm
From memory there was a problem that matched this description fixed a few builds back.

If it's the problem I think it is then you have two options.
Hope that helps.
Title: Re: JAVA Code Generation Problem - Comments
Post by: bvyn on February 07, 2006, 01:58:23 pm
Just so you know, I am currently using Build 785 (almost the latest) and the Reverse checkbox in the Comments group is checked.  The problem is not consistent either.  In some cases duplicate comments are generated, and in others, everything is Ok.
Title: Re: JAVA Code Generation Problem - Comments
Post by: Eve on February 07, 2006, 05:36:33 pm
Well, in that case it's not the same problem and I haven't seen it.

It probably has something to do with some combination of options and possibly modified templates, but I have no idea which options might be doing it.  If you find anything then let me know.