rspec/rules/S1696/compliant.adoc

17 lines
213 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,text]
2020-06-30 12:47:33 +02:00
----
public int lengthPlus(String str) {
int len = 2;
if (str != null) {
len += str.length();
}
else {
log.info("argument was null");
}
return len;
}
----