Open Marcono1234 opened 6 days ago
I feel like this.formatParts.size() <= 1 && args.length > 0
feels more correct. Both work (all tests are passed), but I'm afraid of edge cases, so this.formatParts.size() == 1
or this.formatParts.size() <= 1
feels kinda safer imo. I will provide a PR soon.
Edit: it turns out I was totally wrong 😅
Version
0.2.0
What happened?
CodeBlock.Builder#add
is supposed to verify that all arguments are used (see its implementation), however if you accidentally forget to add any placeholders (or mistype them), then no validation is performed:What did you want to happen?
CodeBlock.Builder#add
should probably have a check forif (!hasRelative && !hasIndexed && args.length > 0)
.