Bug 4021 - jdt: Java elements and resources: error in source code (1GG87S9)
Summary: jdt: Java elements and resources: error in source code (1GG87S9)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P4 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 23:04 EDT by Martin Aeschlimann CLA
Modified: 2002-02-07 13:35 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2001-10-10 23:04:44 EDT
MA (7/2/01 9:45:08 AM)
	The documentation and the example source code states that
		JavaCore.create(myProject)
	would return null if the project is not yet configured as a Java project.

	This is not the case. All 'create' routines return you handles, that do not have to
	be created nor in java projects or on any class path. The Java nature could only be
	attached to a created project. 
	
	I can see that the Javadoc on create is very fuzzy about when null can be returned, and
	I don't know what is current idea of the design.

		private void createJavaElementsFrom(IProject myProject, 
  			  IFolder myFolder, IFile myFile) {

   			  IJavaProject myJavaProject = JavaCore.create(myProject);
				// the project is not configured for Java (has no Java nature)  <<
       				 return;

NOTES:

GDA (8/6/01 9:48:53 PM)
	Moving to JDT inbox for any replacement words from EG.
	Defer to 2.0
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:12:47 EDT
moved to 'active'
Comment 2 DJ Houghton CLA 2001-10-24 07:28:10 EDT
PRODUCT VERSION:
	0.125

Comment 3 Erich Gamma CLA 2001-11-11 06:31:46 EST
moving to CORE for comment
Comment 4 Philipe Mulet CLA 2002-01-27 09:50:04 EST
Usually handles can be created even if they do not exist, along the same line, 
I would vote for this project handle to be created but not existing (if asked).

Comment 5 Jerome Lanneluc CLA 2002-02-06 08:38:00 EST
Updated spec for JavaCore.create(IProject) to state that the handle is always 
return and that no check is done on the existence or the java nature of the 
project.