You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
the explicit cast warns the developer there is a potential classcastexception, with the free cast the developer assumes classcast exception cannot happen.
without being dogmatic, I think this lead the developer to make wrong assumption/reasoning about the code, when someone sees a stacktrace happening at line:
String b = map.get("foo");
He will not understand where this CCE is coming from nor why it happens.
9d14e8b
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.
This allows to write type unsafe code like:
9d14e8b
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.
True but in the old code you could also write type unsafe code:
So, I'm not sure it's really any worse ;)
9d14e8b
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.
the explicit cast warns the developer there is a potential classcastexception, with the free cast the developer assumes classcast exception cannot happen.
without being dogmatic, I think this lead the developer to make wrong assumption/reasoning about the code, when someone sees a stacktrace happening at line:
He will not understand where this CCE is coming from nor why it happens.
9d14e8b
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 agree with you. I will revert the commits and tell the user that the request is rejected on the BZ.