Skip to content

Commit a22b425

Browse files
committed
fix format errors
1 parent a6bf6a8 commit a22b425

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

src/main/java/com/cisco/trex/stateful/api/lowlevel/ASTFCmdSend.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ASTFCmdSend extends ASTFCmd {
1515
* @param asciiBuf
1616
*/
1717
public ASTFCmdSend(byte[] asciiBuf) {
18-
this(asciiBuf, 0, null);
18+
this(asciiBuf, 0, null);
1919
}
2020

2121
/**
@@ -33,11 +33,18 @@ public ASTFCmdSend(byte[] asciiBuf, int size, byte[] fill) {
3333
fields.addProperty("buf_index", -1);
3434
this.bufLen = asciiBuf.length;
3535
if (size > asciiBuf.length) {
36-
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"size\": " + size + " }";
37-
if (fill != null) {
38-
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"fill\": \"" + encodeBase64(fill) + "\", \"size\": " + size + " }";
39-
}
40-
this.bufLen = size;
36+
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"size\": " + size + " }";
37+
if (fill != null) {
38+
this.base64Buf =
39+
"{ \"base\": \""
40+
+ bufStr
41+
+ "\", \"fill\": \""
42+
+ encodeBase64(fill)
43+
+ "\", \"size\": "
44+
+ size
45+
+ " }";
46+
}
47+
this.bufLen = size;
4148
}
4249
stream = true;
4350
buffer = true;

src/main/java/com/cisco/trex/stateful/api/lowlevel/ASTFCmdTxPkt.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ASTFCmdTxPkt extends ASTFCmd {
1515
* @param asciiBuf
1616
*/
1717
public ASTFCmdTxPkt(byte[] asciiBuf) {
18-
this(asciiBuf, 0, null);
18+
this(asciiBuf, 0, null);
1919
}
2020

2121
/**
@@ -33,11 +33,18 @@ public ASTFCmdTxPkt(byte[] asciiBuf, int size, byte[] fill) {
3333
fields.addProperty("buf_index", -1);
3434
this.bufLen = asciiBuf.length;
3535
if (size > asciiBuf.length) {
36-
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"size\": " + size + " }";
37-
if (fill != null) {
38-
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"fill\": \"" + encodeBase64(fill) + "\", \"size\": " + size + " }";
39-
}
40-
this.bufLen = size;
36+
this.base64Buf = "{ \"base\": \"" + bufStr + "\", \"size\": " + size + " }";
37+
if (fill != null) {
38+
this.base64Buf =
39+
"{ \"base\": \""
40+
+ bufStr
41+
+ "\", \"fill\": \""
42+
+ encodeBase64(fill)
43+
+ "\", \"size\": "
44+
+ size
45+
+ " }";
46+
}
47+
this.bufLen = size;
4148
}
4249
stream = false;
4350
buffer = true;

src/main/java/com/cisco/trex/stateful/api/lowlevel/ASTFProgram.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.google.gson.JsonArray;
55
import com.google.gson.JsonObject;
66
import com.google.gson.JsonSyntaxException;
7-
87
import java.io.UnsupportedEncodingException;
98
import java.nio.charset.StandardCharsets;
109
import java.security.MessageDigest;
@@ -274,10 +273,12 @@ public void send(String buf) {
274273
*/
275274
public void send(String buf, int size, String fill) {
276275
// we support bytes or ascii strings
277-
System.out.println("testing being by leo \n");
276+
System.out.println("testing being by leo \n");
278277
ASTFCmdSend cmd = null;
279278
try {
280-
cmd = new ASTFCmdSend(buf.getBytes("ascii"), size, (fill != null) ? fill.getBytes("ascii") : null);
279+
cmd =
280+
new ASTFCmdSend(
281+
buf.getBytes("ascii"), size, (fill != null) ? fill.getBytes("ascii") : null);
281282
} catch (UnsupportedEncodingException e) {
282283
throw new IllegalStateException("Unsupported Encoding Exception", e);
283284
}
@@ -293,7 +294,7 @@ public void send(String buf, int size, String fill) {
293294
* @param buf l7 stream as string
294295
*/
295296
public void sendMsg(String buf) {
296-
sendMsg(buf, 0, null);
297+
sendMsg(buf, 0, null);
297298
}
298299

299300
/**
@@ -306,7 +307,9 @@ public void sendMsg(String buf) {
306307
public void sendMsg(String buf, int size, String fill) {
307308
ASTFCmdTxPkt cmd = null;
308309
try {
309-
cmd = new ASTFCmdTxPkt(buf.getBytes("ascii"), size, (fill != null) ? fill.getBytes("ascii") : null);
310+
cmd =
311+
new ASTFCmdTxPkt(
312+
buf.getBytes("ascii"), size, (fill != null) ? fill.getBytes("ascii") : null);
310313
} catch (UnsupportedEncodingException e) {
311314
throw new IllegalStateException("Unsupported Encoding Exception", e);
312315
}

0 commit comments

Comments
 (0)