Alon Bar-Lev has posted comments on this change.
Change subject: core: config: support sensitive keys
......................................................................
Patch Set 3: (1 inline comment)
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/LocalConfig.java
Line 97: // problem to use INFO):
Line 98: if (log.isInfoEnabled()) {
Line 99: Set<String> keys = values.keySet();
Line 100: List<String> list = new ArrayList<String>(keys.size());
Line 101: List<String> sensitiveKeys =
Arrays.asList(getSensitiveKeys());
This happens one time per execution, I prefer simplest code, and not optimized
code.
if you think that contracting HashSet producing simpler code, I will happy to
see... I just think that it will create the list anyway and just add more
objects, more garbage collector work and less readable code.
However, as I wrote to Yair, I will do everything to pass this review, as it
totally not important to me, as I do not maintain this code, just look at the
number of variables that are declared and used only once.
For example:
public File getFile(String key) {
String value = getProperty(key);
return new File(value);
}
What is that for? I can replace every call to this one with:
return new File(getProperty(key));
Or:
File defaultsFile = new File(defaultsPath);
configFiles.add(defaultsFile);
How does it makes anything more clear than:
configFiles.add(new File(defaultsPath));
I can compress this code by 20% without considering optimization... and
optimizing singleton initialization is not worth the extra code complexity.
Line 102: list.addAll(keys);
Line 103: Collections.sort(list);
Line 104: for (String key : list) {
Line 105: String value = "***";
--
To view, visit http://gerrit.ovirt.org/14353
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8dc10fb3eeb1cc97a03cc160133a84d6b2a23d87
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches