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 224339 - When refactoring a REST Resource class the old class name was not removed
Summary: When refactoring a REST Resource class the old class name was not removed
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 18:02 UTC by thorn
Modified: 2016-07-07 07:18 UTC (History)
2 users (show)

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 thorn 2012-12-31 18:02:32 UTC
After changing the name of one of my resource classes my application failed to run. The error generated com.sun.jersey.spi.inject.Errors$ErrorMessagesException was caused by two different classes mapping to the same URI. This was caused by a failure to remove the old name .class file from the build.
Comment 1 Petr Jiricka 2013-01-03 09:26:52 UTC
So do I understand it correctly that the workaround is to clean & build the project?
Comment 2 Petr Jiricka 2013-01-04 08:46:29 UTC
Offline comment by the reporter: Yes, a clean & build is a work around. If Netbeans could just display a warning message when renaming a class (maybe any class, but especially a class in a web app or web service project) - "Warning - You may need to do a clean&build to remove the previously named class file from the build."
Comment 3 Denis Anisimov 2013-01-09 07:52:12 UTC
This issue is unrelated to the REST functionality.
REST has no any refactoring references.
It is consequence of the pure Java refactoring action.
REST resource class is a Java class. For some reason an old class
 (binary I suppose) hasn't removed after refactoring action. All subsequent runtime issues are just consequence.
Comment 4 Ralph Ruijs 2013-01-09 12:52:35 UTC
(In reply to comment #2)
> Offline comment by the reporter: Yes, a clean & build is a work around. If
> Netbeans could just display a warning message when renaming a class (maybe any
> class, but especially a class in a web app or web service project) - "Warning -
> You may need to do a clean&build to remove the previously named class file from
> the build."

There is a warning in the refactoring documentation (Help button): "You should always perform a clean build after completing any refactoring commands. You can do a clean build by right-clicking the project's node in the Projects window and choosing Clean and Build Project."

(In reply to comment #3)
> This issue is unrelated to the REST functionality.
> REST has no any refactoring references.
> It is consequence of the pure Java refactoring action.
> REST resource class is a Java class. For some reason an old class
>  (binary I suppose) hasn't removed after refactoring action. All subsequent
> runtime issues are just consequence.

This looks like a problem with CoS, but not a P2 imho. Reassigning for evaluation.
Comment 5 Martin Balin 2016-07-07 07:18:41 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss