Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public_IP == PUBLIC_IP
??PUBLIC_IP == PUBLIC_IP
??See:
ec2-plugin/src/main/java/hudson/plugins/ec2/ConnectionStrategy.java
Line 5 in 2f348aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it not the same? why is it fixing the error?
ec2-plugin/src/main/java/hudson/plugins/ec2/ConnectionStrategy.java
Lines 15 to 17 in 2f348aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too am interested in Francisco's point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equalsName
is comparing the text added in the constructor (Public IP
lowercase) as you can see above, but theconnectionStrategy
variable contains the declared name of the enum (PUBLIC IP
uppercase), so they were never equals. Withname()
we use the declared name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I see now! Really good point Ramon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, then shouldn'tequals()
also produce the desired behaviour?Edit: Forgot the the other object is simply a string, LGTM. thanks for the explaination