Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545746

Summary: common test feature builds failing after removal of IPluginDescriptor and related API
Product: [WebTools] WTP Common Tools Reporter: Nitin Dahyabhai <thatnitind>
Component: wst.commonAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: blocker    
Priority: P3 CC: daniel_megert, ed, nboldt
Version: 3.13   
Target Milestone: 3.14   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=475944
https://git.eclipse.org/r/139457
https://git.eclipse.org/c/webtools-common/webtools.common.git/commit/?id=d75321b1616b7ee3c9caf8c1d1db40cc7003f215
https://git.eclipse.org/r/139953
https://git.eclipse.org/c/webtools-common/webtools.common.git/commit/?id=899671804d3f482e01beafdc126ea30ea5222f30
Whiteboard:

Description Nitin Dahyabhai CLA 2019-03-25 08:38:28 EDT
The removal of IPluginDescriptor and related API in bug 475944 is causing builds to break.

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.3.0:compile (default-compile) on project org.eclipse.wst.common.tests.collector: Compilation failure: Compilation failure: 
[ERROR] /jobs/genie.webtools/webtools-common_master/workspace/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorPlugin.java:[14] 
[ERROR] 	import org.eclipse.core.runtime.IPluginDescriptor;
[ERROR] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.core.runtime.IPluginDescriptor cannot be resolved
[ERROR] /jobs/genie.webtools/webtools-common_master/workspace/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorPlugin.java:[26] 
[ERROR] 	public TestCollectorPlugin(IPluginDescriptor descriptor) {
[ERROR] 	                           ^^^^^^^^^^^^^^^^^
[ERROR] IPluginDescriptor cannot be resolved to a type
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.eclipse.wst.common.tests.collector
Comment 1 Nick Boldt CLA 2019-03-25 16:50:34 EDT
This change is also breaking downstream projects like javaee and jsf. 

[ERROR] The import org.eclipse.core.runtime.IPluginDescriptor cannot be resolved -- https://hudson.eclipse.org/webtools/view/webtools_CI/job/webtools-common_master/572/console

[ERROR] The constructor EMFPlugin.EclipsePlugin(IPluginDescriptor) is undefined -- https://hudson.eclipse.org/webtools/view/webtools_CI/job/webtools-javaee_master/396/console

[ERROR] The import org.eclipse.core.runtime.IPluginDescriptor cannot be resolved -- https://hudson.eclipse.org/webtools/view/webtools_CI/job/webtools-jsf_master/502/console
Comment 2 Eclipse Genie CLA 2019-03-25 17:02:10 EDT
New Gerrit change created: https://git.eclipse.org/r/139457
Comment 4 Nitin Dahyabhai CLA 2019-03-25 18:02:16 EDT
Fixed in common. Downstream projects are a little more challenging.
Comment 5 Ed Willink CLA 2019-03-27 10:23:30 EDT
You seem to be ignoring the standard idiom that the default constructor populates the singleton instance.

Your deletion of:

public TestCollectorPlugin(IPluginDescriptor descriptor) {
	super(descriptor);
	instance = this;
	dataModelVerifierExt = descriptor.getExtensionPoint("DataModelVerifier");
}

solves the problem with the deprecated IPluginDescriptor but leaves the instance orphaned. Surely you meant?

public TestCollectorPlugin() {
	instance = this;
	RegistryFactory.getRegistry().getExtensionPoint(PLUGIN_ID, "DataModelVerifier");
}
Comment 6 Eclipse Genie CLA 2019-04-03 09:02:40 EDT
New Gerrit change created: https://git.eclipse.org/r/139953
Comment 7 Nitin Dahyabhai CLA 2019-04-03 09:03:33 EDT
(In reply to Ed Willink from comment #5)
> You seem to be ignoring the standard idiom that the default constructor
> populates the singleton instance.

Good catch, but there were no accessor methods for the singleton, and I believe nothing accessing it directly, either. Checking an additional change to remove it outright (arguably the entire class is unnecessary).