commit | d44c534994e55c92d3025c490af678e85ff0a630 | [log] [tgz] |
---|---|---|
author | Snjezana Peco <snjezana.peco@redhat.com> | Wed Oct 06 20:37:08 2021 +0200 |
committer | Roland Grunberg <rgrunber@redhat.com> | Thu Feb 10 15:53:02 2022 -0500 |
tree | 9f43f61e3e336661a56e183bbdc91f785935bf1b | |
parent | a0147bb09d7cff88571fae075fb231bb4da8244b [diff] |
Bug 576482 - Add serial version ID generates empty comment Change-Id: I21a0a442d1948960e4828c82b42fecb29ce86b73 Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186237 Tested-by: JDT Bot <jdt-bot@eclipse.org> Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/AbstractSerialVersionOperationCore.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/AbstractSerialVersionOperationCore.java index 13792b4..20a7ac5 100644 --- a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/AbstractSerialVersionOperationCore.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/AbstractSerialVersionOperationCore.java
@@ -125,7 +125,7 @@ } final String comment= CodeGeneration.getFieldComment(fUnit, declaration.getType().toString(), NAME_FIELD, StubUtility.getLineDelimiterUsed(fUnit)); - if (comment != null && comment.length() > 0 && !"/**\n *\n */\n".equals(comment)) { //$NON-NLS-1$ + if (comment != null && comment.length() > 0 && !comment.matches("[/\\* \t\n]*")) { //$NON-NLS-1$ final Javadoc doc= (Javadoc) rewrite.createStringPlaceholder(comment, ASTNode.JAVADOC); declaration.setJavadoc(doc); }