Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(comment): Allows usage of the new flag only. #723

Merged
merged 1 commit into from
Jun 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ public <T> void visitCtSuperAccess(CtSuperAccess<T> f) {

@Override
public void visitCtComment(CtComment comment) {
if (!env.isGenerateJavadoc() && !env.isCommentsEnabled() && context.elementStack.size() > 1) {
if (!(env.isGenerateJavadoc() || env.isCommentsEnabled()) && context.elementStack.size() > 1) {
return;
}
switch (comment.getCommentType()) {
Expand Down Expand Up @@ -1613,15 +1613,15 @@ public DefaultJavaPrettyPrinter writeThrowsClause(CtExecutable<?> e) {
}

private void printComment(CtComment comment) {
if (!env.isGenerateJavadoc() || !env.isCommentsEnabled() || comment == null) {
if (!(env.isGenerateJavadoc() || env.isCommentsEnabled()) || comment == null) {
return;
}
scan(comment);
writeln().writeTabs();
}

private void printComment(List<CtComment> comments) {
if (!env.isGenerateJavadoc() || !env.isCommentsEnabled() || comments == null) {
if (!(env.isGenerateJavadoc() || env.isCommentsEnabled()) || comments == null) {
return;
}
for (CtComment comment : comments) {
Expand All @@ -1642,7 +1642,7 @@ private void printComment(CtElement e, CommentOffset offset) {

private List<CtComment> getComments(CtElement e, CommentOffset offset) {
List<CtComment> commentsToPrint = new ArrayList<>();
if (!env.isGenerateJavadoc() || !env.isCommentsEnabled() || e == null) {
if (!(env.isGenerateJavadoc() || env.isCommentsEnabled()) || e == null) {
return commentsToPrint;
}
for (CtComment comment : e.getComments()) {
Expand Down
1 change: 0 additions & 1 deletion src/test/java/spoon/test/comment/CommentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ private Factory getSpoonFactory() {
launcher.run(new String[] {
"-i", "./src/test/java/spoon/test/comment/testclasses/",
"-o", "./target/spooned/",
"-j",
"-c"
});
return launcher.getFactory();
Expand Down