Source:
public ByteBuf getCommandLineBytes() throws ImapAsyncClientException { final String base64Folder = BASE64MailboxEncoder.encode(folderName); int qResyncParameterSize = 0; StringBuilder sb = null; if (qResyncParameter != null) { sb = new StringBuilder(); sb.append("(QRESYNC (").append(qResyncParameter.getUidValidity()).append(ImapClientConstants.SPACE).append(qResyncParameter.getModSeq()); if (qResyncParameter.getKnownUids() != null) { sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getKnownUids())); } if (qResyncParameter.getSeqMatchData() != null) { sb.append(ImapClientConstants.SPACE).append("("); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownSequenceSet())); sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownUidSet())); sb.append(")"); } sb.append("))"); qResyncParameterSize = sb.length(); } final int len = 2 * base64Folder.length() + ImapClientConstants.PAD_LEN + qResyncParameterSize; final ByteBuf byteBuf = Unpooled.buffer(len); byteBuf.writeBytes(op.getBytes(StandardCharsets.US_ASCII)); byteBuf.writeByte(ImapClientConstants.SPACE); final ImapArgumentFormatter formatter = new ImapArgumentFormatter(); formatter.formatArgument(base64Folder, byteBuf, false); if (qResyncParameterSize > 0) { byteBuf.writeByte(ImapClientConstants.SPACE); byteBuf.writeBytes(sb.toString().getBytes(StandardCharsets.US_ASCII)); } if (this.condStore) { byteBuf.writeByte(ImapClientConstants.SPACE); byteBuf.writeBytes(CONDSTORE_B); } byteBuf.writeBytes(CRLF_B); return byteBuf; }

Target:
public ByteBuf getCommandLineBytes() throws ImapAsyncClientException { final String base64Folder = BASE64MailboxEncoder.encode(folderName); int qResyncParameterSize = 0; StringBuilder sb = null; if (qResyncParameter != null) { sb = new StringBuilder(); sb.append("(QRESYNC (").append(qResyncParameter.getUidValidity()).append(ImapClientConstants.SPACE).append(qResyncParameter.getModSeq()); if (qResyncParameter.getKnownUids() != null) { sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getKnownUids())); } if (qResyncParameter.getSeqMatchData() != null) { sb.append(ImapClientConstants.SPACE).append("("); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownSequenceSet())); sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownUidSet())); sb.append(")"); } sb.append("))"); qResyncParameterSize = sb.length(); } final int condStoreSize = isCondStoreEnabled ? SP_CONDSTORE.length() : 0; final int len = 2 * base64Folder.length() + ImapClientConstants.PAD_LEN + qResyncParameterSize + condStoreSize; final ByteBuf byteBuf = Unpooled.buffer(len); byteBuf.writeBytes(op.getBytes(StandardCharsets.US_ASCII)); byteBuf.writeByte(ImapClientConstants.SPACE); final ImapArgumentFormatter formatter = new ImapArgumentFormatter(); formatter.formatArgument(base64Folder, byteBuf, false); if (qResyncParameterSize > 0) { byteBuf.writeByte(ImapClientConstants.SPACE); byteBuf.writeBytes(sb.toString().getBytes(StandardCharsets.US_ASCII)); } if (isCondStoreEnabled) { byteBuf.writeBytes(SP_CONDSTORE_B); } byteBuf.writeBytes(CRLF_B); return byteBuf; }