Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the method setExtension of TipImage.java in org.eclipse.tips.tests #525 #723

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

Michael5601
Copy link
Contributor

@Michael5601 Michael5601 commented Sep 25, 2023

In this commit the method setExtension of TipImage.java is corrected to properly change the extension. Now if setExtension is called, not only the extension is updated but also the base64image because the extension is a part of this image. Mind that for this change the field fBase64Image can't be final because it needs to be updated when the extension changes. setExtension is not used in the constructor anymore to set the fExtension field, rather it is directly set. Also the tests setExtension and setExtension2 are reactivated and updated to test the functionality of setExtension. Contributes to #525.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 25, 2023

Test Results

     591 files       591 suites   1h 24m 48s ⏱️
  3 842 tests   3 837 ✔️   5 💤 0
12 132 runs  12 096 ✔️ 36 💤 0

Results for commit 229dbd5.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing the missing functionality. When you address the minor comment on the code, could you please also improve the commit message such that it primarily explains the behavior change in TipImage and only mentions the fixed and re-enabled tests afterwards?

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good. I just wonder what effect this change should have on the bundle version. The change affects public API, which syntactically stays the same but the setExtension method was semantically correctly (in terms of Javadoc spec and implementation).
In a strict interpretation, I would say this requires a major version bump, but actually I don't think that makes sense for such a "correction"?

…-platform#525

In this commit the method setExtension of TipImage.java is corrected to properly change the extension. Now if setExtension is called, not only the extension is updated but also the base64image because the extension is a part of this image. Mind that for this change the field fBase64Image can't be final because it needs to be updated when the extension changes. setExtension is not used in the constructor anymore to set the fExtension field, rather it is directly set. Also the tests setExtension and setExtension2 are reactivated and updated to test the functionality of setExtension. Contributes to eclipse-platform#525.
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already mentioned, these changes look good to me.
I see the slightly changed behavior of the setExtension method as a correction/improvement. The previous behavior was kind of broken since the stored file extension and the extension encoded into the image became different, which did not make sense. This can also be seen in the existing tests (which were commented out), as they specified the behavior as it is implemented after this change.

@HeikoKlare HeikoKlare merged commit 4a50d17 into eclipse-platform:master Nov 30, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants