Bug 42281 - "Resource *.java does not exist"
Summary: "Resource *.java does not exist"
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-29 17:11 EDT by Ian Buckley CLA
Modified: 2003-10-08 09:59 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Buckley CLA 2003-08-29 17:11:27 EDT
A .java file "D:\Program Files\eclipse\workspace\Sun tutorial examples\native1.1
\implementing\example-1dot1\Callbacks.java" exists and appears in my (Eclipse) 
Package Explorer. 

However, when I double click on the icon to edit it, Eclipse complains that:
"\Sun tutorial examples\native1\1\implementing\example-1dot1\Callbacks.java" 
does not exist."

Note that it has changed the period into a back slash "." -> "\".
Comment 1 Dirk Baeumer CLA 2003-09-01 04:00:34 EDT
Ian, how does your project layout look like ? (e.g what is the project, source 
folder and package structure).
Comment 2 Philipe Mulet CLA 2003-09-01 04:35:19 EDT
Please provide steps to reproduce, then reopen this problem
Comment 3 Ian Buckley CLA 2003-09-02 16:03:22 EDT
This minor problem is merely that if you have a project of the form:

eclipse/workspace/myproject/projectsubfolder.1/MyProgram.java, 

(presumably) "projectsubfolder.1"  is an illegal package name, so doing 
File/Refresh makes projectsubfolder.1 appear in the package exporer with the 
*folder* icon instead of the *package* icon. Expanding the "projectsubfolder.1" 
subfolder, the program "MyProgram.java" is visible in the package explorer, but 
refuses to open (double click) in the editor with the message 

"Resource /myproject/projectsubfolder/1/MyProgram.java does not exist" 

(Note the "." becomes "/".) 

The obvious and simple solution is to rename projectsubfolder.1 to a valid 
package name. 

Presumably Eclipse will not let you create a project subfolder name.suffix, but 
if you use import, or paste files into the workspace directory tree manually, 
then this could be a problem?

Files with .java or .class suffix are affected. Most others, e.g. .txt are not.

The easiest way to reproduce the problem is:
* with the Windows file explorer, find the eclipse/workspace/ folder, 
* enter the subfolder for an existing project 
* make a new folder "myname.anysuffix" (I had "native1.1")
* enter the new folder "myname.anysuffix" and paste in any .java or .class file
* in Eclipse select the project in the package explorer and do File/Refresh 
* in the package explorer, now try to open the .java file in the java editor.

Comment 4 Philipe Mulet CLA 2003-09-03 03:09:44 EDT
Thanks for these clarifications, will investigate. We should tolerate opening 
Java files located anywhere, including inside such a folder.
Comment 5 Philipe Mulet CLA 2003-09-17 07:19:48 EDT
In 3.0 M3, I can open the file, but cannot save changes to it.
Comment 6 Philipe Mulet CLA 2003-09-17 09:24:08 EDT
Problem comes from fix for bug 26706 which creates an invalid handle, 
preventing from computing resource file location from handle (during working 
copy commit).

Removed extra code, which did not behave properly, given now we support 
correctly reading and writing such working copies which do not exist from the 
model angle.

Regression test added: WorkingCopyNotInClasspathTests#testCommit2

Fixed
Comment 7 David Audel CLA 2003-10-08 09:59:13 EDT
test name is testReconcileAndCommit2() and not testCommit2().

Verified.