Bug 546670 - [Databinding] API warnings on databinding classes
Summary: [Databinding] API warnings on databinding classes
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.12 M3   Edit
Assignee: Jens Lideström CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 531748
Blocks:
  Show dependency tree
 
Reported: 2019-04-23 13:58 EDT by Jens Lideström CLA
Modified: 2019-07-24 07:38 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Lideström CLA 2019-04-23 13:58:44 EDT
Several of the platform databinding classes gives API usage warnings liketh these:

IBeanListProperty<S, E> illegally implements IListProperty<S, E> IBeanListProperty<S, E> illegally implements IProperty via IBeanProperty IBeanListProperty<S, E> implements non-API interface IBeanProperty

This applies to classes in the following plug-ins (but perhaps a few more):

org.eclipse.core.databinding.beans
org.eclipse.jface.databinding

These warnings do not indicate any real problems and they should be removed in some way. Perhaps be simply adding problems filters for them.
Comment 1 Dani Megert CLA 2019-04-24 08:34:48 EDT
You probably have a setup issue.

There's only one justified API Tools warning reported in both, my workspace and the official build:
https://download.eclipse.org/eclipse/downloads/drops4/I20190423-1800/apitools/analysis/html/org.eclipse.core.databinding.beans/report.html
Comment 2 Lars Vogel CLA 2019-04-24 08:44:00 EDT
Jens, is this based on current master or based on your generification work?
Comment 3 Lars Vogel CLA 2019-04-24 09:43:39 EDT
I see these errors also with the https://git.eclipse.org/r/c/127805 patch.
Comment 4 Lars Vogel CLA 2019-04-24 09:45:33 EDT
Looks like an API Tools error to me. 

To validate: 

1.) Fetch https://git.eclipse.org/r/c/127805 (or wait until it is merged)
2.) Check org.eclipse.core.databinding which reports 

Description	Path	Resource	Location	Type
Converter<F, T> implements non-API interface IConverter<F, T>	/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion	Converter.java	line 28	API Usage Problem


3.) IConverter is API hence the API tooling seems to report it wrong.
Comment 5 Dani Megert CLA 2019-04-24 09:48:33 EDT
(In reply to Lars Vogel from comment #4)
> Looks like an API Tools error to me. 
> 
> To validate: 
> 
> 1.) Fetch https://git.eclipse.org/r/c/127805 (or wait until it is merged)
> 2.) Check org.eclipse.core.databinding which reports 
> 
> Description	Path	Resource	Location	Type
> Converter<F, T> implements non-API interface IConverter<F, T>
> /org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion
> Converter.java	line 28	API Usage Problem
> 
> 
> 3.) IConverter is API hence the API tooling seems to report it wrong.
This is different from what was originally reported.

I suggest we wait until this is in master and then open a bug report if API Tools really complains.
Comment 6 Jens Lideström CLA 2019-04-24 09:50:52 EDT
(In reply to Dani Megert from comment #1)
> You probably have a setup issue.
> 
> There's only one justified API Tools warning reported in both, my workspace
> and the official build:
> https://download.eclipse.org/eclipse/downloads/drops4/I20190423-1800/
> apitools/analysis/html/org.eclipse.core.databinding.beans/report.html

It might be so.

But I submitted this bug report after Karsten Thoms made a comment about it in his code review:

https://git.eclipse.org/r/#/c/127805/30/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/IBeanListProperty.java@28

I think I maybe didn't get these warnings when building with Tycho, but only when building with Eclipse and PDE. I will double check that and get back to you.

@Dani Mergert:
Did you build your workspace with Tycho or Eclipse IDE?

(In reply to Lars Vogel from comment #2)
> Jens, is this based on current master or based on your generification work?

This also affect the master. I have seen these warnings for a long time.
Comment 7 Dani Megert CLA 2019-04-24 09:56:34 EDT
(In reply to Jens Lideström from comment #6)
> @Dani Mergert:
> Did you build your workspace with Tycho or Eclipse IDE?
I don't fiddle with Tycho ;-).  I looked in my IDE and in the official report and both say the same.
Comment 8 Lars Vogel CLA 2019-04-26 04:09:06 EDT
The  messages, e.g., org.eclipse.core.databinding.observable.AbstractObservable implements non-API interface org.eclipse.core.databinding.observable.IObservable) seem wrong. IObservable is released as API.
Comment 9 Lars Vogel CLA 2019-04-26 04:09:32 EDT
Vikas, please have a look and advice.
Comment 10 Dani Megert CLA 2019-04-26 04:41:05 EDT
Note that (In reply to Dani Megert from comment #1)
> You probably have a setup issue.
> 
> There's only one justified API Tools warning reported in both, my workspace
> and the official build:
> https://download.eclipse.org/eclipse/downloads/drops4/I20190423-1800/apitools/analysis/html/org.eclipse.core.databinding.beans/report.html
> 

With the latest in workspace, I get the same 9 warnings as in the latest official build:
https://download.eclipse.org/eclipse/downloads/drops4/I20190425-1800/apitools/analysis/html/org.eclipse.core.databinding.beans/report.html

As you can see on https://download.eclipse.org/eclipse/downloads/drops4/S-4.12M1-201904110625/apitools/analysis/html/index.html many plug-ins have 'API Usage Warnings'.

I suggest you simply check whether you introduced a new dependency and if so, whether it's justified.
Comment 11 Lars Vogel CLA 2019-04-26 04:45:04 EDT
(In reply to Dani Megert from comment #10)
> With the latest in workspace, I get the same 9 warnings as in the latest
> official build:

I also get the same warnings in my IDE. But I think they are wrong.Example:

Description	Path	Resource	Location	Type
ListProperty<S, E> implements non-API interface IListProperty<S, E>	/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/list	ListProperty.java	line 43	API Usage Problem

If you check the MANIFEST you will see that org.eclipse.core.databinding.property.list.IListProperty is API. 

Quote:
Export-Package: org.eclipse.core.databinding.property,
 org.eclipse.core.databinding.property.list,

So I think the API tools report an incorrect error. If you disagree, please explain why IListProperty is not API.
Comment 12 Dani Megert CLA 2019-04-26 05:05:03 EDT
(In reply to Lars Vogel from comment #11)
> (In reply to Dani Megert from comment #10)
> > With the latest in workspace, I get the same 9 warnings as in the latest
> > official build:
> 
> I also get the same warnings in my IDE. But I think they are wrong.Example:
> 
> Description	Path	Resource	Location	Type
> ListProperty<S, E> implements non-API interface IListProperty<S, E>
> /org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/list
> ListProperty.java	line 43	API Usage Problem
> 
> If you check the MANIFEST you will see that
> org.eclipse.core.databinding.property.list.IListProperty is API. 
> 
> Quote:
> Export-Package: org.eclipse.core.databinding.property,
>  org.eclipse.core.databinding.property.list,
> 
> So I think the API tools report an incorrect error. If you disagree, please
> explain why IListProperty is not API.
Oh, this is a very simple one to explain. Just look at IListProperty:

 * @noimplement This interface is not intended to be implemented by clients.
Comment 13 Lars Vogel CLA 2019-04-26 05:12:20 EDT
(In reply to Dani Megert from comment #12)
> > So I think the API tools report an incorrect error. If you disagree, please
> > explain why IListProperty is not API.
> Oh, this is a very simple one to explain. Just look at IListProperty:
> 
>  * @noimplement This interface is not intended to be implemented by clients.

Face palm... Sorry for this. So far I only used @noimplement for API deprecations.

Jens, please have a look and provide a Gerrit.
Comment 14 Dani Megert CLA 2019-04-26 05:15:59 EDT
(In reply to Lars Vogel from comment #13)
> (In reply to Dani Megert from comment #12)
> > > So I think the API tools report an incorrect error. If you disagree, please
> > > explain why IListProperty is not API.
> > Oh, this is a very simple one to explain. Just look at IListProperty:
> > 
> >  * @noimplement This interface is not intended to be implemented by clients.
> 
> Face palm... Sorry for this. So far I only used @noimplement for API
> deprecations.
> 
> Jens, please have a look and provide a Gerrit.
I'm not sure that this usage is new, but Jens has to check. See comment 10.
Comment 15 Lars Vogel CLA 2019-04-26 05:23:29 EDT
(In reply to Dani Megert from comment #14)
> I'm not sure that this usage is new, but Jens has to check. See comment 10.

Adding an API filter to suppress that still seems desirable, even if it is not new.
Comment 16 Dani Megert CLA 2019-04-26 08:21:50 EDT
(In reply to Lars Vogel from comment #15)
> (In reply to Dani Megert from comment #14)
> > I'm not sure that this usage is new, but Jens has to check. See comment 10.
> 
> Adding an API filter to suppress that still seems desirable, even if it is
> not new.
As you can see in the report we usually don't do this. It allows to see the non-clean usages/dependencies. It might also give hints about future API additions to fix an issue. Anyway, I'm fine either way here.
Comment 17 Jens Lideström CLA 2019-04-27 08:22:47 EDT
To me the following things seem clear the the API warnings about usage of non-API classes:

* The API tooling works correctly. It is supposed to generate warnings in these cases.
* The warnings are not because of any problem with the code. Instead they are because one logical component (the databinding system) is separated into multiple bundles.

The databinding system consists of the following bundles:

* org.eclipse.core.databinding
* org.eclipse.core.databinding.properties
* org.eclipse.jface.databinding
* etc

These bundles have the right to extend interfaces that are marked with @noimplement.

I looked at the logs in the old release builds [1]. The first build in which I see these warnings is 4.7 [2].

Why they appeared in this build I don't understand. The first phase of the generification of databinding was delivered in 4.6, the next phase in 4.9. (See the News repo.)

Maybe the API verification tooling changed between 4.6.3 and 4.7 to emit these warnings?

### Conclusion

The usages of @noimplement interfaces in the databiding bundles is "clean", and we should add API problem filters to suppress the warnings.

I'll create a change with such filters.

[1]: https://archive.eclipse.org/eclipse/downloads/
[2]: https://archive.eclipse.org/eclipse/downloads/drops4/R-4.7-201706120950/apitools/analysis/html/index.html
Comment 19 Lars Vogel CLA 2019-04-27 10:44:25 EDT
Thanks, Jens.
Comment 20 Dani Megert CLA 2019-04-28 09:57:22 EDT
(In reply to Jens Lideström from comment #17)
> To me the following things seem clear the the API warnings about usage of
> non-API classes:
> 
> * The API tooling works correctly. It is supposed to generate warnings in
> these cases.
> * The warnings are not because of any problem with the code. Instead they
> are because one logical component (the databinding system) is separated into
> multiple bundles.
> 
> The databinding system consists of the following bundles:
> 
> * org.eclipse.core.databinding
> * org.eclipse.core.databinding.properties
> * org.eclipse.jface.databinding
> * etc
> 
> These bundles have the right to extend interfaces that are marked with
> @noimplement.
No they don't. Just because the name is the same it's not OK.