facebook

Exception on refactoring Java code

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #268306 Reply

    kingcu
    Member

    I got an exeption on renaming a class. The exception simply says “Class file name must end with .class”. I even tried with renaming local variables, and got the same exception. See below link for a screen shot:

    http://new.photos.yahoo.com/wtatkfi/album/576460762396310787/photo/294928804311098548/0

    And here is my configuration:

    *** Date: Tue Apr 03 14:02:31 EDT 2007

    *** Platform Details:

    *** System properties:
    GRE_HOME=C:\Program Files\MyEclipse 5.1.1 GA\myeclipse\eclipse\plugins\com.genuitec.javascript.debug.mozilla_5.1.1\XPCOM\os\win32\mozilla
    awt.toolkit=sun.awt.windows.WToolkit
    eclipse.buildId=M20060921-0945
    eclipse.commands=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Program Files\MyEclipse 5.1.1 GA\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    294_80
    -vm
    C:\Program Files\MyEclipse 5.1.1 GA\jre\bin\javaw.exe
    eclipse.ee.install.verify=false
    eclipse.product=com.genuitec.myeclipse.product.ide
    eclipse.startTime=1175611009636
    eclipse.vm=C:\Program Files\MyEclipse 5.1.1 GA\jre\bin\javaw.exe
    eclipse.vmargs=-Xms128M
    -Xmx512M
    -XX:PermSize=64M
    -XX:MaxPermSize=128M
    -jar
    C:\Program Files\MyEclipse 5.1.1 GA\eclipse\startup.jar
    eof=eof
    file.encoding=Cp1252
    file.encoding.pkg=sun.io
    file.separator=\
    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob=sun.awt.windows.WPrinterJob
    java.class.path=C:\Program Files\MyEclipse 5.1.1 GA\eclipse\startup.jar
    java.class.version=49.0
    java.endorsed.dirs=C:\Program Files\MyEclipse 5.1.1 GA\jre\lib\endorsed
    java.ext.dirs=C:\Program Files\MyEclipse 5.1.1 GA\jre\lib\ext
    java.home=C:\Program Files\MyEclipse 5.1.1 GA\jre
    java.io.tmpdir=C:\DOCUME~1\TONGWA~1\LOCALS~1\Temp\
    java.library.path=C:\Program Files\MyEclipse 5.1.1

    SNIP, in the future please use MyEclipse > Installation Summary > Installation Details

    #268310 Reply

    Riyad Kalla
    Member

    This can occur when you try and refactor a class name and include a dot in the new file name, it thinks your trying to rename the file.

    To get your project into a good state, right-click on the root and do a Refresh. Then go to Project > Clean and rebuild the project in question. Now fix any build path or build issues you have in the problem view before refactoring. That should get you set.

    #268328 Reply

    kingcu
    Member

    @support-rkalla wrote:

    This can occur when you try and refactor a class name and include a dot in the new file name, it thinks your trying to rename the file.

    To get your project into a good state, right-click on the root and do a Refresh. Then go to Project > Clean and rebuild the project in question. Now fix any build path or build issues you have in the problem view before refactoring. That should get you set.

    I tried what you said. I don’t have any errors, just warnings: because I use injection, so it’s complaining about those injected local variable never used. And I can’t even rename a class variable!

    #268332 Reply

    Riyad Kalla
    Member

    That is really strange. What are you trying to rename the class to? What exactly do you type into the text field when you try and rename it?

    If you create a new project and just copy the classes over… can you rename them then? I wonder if the project went squirrely… also try and restart the IDE, see if that helps.

    #268335 Reply

    kingcu
    Member

    I recreated the project and was able to rename the class. However, the references are not updated even if I have “Update reference” checked.

    #268340 Reply

    Riyad Kalla
    Member

    Just to be clear, are you referring to references *only* in Java source classes, or are you referring to references in other files (like XML, properties, etc.)?

    #268344 Reply

    kingcu
    Member

    In Java files only. In the rename dialog, when I click on “Next >” instead of clicking “Finish” directly, in the changes to be performed list, only one thing shows up about renaming the compilation unit, it doesn’t mention about updating the references in other Java files. See below link for screen shot:

    [URL]http://new.photos.yahoo.com/wtatkfi/photo/294928804311227315/0[/URL]

    #268347 Reply

    Riyad Kalla
    Member

    Is this project something you can share with me? I wonder what is going on here.

    #268352 Reply

    kingcu
    Member

    I can zip up the workspace and … how do I get the file to you then?

    #268354 Reply

    Riyad Kalla
    Member

    Please *export* just the project using File > Export > Archive, to a ZIP file and email it to support@genuitec.com ATTN Riyad with a link to this thread for reference.

    Don’t zip up the workspace because it can contain 10s or 100s of megabytes of index and metadata.

    #268357 Reply

    kingcu
    Member

    I’ve emailed you the project archive. Thank you for the help. Let me know if you need any other info.

    #268361 Reply

    Riyad Kalla
    Member

    I found the bug, it seems to be because you have a DOT in the project name. This is a very obscure bug, thank you for helping me find it.

    #268368 Reply

    kingcu
    Member

    Yes, I changed the DOT to UNDERSCORE and it worked. Thank you for the help.

    #268371 Reply

    kingcu
    Member

    Just realized another problem: I have in my workspace a EAR, a JAR and a WAR project and organized in a .ear, .jar and .war folders respectively. And I use exploded mode at development time. If I change the name of the JAR project, the exploded directory name is also changing, which causes a problem at deployment time when it’s complaining can’t find the .jar folder (configured in the application.xml as an EJB module).

    So, when can I expect this to be fixed?

    #268376 Reply

    Riyad Kalla
    Member

    I have in my workspace a EAR, a JAR and a WAR project and organized in a .ear, .jar and .war folders respectively

    Do you mean organized into “projects” with those extensions on them?

    If I change the name of the JAR project, the exploded directory name is also changing, which causes a problem at deployment time when it’s complaining can’t find the .jar folder (configured in the application.xml as an EJB module).

    So when you remove the “.jar” from the project name, it’s getting deployed to a directory without a .JAR extension and your app server cannot find it? Is that the case?

    What app server are you using?

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: Exception on refactoring Java code

You must be logged in to post in the forum log in