Skip to content

Commit

Permalink
[FIXED] Duplication of "abstract" modifier for classes
Browse files Browse the repository at this point in the history
[FIXED/WIP] Correct generation of Javadoc for param and return parameters
  • Loading branch information
tekreme73 committed Feb 3, 2015
1 parent 5adeb5e commit 8eefc35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 15 additions & 5 deletions JavaCodeGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ define(function (require, exports, module) {
if (elem.name.length > 0) {
var terms = [];
// Doc
this.writeDoc(codeWriter, elem.documentation, options);
this.writeDoc(codeWriter, "Default constructor", options);
// Visibility
var visibility = this.getVisibility(elem);
if (visibility) {
Expand Down Expand Up @@ -366,6 +366,16 @@ define(function (require, exports, module) {

// doc
var doc = elem.documentation.trim();

//Erase Javadoc @param and @return
var i, lines = doc.split("\n");
doc = "";
for (i = 0, len = lines.length; i < len; i++) {
if(lines[i].lastIndexOf("@param", 0) !== 0 && lines[i].lastIndexOf("@return", 0) !== 0) {
doc += "\n" + lines[i];
}
}

_.each(params, function (param) {
doc += "\n@param " + param.name + " " + param.documentation;
});
Expand Down Expand Up @@ -454,7 +464,7 @@ define(function (require, exports, module) {

// Modifiers
var _modifiers = this.getModifiers(elem);
if (_.some(elem.operations, function (op) { return op.isAbstract === true; })) {
if (_modifiers.indexOf("abstract") !== -1 && _.some(elem.operations, function (op) { return op.isAbstract === true; })) {
_modifiers.push("abstract");
}
if (_modifiers.length > 0) {
Expand Down Expand Up @@ -500,7 +510,7 @@ define(function (require, exports, module) {
this.writeMemberVariable(codeWriter, asso.end2, options);
codeWriter.writeLine();
}
if (asso.end2.reference === elem && asso.end1.navigable === true) {
if (asso.end2.reference === elem && asso.end1.navigable === true) {
this.writeMemberVariable(codeWriter, asso.end1, options);
codeWriter.writeLine();
}
Expand Down Expand Up @@ -583,7 +593,7 @@ define(function (require, exports, module) {
this.writeMemberVariable(codeWriter, asso.end2, options);
codeWriter.writeLine();
}
if (asso.end2.reference === elem && asso.end1.navigable === true) {
if (asso.end2.reference === elem && asso.end1.navigable === true) {
this.writeMemberVariable(codeWriter, asso.end1, options);
codeWriter.writeLine();
}
Expand Down Expand Up @@ -669,7 +679,7 @@ define(function (require, exports, module) {

// Modifiers
var _modifiers = this.getModifiers(elem);
if (_.some(elem.operations, function (op) { return op.isAbstract === true; })) {
if (_modifiers.indexOf("abstract") !== -1 && _.some(elem.operations, function (op) { return op.isAbstract === true; })) {
_modifiers.push("abstract");
}
if (_modifiers.length > 0) {
Expand Down
2 changes: 2 additions & 0 deletions JavaReverseEngineer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,8 @@ define(function (require, exports, module) {
_operation.stereotype = "constructor";
}

//Stuff to do here to grab the correct Javadoc and put it into parameters and return

// Formal Parameters
if (methodNode.parameters && methodNode.parameters.length > 0) {
for (i = 0, len = methodNode.parameters.length; i < len; i++) {
Expand Down

0 comments on commit 8eefc35

Please sign in to comment.