This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195048

Summary: [70cat] REGRESSION: Generating method with comment no longer works
Product: java Reporter: misterm <misterm>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal CC: hmichel, jkovalsky
Priority: P1 Keywords: REGRESSION
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description misterm 2011-02-03 18:25:29 UTC
An internal hint plugin does the following method calls, successfully adding a method with a javadoc comment to a class, which works (and worked to some point in time in trunk) in 6.9:

MethodTree mt = treeMaker.Method(ModifiersTree, CharSequence, Tree, List<? extends TypeParameterTree>, List<? extends VariableTree>, List<? extends ExpressionTree>, BlockTree, ExpressionTree);
final Comment comment = Comment.create(Style.JAVADOC, -2, -2, -2, "/**\n*@SomeAnnotation\n*/);
treeMaker.addComment(mt, comment, true);
final GeneratorUtilities utilities = GeneratorUtilities.get(wc);
ClassTree nt = utilities.insertClassMember(classTree, mt);
final VariableTree vt = treeMaker.Variable(ModifiersTree, CharSequence, Tree, ExpressionTree);
nt = utilities.insertClassMember(nt, vt);
nt = utilities.insertClassMember(nt, utilities.createGetter(vt));
nt = utilities.insertClassMember(nt, utilities.createSetter(nt, vt));
nt = utilities.importFQNs(nt);
wc.rewrite(classTree, nt);

Method "mt" used to be generated with proper Javadoc and now gets none.

Product Version = NetBeans IDE Dev (Build 110201-027c9a2e0e3c)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_19
Runtime = Java HotSpot(TM) Client VM 16.2-b04
Comment 1 Jan Lahoda 2011-02-03 22:16:52 UTC
Hm, seems that a cleanup cleaned a bit too much:
http://hg.netbeans.org/jet-main/rev/0158974648f3
Comment 2 Quality Engineering 2011-02-05 06:09:03 UTC
Integrated into 'main-golden', will be available in build *201102050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0158974648f3
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #195048: need to keep the comments through GeneratorUtilities.importFQNs