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 50694 - Change method parameters allows to add parameter which causes classes not to compile
Summary: Change method parameters allows to add parameter which causes classes not to ...
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker with 1 vote (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-21 12:43 UTC by Roman Strobl
Modified: 2009-05-12 15:56 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Strobl 2004-10-21 12:43:15 UTC
[Netbeans 200410202002; JDS v.2; JDK 1.5.0_01-b04]

I have the following code:

    private void methodA(int i) {
    }

    protected void methodA(int i, String text) {
    }

When I try to change method parameters for the
first method, I am allowed to add a parameter of
type String. Thus I end up with having:

    private void methodA(int i, String text) {
    }

    protected void methodA(int i, String text) {
    }

Which my compiler doesn't like so much. I can also
add this parameter if both methods are protected.

P2 because according to Marek this already used to
work, so it is a regression.
Comment 1 Pavel Flaska 2004-10-21 14:07:14 UTC
Marek is right, this already used to work.
Comment 2 Pavel Flaska 2004-10-21 14:16:47 UTC
Seems that new parameter type is not resolved and that is the reason
why it does not clashes with other method because unresolved type
cannot be compared with any other type.
Comment 3 Pavel Flaska 2004-10-21 14:48:27 UTC
Hm, so it is not a regression. I found out that it works correctly for
primitive types or fully qualified names. For simple names it never
works. So as a workaround you can use fully qualified names. (I know
that it is annoying and we need to solve it, unfortunately there is no
direct solution for it. We need to expose resolving of simple names
outside the parser and put it to the API. Changing to ENHANCEMENT.
Comment 4 Roman Strobl 2004-10-21 15:00:58 UTC
Yes, you're right. I've tried to use "java.lang.String" and that works
pretty fine. Perhaps this could be mentioned somewhere in relnotes in
4.0 for case that people would complain that refactoring broke their code.
Comment 5 Roman Strobl 2005-07-11 14:36:36 UTC
Changed TM from 4.1 to TBD, please re-evaluate. Thanks!
Comment 6 Pavel Flaska 2009-05-12 15:56:08 UTC
Different architecture used. This will not be fixed.