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 53146

Summary: Change Method Parameters does not work with HttpServletRequest & HttpServletResponse args
Product: editor Reporter: Charlie Hunt <huntch>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: bleonard
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 65780    
Attachments: Full copy of the source code
Display of Help > About > Detail information in a bmp file.

Description Charlie Hunt 2005-01-09 20:54:20 UTC
This is an isse I have found with NetBeans 4.1
Build 20041222-1722.

I have a method in a servlet called
dispatchToWorker(HttpServletRequest theRequest,
HttpServletResponse theResponse). As you can see,
it has two args, theRequest and theResponse. This
method is called from the servlet's
processRequest(..) method.

I wanted to refactor the dispatchToWorker() method
to change HttpServletResponse theResponse to
PrintWriter thePrintWriter. But, the Change Method
Parameters dialog will not let me change that
parameter or remove it. BTW: It also won't let me
change HttpServletRequest theRequest either.

Here's what the source looks like:

protected void 
   dispatchToWorker(HttpServletRequest theRequest,
                 HttpServletResponse theResponse)
   throws IOException {
   ....
}

protected void 
      processRequest(HttpServletRequest request, 
      HttpServletResponse response)
           throws ServletException, IOException {
 
   response.setContentType("text/html");
   dispatchToWorker(request, response);

}
Comment 1 Charlie Hunt 2005-01-09 20:55:20 UTC
Created attachment 19572 [details]
Full copy of the source code
Comment 2 Charlie Hunt 2005-01-09 20:57:05 UTC
Created attachment 19573 [details]
Display of Help > About > Detail information in a bmp file.
Comment 3 Martin Matula 2005-01-10 08:47:51 UTC
Sorry, but this is currently as designed. Change method parameters
will let you add new parameters or remove the ones that are not used
by the method. You cannot change types of parameters since the
refactoring would not know what to do with the usages of that method.
Comment 4 Charlie Hunt 2005-01-10 15:40:47 UTC
If this is the way it is currently designed, then the defect is in the
name of given to the type of refactoring. The name given to the type
of refactoring should be "Add / Remove Method Parameters", not "Change
Method Parameters".

The latter implies a sort of operation as I described in addition to
Add / Remove.

Comment 5 Charlie Hunt 2005-01-10 15:48:58 UTC
Forgot to re-open issue on last commit.
Comment 6 Martin Matula 2005-01-10 16:17:13 UTC
This is definitely not a P1. My personal opinion is that it is better
to call this feature Change Method Parameters than Add/Remove/Reorder
Method Parameters. Anyway, we will discuss this with our UI engineer.
Comment 7 Jan Becicka 2005-01-20 15:44:43 UTC
Reassigning to UI team. Rudolfe, please make a decision.
Comment 8 Jan Becicka 2005-02-14 10:11:52 UTC
This is implemented accroding to ui spec. Changing issue type to
enhancement.
Comment 9 Ralph Ruijs 2011-06-06 12:32:52 UTC

*** This bug has been marked as a duplicate of bug 54652 ***