jlahoda commented on a change in pull request #1207: Performance Save Patch -
Replace replaceAll() with replace()
URL: https://github.com/apache/netbeans/pull/1207#discussion_r282745919
##########
File path:
enterprise/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/WLManagerNode.java
##########
@@ -209,7 +209,7 @@ public void setValue(Object value) {
) {
public Object getValue() {
String password =
deploymentManager.getInstanceProperties().getProperty(InstanceProperties.PASSWORD_ATTR);
- return password.replaceAll(".", "\\*");
+ return password.replace(".", "\\*");
Review comment:
I think it is fairly obvious the new code is wrong. For a password
"password", before, the resulting text was "********", but now is "password". I
don't see a reason why it would be desirable to replace '.' in passwords with
'*', but I see obvious reasons to replace all characters of a password with
'*'. (You could argue that the code could be written in a different way, and
that's of course true, but changing replaceAll to replace here is not in a good
direction.)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists