Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaschner committed Oct 13, 2018
1 parent 4951355 commit fa9516e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ public void visit(FieldDeclaration field, Void arg) {
field.getComment()
.filter(Comment::isJavadocComment)
.map(this::toJavaDoc)
.ifPresent(c ->createFieldComment(c, field));
.ifPresent(c -> createFieldComment(c, field));
super.visit(field, arg);
}

private void createFieldComment(Javadoc javadoc, FieldDeclaration field) {
ClassComment classComment = classComments.get(className);
if(classComment == null) {
classComment = new ClassComment("", new HashMap<>(), false);
classComments.put(className, classComment);
}
classComment.getFieldComments().add(createMemberParamTag(javadoc.getDescription(), field.getAnnotations().stream()));
ClassComment classComment = classComments.get(className);
if (classComment == null) {
classComment = new ClassComment();
classComments.put(className, classComment);
}
classComment.getFieldComments().add(createMemberParamTag(javadoc.getDescription(), field.getAnnotations().stream()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package com.sebastian_daschner.jaxrs_analyzer.model.javadoc;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ClassComment extends MemberComment {

private List<MemberParameterTag> fieldComments = new ArrayList<>();

public ClassComment() {
this("", new HashMap<>(), false);
}

public ClassComment(String comment, Map<Integer, String> responseComments, boolean deprecated) {
super(comment, responseComments, deprecated);
}
Expand Down

0 comments on commit fa9516e

Please sign in to comment.