eclipse / gef-classic

Eclipse GEF(tm) Classic code
Eclipse Public License 2.0
25 stars 49 forks source link

Clean-up Deprecated API Usage #21

Open azoitl opened 2 years ago

azoitl commented 2 years ago

Several of the API elements marked as deprecated are used through out the GEF code base. As a first step for clean-up it would be good to replace this usage with the according replacement APIs.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 180 days since being marked as stale.

azoitl commented 1 year ago

This will be a longer going effort. Therfore I reopen it it so that we have it as notification in the open issue list.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 180 days since being marked as stale.

azoitl commented 9 months ago

While working through the different deprecated fields and methods in GEF Classic I came across Point::getDistance2. This method calculates the squared distance between to points. The deprecation comment their states that instead getDistance() should be used and if needed the results squared.

I checked the usage of getDistance2and it is mainly used to sort things according to distance. For this the getDistance2 has a much higher performance (sqrt, which is used in getDistance2is in general slow) and also a higher resolution. Therefore I don't think thisgetDistance2should be deprecated. If no one objects I would remove the deprecation from getDistance2and only change the return value from int to long. This is has no impact on the API and increases the utility.

Did I miss anything? Any opinion from @ptziegler, @Destrolaric, or @Phillipus?

ptziegler commented 9 months ago

I really don't like the method name, so because of that alone, I would keep it deprecated. What about creating a new method getDistanceSquared() and have getDistance2() simply delegate to it?

l3002 commented 8 months ago

Hey @azoitl, I would like to contribute to this issue, just wanted to run that by you once. There wouldn't be any problem if I submit a PR in near future, would it?

azoitl commented 8 months ago

Hey @azoitl, I would like to contribute to this issue, just wanted to run that by you once. There wouldn't be any problem if I submit a PR in near future, would it?

@l3002 we are happy for any support. Feel free to contribute.

wiresketch commented 6 months ago

Please see #383 for the breaking change caused by the last merge.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 90 days with no activity.