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 64503 - fail to refactor in default package
Summary: fail to refactor in default package
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-16 06:58 UTC by pzgyuanf
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pzgyuanf 2005-09-16 06:58:55 UTC
Because the other day I couldn't access to the whole netbeans.org site, I have
posted this problem to use.mail.list. Maybe someone have filed it into the
Issuezilla for me. If so, just duplicated it please!

A embarrassed example: "Puzzle 67: All Strung Out" from [Java™ Puzzlers: Traps,
Pitfalls, and Corner Cases]By Joshua Bloch, Neal Gafter.

----------------------------------------------------
public class StrungOut {

    public static void main(String[] args) {

        String s = new String("Hello world");

        System.out.println(s);

    }

}



class String {

    private final java.lang.String s;



    public String(java.lang.String s) {

        this.s = s;

    }



    public java.lang.String toString() {

        return s;

    }

}
------------------------------------------------------------

In Nebeans, trying to Refactor | Rename the 'class String' to 'MyString' , you
can see the result.

Refactor ought to refactor all occurrences of String but those java.lang.String
to MyString, including the 'String[] args' one. 

BTW. other IDEs could do it correctly.

-pprun
Comment 1 Tomas Hurka 2005-09-16 14:50:45 UTC
The problem is that the classes are in default package. If you put them to any non-default package 
everything works fine.
Comment 2 Tomas Hurka 2005-09-16 15:09:04 UTC
Fixed in trunk.
Checking in PackageImpScope.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/parser/PackageImpScope.java,v  <--  
PackageImpScope.java
new revision: 1.6; previous revision: 1.5
done
Comment 3 pzgyuanf 2005-09-16 15:35:57 UTC
Yep!
Comment 4 Quality Engineering 2007-09-20 10:55:09 UTC
Reorganization of java component