Skip to content

Commit

Permalink
Merge branch 'javadocfix' of https://github.com/hindsholm/jaxrs-analyzer
Browse files Browse the repository at this point in the history
 into hindsholm-javadocfix
  • Loading branch information
sdaschner committed Mar 27, 2018
2 parents e40af63 + a65bc9e commit 4ea38b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.github.javaparser.ast.body.Parameter;
import com.github.javaparser.ast.comments.Comment;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
import com.github.javaparser.javadoc.Javadoc;
import com.github.javaparser.javadoc.JavadocBlockTag;
Expand Down Expand Up @@ -128,7 +129,9 @@ private MemberParameterTag createMethodParameterTag(JavadocBlockTag tag, MethodD
}

private MemberParameterTag createMemberParamTag(JavadocDescription javadocDescription, Stream<AnnotationExpr> annotationStream) {
Map<String, String> annotations = annotationStream.collect(Collectors.toMap(a -> a.getName().getIdentifier(),
Map<String, String> annotations = annotationStream
.filter(Expression::isSingleMemberAnnotationExpr)
.collect(Collectors.toMap(a -> a.getName().getIdentifier(),
a -> a.asSingleMemberAnnotationExpr().getMemberValue().asStringLiteralExpr().asString()));
return new MemberParameterTag(javadocDescription.toText(), annotations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.validation.constraints.Pattern;

/**
* These sources are solely used for test purposes and not meant for deployment.
Expand Down Expand Up @@ -90,7 +91,7 @@ public Response put(final Model model) {
*/
@DELETE
@Path("{foobar}")
public void deleteTest(@PathParam("foobar") final String foobar) {
public void deleteTest(@PathParam("foobar") @Pattern(regexp = "^\\S.*") final String foobar) {
Logger.getLogger("").info("deleted " + foobar);
}

Expand Down

0 comments on commit 4ea38b2

Please sign in to comment.