Bug 18698

Summary: Seeing non-java projects in package view
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: James_Moody
Version: 2.0   
Target Milestone: 2.0 F3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Package view showing non-java project jdt-core-home none

Description Philipe Mulet CLA 2002-06-03 09:13:49 EDT
Build F2

Unclear how I got there, but at some point project jdt-core-home was listed 
amongst the Java project, and package view was still operating fine.
Comment 1 Philipe Mulet CLA 2002-06-03 09:15:12 EDT
Created attachment 1173 [details]
Package view showing non-java project jdt-core-home
Comment 2 Philipe Mulet CLA 2002-06-03 09:16:03 EDT
Closing / reopening fixed the problem...
Comment 3 Philipe Mulet CLA 2002-06-03 11:55:34 EDT
Cannot reproduce anymore...
Comment 4 Philipe Mulet CLA 2002-06-04 06:50:44 EDT
Looking at the implementation of DeltaProcessor, a delta can be issued when 
adding a new file onto a non-java project (non-java resource handling):

- create project SimpleP (simple project)
- add file 'titi.txt'

Java Model[*]: {CHILDREN}
	SimpleP[*]: {CONTENT}
		ResourceDelta(/SimpleP/titi.txt)[+]
Comment 5 Philipe Mulet CLA 2002-06-04 06:58:30 EDT
Steps to reproduce original defect are actually:
- create non-java project
- add a zip file into it

Package view now shows ALL non java projects !
Comment 6 Philipe Mulet CLA 2002-06-04 07:29:20 EDT
More Steps (previous set is not enough to trigger UI refresh exposing bogus 
state).

- create Java project JP
- create simple project SP1
- add toto.txt file to SP1
- open package view (in cloned perspective), observe that only JP is visible
- in resource perspective, close JP then reopen it
- observe that package view now shows both JP and SP !?
Comment 7 Philipe Mulet CLA 2002-06-04 07:30:32 EDT
There are 2 defects:

- non-java projects should never be added to the cache of Java projects
- non-java resource deltas should never be computed for non-java projects
Comment 8 Philipe Mulet CLA 2002-06-04 07:47:57 EDT
Fixed, need a regression test.
Comment 9 Jerome Lanneluc CLA 2002-06-04 09:35:37 EDT
Double-checked change in DeltaProcessor.
Comment 10 Jerome Lanneluc CLA 2002-06-04 09:39:39 EDT
Added regression tests: JavaModelTests.testAddFileToNonJavaProject() and 
JavaElementDeltaTests.testAddFileToNonJavaProject().
Comment 11 Olivier Thomann CLA 2002-06-04 13:47:10 EDT
Verified.
Comment 12 Erich Gamma CLA 2002-06-07 10:19:42 EDT
*** Bug 19548 has been marked as a duplicate of this bug. ***
Comment 13 David Audel CLA 2002-06-13 09:03:40 EDT
Verified.