| Summary: | API version errors with pie chart color patch | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] MAT | Reporter: | Andrew Johnson <andrew_johnson> | ||||
| Component: | GUI | Assignee: | Krum Tsvetkov <krum.tsvetkov> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | kevin.grigorenko | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Andrew Johnson
Good that you spotted this. I recently moved to a newer IDE and forgot to setup the API checks, so I didn't notice the problem.
I'll think a bit more what would be the best way to solve this.
>> We also need to explain in http://wiki.eclipse.org/index.php?title=MemoryAnalyzer/Contributor_Reference how to set up API compatibility checking using Eclipse API tooling.
I'll take care to add a description on the page.
I added some description to the contributor reference: http://wiki.eclipse.org/MemoryAnalyzer/Contributor_Reference#Configure_API_Tooling_Baseline With recent IDEs 3.6, 3.7 and 4.2 the tooling is already available in the Eclipse Classic installation. I'm not sure about older IDE versions. I haven't described where to get the API tooling from (in case it isnt present). Do you think we have to add this also? I think it will only make the page longer and more difficult to read. One way of fixing this is to : define IResultPie.ColoredSlice extends Slice with the getColor() method in PieFactory, define ColoredSliceImpl to extend SliceImpl and implement getColor() API question: Should a ColoredSlice always have a non-null colour? It makes it slightly easier for the consumer and slightly harder for the generator of slices. If for example we had shaded slides PieFactory then creates ColoredSliceImpl or SliceImpl depending on whether a color is supplied. The extra methods are tagged with 1.2 ChartBuilder then checks if it receives a ColoredSlice, and gets the color. Created attachment 211894 [details]
Proposed solution with new interface ColoredSlice
I also preferred the solution with a new interface ColoredSlice.
I attached a patch so we could discuss further if needed. But with a few changes we solve the API problem, and it or less exactly what you proposed.
This still assumes color could be null.
If there are no objections, I will check it in tomorrow.
Hey Guys, so this is just for my education, but why does adding a method cause such problems? Also, I see the errors report that @since is missing - would adding @since be sufficient to resolve this problem? If there are classes which implement the interface which we exposed as an API, then this classes will not compile any longer against the new version of the interface. I think this is the reason. Since is enough for things which are newly introduced, but which will not break other's coding. Ahh, right. I apologize for creating some trouble! Do not worry. Thanks for your contributions. this is fixed already. |