Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321807 - JET transformation in new installed bundles can't come to work
Summary: JET transformation in new installed bundles can't come to work
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Jet (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 21:25 EDT by Hoiyor Chen CLA
Modified: 2020-05-01 16:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hoiyor Chen CLA 2010-08-04 21:25:37 EDT
Build Identifier: 201001291720

I have a deployed JET transformation in an Eclipse plugin bundle. And I install the bundle into eclipse dynamically. 

But the registry change event can't be handled successfully by DeployedJETBundleProvider.

The newly deployed JET transformation can't come to work.

I think DeployedJETBundleProvider.java may be changed as:
  
  public void startup()
  {
    IExtensionRegistry reg = Platform.getExtensionRegistry();
    IConfigurationElement[] configElements = reg.getConfigurationElementsFor(EXTENSION_POINT_ID);
    addTransforms(configElements);

    // reg.addRegistryChangeListener(this, EXTENSION_POINT_ID);
    // EXTENSION_POINT_ID should be PLUGIN_ID
    reg.addRegistryChangeListener(this, PLUGIN_ID);

  }

  public void registryChanged(IRegistryChangeEvent event)
  {

    // IExtensionDelta[] deltas = event.getExtensionDeltas(EXTENSION_POINT_ID);
    // EXTENSION_POINT_ID should be PLUGIN_ID
    IExtensionDelta[] deltas = event.getExtensionDeltas(PLUGIN_ID);

    for (int i = 0; i < deltas.length; i++)
    {
      IExtension ext = deltas[i].getExtension();
      if (deltas[i].getKind() == IExtensionDelta.ADDED)
      {
        addTransforms(ext.getConfigurationElements());
      }
      else
      {
        removeTransforms(ext.getConfigurationElements());
      }
    }
  }

Reproducible: Always

Steps to Reproduce:
See details in Details :-)
Comment 1 Hoiyor Chen CLA 2010-08-05 21:26:13 EDT
Recommend code modification update:

  public void startup()
  {
    IExtensionRegistry reg = Platform.getExtensionRegistry();
    IConfigurationElement[] configElements =
reg.getConfigurationElementsFor(EXTENSION_POINT_ID);
    addTransforms(configElements);

    // reg.addRegistryChangeListener(this, EXTENSION_POINT_ID);
    // EXTENSION_POINT_ID should be PLUGIN_ID
    reg.addRegistryChangeListener(this, PLUGIN_ID);

  }

  public void registryChanged(IRegistryChangeEvent event)
  {

    // IExtensionDelta[] deltas = event.getExtensionDeltas(EXTENSION_POINT_ID);
    // EXTENSION_POINT_ID should be PLUGIN_ID, EXTENSION_NAME
    IExtensionDelta[] deltas = event.getExtensionDeltas(PLUGIN_ID, EXTENSION_NAME);

    for (int i = 0; i < deltas.length; i++)
    {
      IExtension ext = deltas[i].getExtension();
      if (deltas[i].getKind() == IExtensionDelta.ADDED)
      {
        addTransforms(ext.getConfigurationElements());
      }
      else
      {
        removeTransforms(ext.getConfigurationElements());
      }
    }
  }