Permalink
Browse files

[FIXED] Duplication of "abstract" modifier for classes

[FIXED/WIP] Correct generation of Javadoc for param and return parameters
  • Loading branch information...
1 parent 5adeb5e commit 8eefc35a63876c6d65fc498f3ac0f1798cb76f2e @tekreme73 tekreme73 committed Feb 3, 2015
Showing with 17 additions and 5 deletions.
  1. +15 −5 JavaCodeGenerator.js
  2. +2 −0 JavaReverseEngineer.js
View
@@ -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) {
@@ -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;
});
@@ -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) {
@@ -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();
}
@@ -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();
}
@@ -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) {
@@ -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++) {

0 comments on commit 8eefc35

Please sign in to comment.