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

Bug 463706

Summary: Reduce the number of warnings for org.osgi.* classes by using the "Ignore optional compile problems" option
Product: [Eclipse Project] Equinox Reporter: Szymon Ptaszkiewicz <sptaszkiewicz>
Component: FrameworkAssignee: Szymon Ptaszkiewicz <sptaszkiewicz>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: tjwatson
Version: 4.5.0 Mars   
Target Milestone: Mars M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/45038
https://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=906b6219c22e8536de3e43c84d59c4aa00083300
https://git.eclipse.org/r/45053
https://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=57279b17df199dd506da2fb0b072df4ccf64bdc9
Whiteboard:
Bug Depends on:    
Bug Blocks: 507055    

Description Szymon Ptaszkiewicz CLA 2015-04-01 12:24:43 EDT
It just came to me that the org.eclipse.osgi bundle contains a copy of the OSGi classes in the osgi/src source folder. These classes produce 633 out of 831 warnings for the whole bundle. Since these classes are just copies of the OSGi classes, we can't (if I understand it correctly) fix locally these warnings because they would have to be fixed in the main OSGi code base and only then pulled into the org.eclipse.osgi bundle. This means there is really nothing useful we can do with all these warnings.

We can significantly reduce the number of warnings produced by these classes by enabling the "Ignore optional compile problems" option for the source folder which contains them. This would remove all warnings that are produced by the Java builder without reducing the verbosity of the compiler for other source folders in this project. I will push a patch to Gerrit to demonstrate it.

Note: The same thing could be done with org.apache.felix.resolver package if it was moved to a separate source folder.
Comment 1 Eclipse Genie CLA 2015-04-01 12:28:12 EDT
New Gerrit change created: https://git.eclipse.org/r/45038
Comment 2 Thomas Watson CLA 2015-04-01 12:30:21 EDT
Thanks Szymon, your analysis is correct, we cannot modify these osgi sources.  Is this a new option to change have different error/warnings based on the source folder.  I seem to recall looking for such an option in the past but never found it.
Comment 3 Szymon Ptaszkiewicz CLA 2015-04-01 12:31:25 EDT
(In reply to Thomas Watson from comment #2)
> Thanks Szymon, your analysis is correct, we cannot modify these osgi
> sources.  Is this a new option to change have different error/warnings based
> on the source folder.  I seem to recall looking for such an option in the
> past but never found it.

Yes, I should have mentioned that this option is available in the Properties of each source folder in the Java Compiler section.
Comment 4 Szymon Ptaszkiewicz CLA 2015-04-01 12:34:56 EDT
If you agree, I can also prepare a patch to move the org.apache.felix.resolver package to a separate source folder, e.g. felix/src so that we could do the same there. This package produces another 171 warnings.
Comment 6 Thomas Watson CLA 2015-04-01 12:42:38 EDT
(In reply to Szymon Ptaszkiewicz from comment #4)
> If you agree, I can also prepare a patch to move the
> org.apache.felix.resolver package to a separate source folder, e.g.
> felix/src so that we could do the same there. This package produces another
> 171 warnings.

+1 to that.  Thanks!
Comment 7 Szymon Ptaszkiewicz CLA 2015-04-01 12:48:11 EDT
Thanks, Tom, that was quicker than I expected :)

I will open a separate bug for org.apache.felix.resolver.
Comment 8 Szymon Ptaszkiewicz CLA 2015-04-01 13:02:01 EDT
(In reply to Szymon Ptaszkiewicz from comment #7)
> I will open a separate bug for org.apache.felix.resolver.

See bug 463710.
Comment 9 Szymon Ptaszkiewicz CLA 2015-04-01 13:33:45 EDT
It turned out that org.osgi.* classes appear also in projects other than org.eclipse.osgi, namely org.eclipse.osgi.services and org.eclipse.osgi.util. I guess we can do the same there.

Tom, are you fine with that?
Comment 10 Eclipse Genie CLA 2015-04-01 13:43:24 EDT
New Gerrit change created: https://git.eclipse.org/r/45053
Comment 12 Thomas Watson CLA 2015-04-02 07:56:03 EDT
Thanks!  I have merged the changes to services and utils.