| author | Philippe Marschall | 2012-08-21 10:59:15 (EDT) |
|---|---|---|
| committer | Dani Megert | 2012-08-21 10:59:15 (EDT) |
| commit | 93d3986ee8dec7efde964a1cdc38ad6a1c198f7a (patch) (side-by-side diff) | |
| tree | 4d6b01a933b37aa639f3318b582ff230620a1e7c | |
| parent | 9461ff47329e45bef056c554f0cb73f00b6c2de2 (diff) | |
| download | eclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.zip eclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.tar.gz eclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.tar.bz2 | |
Fixed bug 387536: [type wizards] generate main method stub ignores
generate comments setting
| -rw-r--r-- | org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewClassWizardPage.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewClassWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewClassWizardPage.java index e525561..a331126 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewClassWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewClassWizardPage.java @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Philippe Marschall <philippe.marschall@netcetera.ch> - [type wizards] generate main method stub ignores generate comments setting - https://bugs.eclipse.org/387536 *******************************************************************************/ package org.eclipse.jdt.ui.wizards; @@ -257,10 +258,12 @@ public class NewClassWizardPage extends NewTypeWizardPage { if (doMain) { StringBuffer buf= new StringBuffer(); final String lineDelim= "\n"; // OK, since content is formatted afterwards //$NON-NLS-1$ - String comment= CodeGeneration.getMethodComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), "main", new String[] {"args"}, new String[0], Signature.createTypeSignature("void", true), null, lineDelim); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (comment != null) { - buf.append(comment); - buf.append(lineDelim); + if (isAddComments()) { + String comment= CodeGeneration.getMethodComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), "main", new String[] { "args" }, new String[0], Signature.createTypeSignature("void", true), null, lineDelim); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + if (comment != null) { + buf.append(comment); + buf.append(lineDelim); + } } buf.append("public static void main("); //$NON-NLS-1$ buf.append(imports.addImport("java.lang.String")); //$NON-NLS-1$ |

