Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 129262 - generated methods in servlet are folded with http servlets methods
generated methods in servlet are folded with http servlets methods
Product: javaee
Classification: Unclassified
Component: Code
All All
: P3 (vote)
: 6.x
Assigned To: pslechta
: 117977 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2008-03-05 10:57 UTC by Radim Roska
Modified: 2008-06-04 08:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Radim Roska 2008-03-05 10:57:57 UTC
1. Create web project
2. create servlet

doGet and doPost methods are folded as desc="HttpServlet methods...

thats ok.

But if user generate another methods (e.g. rightclick->enterprise resource->send JMS Message), these methods are folded
in the same "block" as doGet and doPost and are collapsed by default. This may be confusing.

I suggest to place these new methods somewhere before "doGet & doPost block" its not collapsed automatically.
Comment 1 Jan Horvath 2008-03-05 12:21:56 UTC
it looks more like a defect rather then enhancement
Comment 2 Pavel Buzek 2008-03-20 06:45:42 UTC
Priority correct at P3. Not critical for 6.1.
Comment 3 pslechta 2008-04-14 11:20:36 UTC
Reproduced in 6.1 dev build on WinXP.
The generated code is placed after folded block only in there is some code after the block (variable declaration is
sufficient). It seems that cursor position does not influence where the generated code goes.
Comment 4 pslechta 2008-04-16 15:47:47 UTC
I looked through NB APIs used for Java source code modification (a lot of compilation trees and diffs) and don't see any
way how to fix the problem using these APIs. However, I found that the problem may be eliminated just by changing
template for servlet code generation...
Comment 5 pslechta 2008-04-16 16:18:31 UTC

The fix is very simple and everybody may apply it to his/her NetBeans installation -- just change template for servlet
code generation:

(1) Tools > Templates > Web > Servlet > Open in Editor.
(2) Modify the template according to the diff (see the link above). The most important change is to attach "//
</editor-fold>" comment directly after "}".
(3) Save the template.

Now all new methods should be inserted outside of the folded methods.
Comment 6 pslechta 2008-04-16 17:44:26 UTC
*** Issue 117977 has been marked as a duplicate of this issue. ***
Comment 7 Radim Roska 2008-04-17 09:53:12 UTC
Comment 8 pslechta 2008-04-28 15:19:15 UTC
The fix has been ported into the release61_fixes branch.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo