Bug 5006 - Renaming Project from project to PROJECT messes everything up (1.0)
Summary: Renaming Project from project to PROJECT messes everything up (1.0)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Rodrigo Peretti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-15 18:22 EDT by Paula Cox (WSAD) CLA
Modified: 2019-06-13 14:37 EDT (History)
1 user (show)

See Also:


Attachments
test (25 bytes, application/php)
2019-06-13 14:29 EDT, Kyle Spivasovski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paula Cox (WSAD) CLA 2001-10-15 18:22:03 EDT
DESRIPTION: 
This was written against the Web Project, 
but it is reproducable with a Java Project

    <Note by Customer Rep, 2001/10/02 18:21:03, seq: 1 rel: 0  action: open>
When you rename a web project from (select project->right click->rename)
from "Webproj" to "WEBPROJ". Notice that all we did was change the case 
not the length of the project name. Doing this caused WSAD to display a 
dialog box saying that an internal error was encountered whenever we 
accessed files in the renamed project. I looked at the .log file and 
noticed     
that the exception occured when WSAD tried to open         
the .properties files for the project.    

Log: Tue Oct 02 17:53:14 EDT 2001
4 org.eclipse.core.resources 272 Could not open indexed store: C:\Program 
Files\IBM\WebSphere Studio Application 
Developer\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\WEBP
ROJ\.properties.
java.lang.NullPointerException
       at 
org.eclipse.core.internal.indexing.ObjectStore.commit(ObjectStore.java:183)
       at 
org.eclipse.core.internal.indexing.ObjectStore.close(ObjectStore.java:168)
       at 
org.eclipse.core.internal.indexing.IndexedStore.create(IndexedStore.java:151)
       at 
org.eclipse.core.internal.indexing.IndexedStore.open(IndexedStore.java:314)
       at 
org.eclipse.core.internal.properties.IndexedStoreWrapper.open(IndexedStoreWrappe
r.java:138)
       at 
org.eclipse.core.internal.properties.IndexedStoreWrapper.create(IndexedStoreWrap
per.java:51)
       at 
org.eclipse.core.internal.properties.IndexedStoreWrapper.getStore(IndexedStoreWr
apper.java:132)
       at 
org.eclipse.core.internal.properties.IndexedStoreWrapper.getIndex(IndexedStoreWr
apper.java:97)
       at 
org.eclipse.core.internal.properties.IndexedStoreWrapper.getCursor(IndexedStoreW
rapper.java:88)                 
After this, deleting a project fails with a NullPointerException during build. 
Also, trying to rename any project 
(eg a java project) now results in the same error (this worked prior to 
renaming 
the web project).
Also, the workspace is messed up - here are a couple of examples:
 - When I create a project, the 'Create a Project' smartguide does
not close on completion, I have to hit cancel to get out of it. 
 - File->New->Enterprise Java Bean Sample does not load the sample's java code 
Eventually, I need to reinstall to get WSAD to behave properly.


    <Note by developer, 2001/10/03 17:12:40, seq: 4 rel: 0  action: assign>
This is a severe error with "Navigator View".  Though Java's "Packages View" 
does
not have this problem, it has a related problem.

Overview:

If, in the "Navigator View", a resource is renamed so as the name is the same, 
except
some capitalization is changed (i.e. JavaProject is renamed to javaProject), 
errors, 
exceptions, and worse problems occur.  The only scenario where this does not 
occur is
in a "Simple Project" which has nothing in it.  Once you put something in a 
simple 
project (i.e. a file or folder), it too has the same problems.

In the worse case scenario, let's say you create a java project called "Jp1" 
and 
then rename it to
"JP1".  You will get errors and exceptions, but you may (I stress - MAY) also 
end up with two
projects - one called "Jp1" and one called "JP1" - the contents of each 
pointing 
to the same files.
If you try to delete or close either project you will get various exceptions 
and 
errors.
If you try to create another java project you will receive more errors and 
exceptions (regarding
validation) - and will return to the wizard (but the project will have actually 
been created).


"Packages View"

Packages View doesn't have this problem, but it has one similar to it.  If you 
try to rename a resource
in this view to a name that already exists (except the capitalization is 
different), you will get an 
exception.  Example: say you have two projects, one called "javaproject" and 
one 
called "javaProj".
If you rename "javaproject" to javaproj you will get an exception.


note:  these rename problems occur not only with projects, but also with 
files/folders.
Comment 1 John Arthorne CLA 2001-11-01 16:54:50 EST
For reference, there is a similar old PR called 1GLC3V9.
Comment 2 Rodrigo Peretti CLA 2001-11-27 10:52:32 EST
Fixed and submitted as an 1.0 patch.
Comment 3 Kyle Spivasovski CLA 2019-06-13 14:29:29 EDT
Created attachment 278930 [details]
test

test