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

GroupLaunchConfigurationTabGroup: remove dead code #155

Merged

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Jun 6, 2023

Array length is never < 0

@@ -349,9 +349,6 @@ protected void editPressed() {
}
if (dialog.open() == Window.OK) {
ILaunchConfiguration[] confs = dialog.getSelectedLaunchConfigurations();
if (confs.length < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it should be == 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have not found any report that the assert below ever hit. so let's assume conf.length==1

Copy link
Member

Choose a reason for hiding this comment

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

This code was migrated from the original C++ code base . And I believe there must have been a scenario and that's why they added it. What is the benefit in removing this when we are not sure?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering why there was a check for less than 0 here. I think in Java we can be 100% sure the length of array is never less than 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reducing warnings of static code analysis so that new warnings don't be overlooked by the amount of existing warnings.

Copy link
Member

Choose a reason for hiding this comment

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

As length can never be <0 I plan to merge this one .

@akurtakov akurtakov force-pushed the GroupLaunchConfigurationTabGroup branch from 4539bd1 to 21353d3 Compare June 9, 2023 06:17
@jukzi jukzi force-pushed the GroupLaunchConfigurationTabGroup branch from 21353d3 to a579813 Compare June 9, 2023 12:16
@jukzi jukzi merged commit caa20c9 into eclipse-platform:master Jun 9, 2023
3 checks passed
@jukzi jukzi deleted the GroupLaunchConfigurationTabGroup branch June 9, 2023 12:34
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.

None yet

6 participants