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

Bug 490770

Summary: Freeze report should mention compatible changes
Product: [Eclipse Project] PDE Reporter: Markus Keller <markus.kell.r>
Component: API ToolsAssignee: Vikas Chandra <Vikas.Chandra>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Lars.Vogel, Olivier_Thomann, Vikas.Chandra
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 492238, 492337    
Attachments:
Description Flags
Proposed patch
none
Proposed patch including updated regression tests
none
new report format
none
Updated patch to put incompatible changes in red
none
Message not found in report_freeze.html none

Description Markus Keller CLA 2016-03-31 06:28:47 EDT
Bug 490658 changed
    public StructuredSelection(Object[] elements) {..}
to
    public StructuredSelection(Object... elements) {..}

https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=56fcb25766839e93cfb00924fc1dc00a2603db61

This is a compatible API change that should have been reported in http://download.eclipse.org/eclipse/downloads/drops4/I20160330-1230/apitools/freeze_report.html

Compare With > API Baseline... correctly says:
"Replaced an array type with a variable argument type in constructor org.eclipse.jface.viewers.StructuredSelection.StructuredSelection(Object[])"

Note that this change was only present in that build and has been reverted in master.
Comment 1 Markus Keller CLA 2016-04-08 08:26:21 EDT
The freeze report also missed a change in a static final field declaration (from non-constant to compile-time constant).

The change was reverted in master with https://git.eclipse.org/r/#/c/70032/ , but it was present in N20160406-2000 although the report missed it: http://download.eclipse.org/eclipse/downloads/drops4/N20160406-2000/apitools/freeze_report.html

=> known undetected API changes:
- method signature change from array to varargs
- static final field change from non-constant to compile-time constant
Comment 2 Olivier Thomann CLA 2016-04-08 10:17:50 EDT
I can take a quick look at this if you want, Markus.
Comment 3 Dani Megert CLA 2016-04-08 11:39:35 EDT
(In reply to Olivier Thomann from comment #2)
> I can take a quick look at this if you want, Markus.

That would be great!
Comment 4 Olivier Thomann CLA 2016-04-08 17:16:24 EDT
With my current set of changes, new entries are needed in the freeze exclude list.

org.eclipse.compare.core:org.eclipse.compare.core:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.compare.win32:org.eclipse.compare.win32:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.compare:org.eclipse.compare:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.core.net.win32.x86_64:org.eclipse.core.net.win32.x86_64:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.core.net:org.eclipse.core.net:EXECUTION_ENVIRONMENT=CDC-1.1/Foundation-1.1
org.eclipse.core.net:org.eclipse.core.net:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.jsch.core:org.eclipse.jsch.core:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.jsch.ui:org.eclipse.jsch.ui:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.team.core:org.eclipse.team.core:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.team.cvs.core:org.eclipse.team.cvs.core:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.team.cvs.ssh2:org.eclipse.team.cvs.ssh2:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.team.cvs.ui:org.eclipse.team.cvs.ui:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.team.ui:org.eclipse.team.ui:EXECUTION_ENVIRONMENT=J2SE-1.4
org.eclipse.ui.net:org.eclipse.ui.net:EXECUTION_ENVIRONMENT=J2SE-1.4

These are the two entries related to compile time constants that are not required to be added since this is fixed:
org.eclipse.jdt.core:org.eclipse.jdt.core.ToolFactory#M_FORMAT_EXISTING
org.eclipse.jdt.core:org.eclipse.jdt.core.ToolFactory#M_FORMAT_NEW

This is the entry that would have been displayed for the array to varargs change:
org.eclipse.jface:org.eclipse.jface.viewers.StructuredSelection#StructuredSelection([Ljava/lang/Object;)V

So both issues would now be returned. The execution environment entries above are required in the exclude list. Patch to follow.
Comment 5 Olivier Thomann CLA 2016-04-08 17:16:43 EDT
Created attachment 260814 [details]
Proposed patch
Comment 6 Olivier Thomann CLA 2016-04-11 11:28:14 EDT
I delivered the fix.
Comment 7 Lars Vogel CLA 2016-04-11 12:15:45 EDT
Thanks Olivier. For reference I think this is the relevant commit: 

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=23572f6241d42dbeddb6371c0b3a822c5d6bd658
Comment 8 Dani Megert CLA 2016-04-25 04:51:42 EDT
We upgraded to the latest API Tools in our build and got a confusing freeze report:
http://download.eclipse.org/eclipse/downloads/drops4/N20160423-1500/apitools/freeze_report.html

Several of these (for different bundles):
REMOVED	org.eclipse.ui.intro.universal#J2SE-1.4(Execution Environment)

I know you said we have to exclude this, but didn't do so yet. I would rather expect
CHANGED	org.eclipse.ui.intro.universal#J2SE-1.4 to JavaSE-1.8 (Execution Environment)


ADDED	org.eclipse.jdt.ui.actions.WorkingSetFindAction

This action exists since many years, hence clearly a false positive.


If we also show compatible changes, we need to see this difference in the report, i.e. incompatible versus compatible changes.


I've reverted the change with
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=f24b3fafdcfabe19dfa757a25b33ce6b9ca06c9c
so that we can build a new version of the API Tools which we can then use in the build itself.


If you have time to look at this, we can still put it into M7 or RC1.
Comment 9 Dani Megert CLA 2016-04-25 05:15:57 EDT
(In reply to Dani Megert from comment #8)
> Several of these (for different bundles):
> REMOVED	org.eclipse.ui.intro.universal#J2SE-1.4(Execution Environment)
> 
> I know you said we have to exclude this, but didn't do so yet. I would
> rather expect
> CHANGED	org.eclipse.ui.intro.universal#J2SE-1.4 to JavaSE-1.8 (Execution
> Environment)

Or have a corresponding ADDED entry
ADDED org.eclipse.ui.intro.universal#JavaSE-1.8 (Execution Environment)
Comment 10 Dani Megert CLA 2016-04-25 05:46:34 EDT
It looks like the change in DeltaXmlVisitor.processLeafDelta(IDelta) caused bug 492337:

Instead of
  flags = 72
the entries have
  flags = DEPRECATION


Let's see whether reverting also fixes bug 492337.
Comment 11 Olivier Thomann CLA 2016-04-25 10:15:45 EDT
I'll take a look at bug 492337.
Comment 12 Olivier Thomann CLA 2016-04-25 11:30:30 EDT
(In reply to Dani Megert from comment #9)
> Or have a corresponding ADDED entry
> ADDED org.eclipse.ui.intro.universal#JavaSE-1.8 (Execution Environment)
This is what I have done.
Comment 13 Dani Megert CLA 2016-04-25 13:20:55 EDT
(In reply to Olivier Thomann from comment #12)
> (In reply to Dani Megert from comment #9)
> > Or have a corresponding ADDED entry
> > ADDED org.eclipse.ui.intro.universal#JavaSE-1.8 (Execution Environment)
> This is what I have done.

You mean now? Currently it's not in the report as you can see.
Comment 14 Olivier Thomann CLA 2016-04-25 13:22:57 EDT
(In reply to Dani Megert from comment #13)
> (In reply to Olivier Thomann from comment #12)
> > (In reply to Dani Megert from comment #9)
> > > Or have a corresponding ADDED entry
> > > ADDED org.eclipse.ui.intro.universal#JavaSE-1.8 (Execution Environment)
> > This is what I have done.
> You mean now? Currently it's not in the report as you can see.
I mean I fixed it :-)

(In reply to Dani Megert from comment #8)
> ADDED	org.eclipse.jdt.ui.actions.WorkingSetFindAction
The problem comes from the display of what has been found.
The message from the delta is:
"The method org.eclipse.jdt.ui.actions.WorkingSetFindAction.run(IJavaElement[]) has been added, overriding a method from a superclass"
which is true. I am trying not to filter any delta and instead require a filter to be added for them. So in this case, I can filter it right way or I can improve the way the delta is reported requiring an exclusion to be added.
Let me know what you prefer.
Comment 15 Dani Megert CLA 2016-04-25 13:31:49 EDT
(In reply to Olivier Thomann from comment #14)
> (In reply to Dani Megert from comment #13)
> > (In reply to Olivier Thomann from comment #12)
> > > (In reply to Dani Megert from comment #9)
> > > > Or have a corresponding ADDED entry
> > > > ADDED org.eclipse.ui.intro.universal#JavaSE-1.8 (Execution Environment)
> > > This is what I have done.
> > You mean now? Currently it's not in the report as you can see.
> I mean I fixed it :-)
> 
> (In reply to Dani Megert from comment #8)
> > ADDED	org.eclipse.jdt.ui.actions.WorkingSetFindAction
> The problem comes from the display of what has been found.
> The message from the delta is:
> "The method
> org.eclipse.jdt.ui.actions.WorkingSetFindAction.run(IJavaElement[]) has been
> added, overriding a method from a superclass"
> which is true. I am trying not to filter any delta and instead require a
> filter to be added for them. So in this case, I can filter it right way or I
> can improve the way the delta is reported requiring an exclusion to be added.
> Let me know what you prefer.

The report should report the real issue which is the compatible change of adding WorkingSetFindAction.run(IJavaElement[]).

The filter proposal should propose to filter that explicit thing.
Comment 16 Olivier Thomann CLA 2016-04-25 13:42:19 EDT
(In reply to Dani Megert from comment #15)
> The report should report the real issue which is the compatible change of
> adding WorkingSetFindAction.run(IJavaElement[]).
It does report it. It is just that its display is bogus. I wonder if the best is not to report the actual delta's message which is very detailed.
I'll make sure we provide a good way to filter it out in the exclude list.
Comment 17 Dani Megert CLA 2016-04-25 13:43:54 EDT
I think changing the BREE should be reported as a compatible change. Best as CHANGED.
Comment 18 Olivier Thomann CLA 2016-04-25 14:00:26 EDT
(In reply to Dani Megert from comment #17)
> I think changing the BREE should be reported as a compatible change. Best as
> CHANGED.
CHANGED is fine when you go from one BREE to another one. When you have more than one, how do you know which one is changed? In this case reported REMOVED and ADDED is fine.
Comment 19 Dani Megert CLA 2016-04-25 14:07:50 EDT
(In reply to Olivier Thomann from comment #18)
> (In reply to Dani Megert from comment #17)
> > I think changing the BREE should be reported as a compatible change. Best as
> > CHANGED.
> CHANGED is fine when you go from one BREE to another one. When you have more
> than one, how do you know which one is changed? In this case reported
> REMOVED and ADDED is fine.

Well, that's not the case for 'org.eclipse.ui.intro.universal' - it simply moved from 1.4 to 1.8.
Comment 20 Olivier Thomann CLA 2016-04-25 14:28:53 EDT
(In reply to Dani Megert from comment #19)
> Well, that's not the case for 'org.eclipse.ui.intro.universal' - it simply
> moved from 1.4 to 1.8.
This is what I mean. When you go from one to one, I can report a CHANGED, but for all other cases it would be REMOVED and ADDED. For me this is a detail. As long as I see what has changed, both would be ok.
Comment 21 Olivier Thomann CLA 2016-04-26 10:59:38 EDT
Created attachment 261257 [details]
Proposed patch including updated regression tests

Daniel, Vikas, please try this patch. I could run a deprecation report and a freeze report successfully and all tests are green except the test for old style bundle that is also failing without the patch.
Comment 22 Olivier Thomann CLA 2016-04-26 11:06:12 EDT
There are still some issues with the bundle org.eclipse.core.databinding.property, but this is due to a bogus .api_description file in the M6 zip. Some signatures are unresolved causing some bogus errors to be reported.
Comment 23 Dani Megert CLA 2016-04-26 11:20:32 EDT
(In reply to Olivier Thomann from comment #21)
> Created attachment 261257 [details] [diff]
> Proposed patch including updated regression tests
> 
> Daniel, Vikas, please try this patch. I could run a deprecation report and a
> freeze report successfully and all tests are green except the test for old
> style bundle that is also failing without the patch.

Hi Olivier, can you post the detailed steps here how you created the reports? If I recall correctly one has to go via Ant scripts and it's not possible via UI. Thanks!

Will the freeze report show the difference between compatible and incompatible changes?
Comment 24 Olivier Thomann CLA 2016-04-26 11:36:53 EDT
This is the ant script I used to get the freeze report:
<?xml version="1.0" encoding="UTF-8"?>
<project name="api_freeze_reporting" default="run" basedir=".">
	<target name="run">
		<apitooling.apifreeze
			debug="true"
			baseline="C:/api/eclipse-SDK-4.6M6-win32-x86_64/eclipse"
			profile="C:/api/eclipse-SDK-N20160423-1500-win32-x86_64/eclipse"
			report="C:/api/report_freeze.xml"
			excludeList="C:/api/exclude.list"
		/>
		<apitooling.apifreeze_reportconversion
			debug="true"
			htmlfile="C:/api/report_freeze.html"
			xmlfile="C:/api/report_freeze.xml"
		/>
	</target>
</project>

I don't remember about the way incompatible changes are shown compare to compatible changes. I modified the report to list the actual message from the delta which is more meaningful when you get something listed.
Let me know what you think.
Comment 25 Dani Megert CLA 2016-04-26 11:43:28 EDT
(In reply to Olivier Thomann from comment #24)
> I don't remember about the way incompatible changes are shown compare to
> compatible changes.

So far we only showed incompatible ones. I would expect to render them in either different sections or in different color.
Comment 26 Olivier Thomann CLA 2016-04-26 12:07:54 EDT
(In reply to Dani Megert from comment #25)
> So far we only showed incompatible ones. I would expect to render them in
> either different sections or in different color.
No, so far we were reporting compatible and incompatible ones. I made changes to make sure we report incompatible ones with a red background color.
Comment 27 Dani Megert CLA 2016-04-26 12:15:21 EDT
(In reply to Olivier Thomann from comment #26)
> (In reply to Dani Megert from comment #25)
> > So far we only showed incompatible ones. I would expect to render them in
> > either different sections or in different color.
> No, so far we were reporting compatible and incompatible ones.

Mh no, otherwise this bug would have been obsolete.
Comment 28 Olivier Thomann CLA 2016-04-26 13:12:04 EDT
(In reply to Dani Megert from comment #27)
> Mh no, otherwise this bug would have been obsolete.
I will attach a new report where you can see compatible and incompatible changes. We used to filter some of the compatible changes that we should not have filtered, but some compatible changes were already shown properly.
Comment 29 Olivier Thomann CLA 2016-04-26 13:12:32 EDT
Created attachment 261264 [details]
new report format
Comment 30 Olivier Thomann CLA 2016-04-26 13:14:31 EDT
Created attachment 261265 [details]
Updated patch to put incompatible changes in red
Comment 31 Dani Megert CLA 2016-04-27 08:27:50 EDT
(In reply to Olivier Thomann from comment #29)
> Created attachment 261264 [details]
> new report format

The red color makes it hard to read the text and hurts my eyes ;-)
Comment 32 Olivier Thomann CLA 2016-04-27 10:08:36 EDT
(In reply to Dani Megert from comment #31)
> (In reply to Olivier Thomann from comment #29)
> > Created attachment 261264 [details]
> > new report format
> 
> The red color makes it hard to read the text and hurts my eyes ;-)
What do you propose? It was the idea to hurt eyes as these ones should never happen.
Comment 33 Dani Megert CLA 2016-04-27 13:30:49 EDT
(In reply to Olivier Thomann from comment #32)
> (In reply to Dani Megert from comment #31)
> > (In reply to Olivier Thomann from comment #29)
> > > Created attachment 261264 [details]
> > > new report format
> > 
> > The red color makes it hard to read the text and hurts my eyes ;-)
> What do you propose? It was the idea to hurt eyes as these ones should never
> happen.

I would use bold and explain at the top that bold means breaking.


Just to clarify: that example report does not use the exclude_list.txt:
http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/eclipse.platform.releng.tychoeclipsebuilder/eclipse/apiexclude/exclude_list.txt?h=master
?
Comment 34 Vikas Chandra CLA 2016-05-02 06:03:13 EDT
Created attachment 261404 [details]
Message not found in report_freeze.html

I get this with this patch

ADDED Message not found for id: 0 
REMOVED Message not found for id: 0
Comment 35 Vikas Chandra CLA 2016-05-02 06:05:37 EDT
delta.getFlags returns 68 which doesn't have a matching id. So 0 is returned.

Also in IDelta,  public static final int TYPE_ARGUMENT = 68;
Comment 36 Vikas Chandra CLA 2016-05-02 07:25:08 EDT
My suggestion would be white against red background

 td.incompatible {
    background-color: red;
    color: white;
  }
Comment 37 Vikas Chandra CLA 2016-05-04 04:30:07 EDT
Since freeze report and deprecation report baseline will be no longer changed for 4.6, moving this to 4.7
Comment 38 Vikas Chandra CLA 2018-04-18 05:21:07 EDT
Bulk move out of 4.8 target milestone.
Comment 39 Eclipse Genie CLA 2020-04-08 01:28:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 40 Lars Vogel CLA 2020-05-11 15:53:27 EDT
Please reopen if the problem still persists.