Summary: | Classpath variable/container initializer should activate plugins | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Richard Kulp <richkulp> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | ramanday |
Version: | 2.0.1 | ||
Target Milestone: | 2.1 M2 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Richard Kulp
2002-09-23 17:48:44 EDT
Just to be clear, I meant it should activate the plugin only if there is an initializer for the desired variable/container in that plugin. I didn't mean to imply activate all of the plugins with initializer extension points and then search for an initializer. Variable values are cached in between session, thus it will not request an extension point call to awake the plug-in owning the variable, if it was bound previously. This was meant to avoid eager plug-in loading. However, this causes problem in case the plug-in owning the variable would need to bind the variable differently that in the past, as you correctly stated it. We may want to revisit this behavior. For containers, we do not persist container values in between sessions, so each time a container needs to be resolved, its registered initializer is activated; no matter if its declaring plug-in is already loaded or not. What makes you think we do not find all registered initializers ? Do you have steps to reproduce the problem ? I have Eclipse 2.0.1: This is the code itself, which shows that it only looks in plugins that are already activated: JavaCore.getClasspathVariableInitializer(String variable){ ... IPluginDescriptor plugin = extension.getDeclaringPluginDescriptor(); if (plugin.isPluginActivated()) { ... And the same test is made in JavaCore.getClasspathVariableInitializer(String variable); So it only looks at initializers that are in plugins that are already activated. You are completely right, will change this asap. Will also likely remove registered variables value caching (in between sessions) as well. Actually, the plugin is the one defining the extension point (i.e. jdtcore) so it is always activated at this point. So if "(plugin.isPluginActivated())" was always true. Thanks Jerome for pointing this out. This being said, we still have the issue about persisted CP variable values taking precedence over registered initializers, and we are going to change it. Richard - Do you confirm that this is the only offending behavior you are seeing ? I got confused, I saw extension.getDeclaringPluginDescriptor() inside the loop, so on a quick glance I thought it was for extensions[i], the current extension, which would be for different plugins. In the position that piece of code is at it is an invarient, it never changes during the loop. It should probably be removed since it is always true. Sounds good about not caching, but removing caching can only be done on variables that have initializers. Those that don't were created in some other way, such as by the user, and should still be cached. Of course <g>, and we removed the unnecessary activation check as well. The new behavior, wrt caching, is to only consider persisted values for variables which have no registered initializer. This means that even if at some a variable had one, its last value will be preserved if it ends up on a platform where no such initializer is available anymore. Then I'm satisfied that my requirements will be met. Thanks, Rich *** Bug 24233 has been marked as a duplicate of this bug. *** Verified. |