Alon Bar-Lev has posted comments on this change.

Change subject: utils: ssh public key entry should contain new line
......................................................................


Patch Set 2: (1 inline comment)

....................................................
File 
backend/manager/modules/engineencryptutils/src/main/java/org/ovirt/engine/core/engineencryptutils/OpenSSHUtils.java
Line 116:         final StringBuilder buffer = new 
StringBuilder(SSH_RSA.length() + 1 + encoding.length() + (alias != null? 1 + 
alias.length(): 0));
Easy != not having issues when code is modified, so allocating exact most 
probably in time will not be correct.

Waste of few bytes is something that is neglictable in java... as it is far 
from being efficient.

In these cases I think better is to use string.format, or simply "+" operator.

 keyString = String.format(
     "%s %s%s\n",
     SSH_RSA,
     new Base64(0).encodeToString(keyBytes),
     alias != null ? " " + alias : ""
 )

Or:

 keyString = (
      SSH_RSA + " " +
      new Base64(0).encodeToString(keyBytes)
      (alias != null ? " + alias : "")
 )

--
To view, visit http://gerrit.ovirt.org/7027
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd202048b8efb8f081b10651c302b9da0718035c
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to