Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Marschall2012-08-21 14:59:15 +0000
committerDani Megert2012-08-21 14:59:15 +0000
commit93d3986ee8dec7efde964a1cdc38ad6a1c198f7a (patch)
tree4d6b01a933b37aa639f3318b582ff230620a1e7c
parent9461ff47329e45bef056c554f0cb73f00b6c2de2 (diff)
downloadeclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.tar.gz
eclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.tar.xz
eclipse.jdt.ui-93d3986ee8dec7efde964a1cdc38ad6a1c198f7a.zip
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.java11
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 e525561add..a331126934 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$

Back to the top