Skip to content

Commit

Permalink
payara#4281 Fixed usage of StringBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
sgflt authored and David Matejcek committed Apr 16, 2020
1 parent b664e51 commit 8966de1
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,39 +225,38 @@ private void writeObject(ObjectOutputStream stream) throws IOException {
/**
* Return a string representation of this object.
*/
public String superToString() {
private CharSequence superToString() {

StringBuilder sb = new StringBuilder(1000);
sb.append("BaseHASession[");
sb.append(id);
sb.append("]");

sb.append("\n");
sb.append("isValid:" + getIsValid());
sb.append("isValid:").append(getIsValid());

if (getIsValid()) {
Enumeration<String> attrNamesEnum = getAttributeNamesInternal();
while(attrNamesEnum.hasMoreElements()) {
String nextAttrName = attrNamesEnum.nextElement();
Object nextAttrValue = getAttributeInternal(nextAttrName);
sb.append("\n");
sb.append("attrName = " + nextAttrName);
sb.append(" : attrValue = " + nextAttrValue);
sb.append("attrName = ").append(nextAttrName);
sb.append(" : attrValue = ").append(nextAttrValue);
}
}

return sb.toString();
return sb;
// END S1AS
}

public String toString() {
StringBuilder sb = new StringBuilder(200);
//sb.append(super.toString());
sb.append(this.superToString());
sb.append(" ssoid: " + this.getSsoId());
sb.append(" userName: " + this.getUserName());
sb.append(" version: " + this.getVersion());
sb.append(" persistent: " + this.isPersistent());
StringBuilder sb = new StringBuilder(1200);
sb.append(superToString());
sb.append(" ssoid: ").append(getSsoId());
sb.append(" userName: ").append(getUserName());
sb.append(" version: ").append(getVersion());
sb.append(" persistent: ").append(isPersistent());
return sb.toString();
}

Expand Down

0 comments on commit 8966de1

Please sign in to comment.