Fwd: Question regarding JavaType existence
Geoff Longman <[email protected]> Mon, 6 Feb 2006 13:08:10 -0500
| Newsgroups | gmane.comp.ide.eclipse.spindle.devel |
|---|---|
| Message-ID | <[email protected]> |
rats, when I hit reply in gmail the message doesn't go to the list. G. ---------- Forwarded message ---------- From: Geoff Longman <[email protected]> Date: Feb 6, 2006 1:07 PM Subject: Re: [Spindle-developer] Question regarding JavaType existence To: Hugo Palma <[email protected]> The JDT's IType.exists() just works in all cases :-) Actually, behind the scenes JDT is caching metadata (using a complicated LRU cache) about the type. It detects the removal of classpath entries and invalidates the all the metadata it holds for, among other things, any IType in the removed entities (like jars). So, if later I call exists(), the metadata is gone and JDT tries to recreate it. But it can't (the jar is gone) so exists() returns false. The key to all the above is that JDT only looks at jars that are in the classpath. They can still be in the project but if they aren't in the classpath they are just files to JDT and not interesting at all. IDEA doesn't have a similar concept? perhaps the PSI tree for the type becomes inaccessible once the jar is removed from the classpath? Geoff On 2/6/06, Hugo Palma <[email protected]> wrote: > I was creating some tests and a problem came up with my implementation of > the exists() method of the IJavaType. > > Like you said before, the exists() should return false if the underlying > real type is deleted. This is easy when you're talking about source types, > but gets tricky when it comes to classpath types. The problem is that at the > time the type is returned the project has the library in it's classpath, > sometime after that it's possible that the library was removed from the > project classpath, althout the .jar is still there. The exists() method > should return false now. I checked your implementation in > com.iw.plugins.spindle.core.eclipse.lang.EclipseJavaType > and all you do is call the IType.exists() method. Does Eclipse > implementation provide this behaviour ? > > I can of course implement this behaviour but after i checked your > implementation to see how you handled this i just started to think if i > could be seeing problems where there are none. > > > Cheers > > Hugo > -- The Spindle guy. http://spindle.sf.net Get help with Spindle: http://lists.sourceforge.net/mailman/listinfo/spindle-user Blog: http://jroller.com/page/glongman Feature Updates: http://spindle.sf.net/updates -- The Spindle guy. http://spindle.sf.net Get help with Spindle: http://lists.sourceforge.net/mailman/listinfo/spindle-user Blog: http://jroller.com/page/glongman Feature Updates: http://spindle.sf.net/updates ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642