Author Topic: JAVA Code Generation Problem - Comments  (Read 3824 times)

moacsjr

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
JAVA Code Generation Problem - Comments
« 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;

}

}

bvyn

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: JAVA Code Generation Problem - Comments
« Reply #1 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?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: JAVA Code Generation Problem - Comments
« Reply #2 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.
  • Upgrade to the latest version of EA.  ;)
  • Open the options (Tools | Options) to the Source Code Engineering (used to be Generation) page and check the Reverse checkbox in the Comments group.
Hope that helps.

bvyn

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: JAVA Code Generation Problem - Comments
« Reply #3 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.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: JAVA Code Generation Problem - Comments
« Reply #4 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.