teragrep / rlp_03

Java RELP Server library
GNU Affero General Public License v3.0
1 stars 5 forks source link

Bad practice (FB.VA_FORMAT_STRING_USES_NEWLINE) in RelpEventOpen.java: 78 #222

Open StrongestNumber9 opened 4 months ago

StrongestNumber9 commented 4 months ago

Describe the bug

** CID 464526:  SpotBugs: Bad practice  (FB.VA_FORMAT_STRING_USES_NEWLINE)
/src/main/java/com/teragrep/rlp_03/frame/delegate/event/RelpEventOpen.java: 78 in com.teragrep.rlp_03.frame.delegate.event.RelpEventOpen.<init>(com.teragrep.rlp_03.version.Version)()

________________________________________________________________________________________________________
*** CID 464526:  SpotBugs: Bad practice  (FB.VA_FORMAT_STRING_USES_NEWLINE)
/src/main/java/com/teragrep/rlp_03/frame/delegate/event/RelpEventOpen.java: 78 in com.teragrep.rlp_03.frame.delegate.event.RelpEventOpen.<init>(com.teragrep.rlp_03.version.Version)()
72             this.fragmentFactory = new FragmentFactory();
73             this.version = version;
74     
75             Fragment txn = new FragmentStub();
76             Fragment command = fragmentFactory.create("rsp");
77             String payloadContent = String
>>>     CID 464526:  SpotBugs: Bad practice  (FB.VA_FORMAT_STRING_USES_NEWLINE)
>>>     Format string should use %n rather than \n.
78                     .format(
79                        "200 OK\nrelp_version=0\nrelp_software=rlp_03,%s,https://teragrep.com\ncommands=syslog\n",
80                             this.version.version()
81                     );
82             Fragment payload = fragmentFactory.create(payloadContent);
83             long payloadSize = payload.size();

Expected behavior

No warnings

Software version

Current