MCPcopy Create free account
hub / github.com/easymock/objenesis / pad

Method pad

tck/src/main/java/org/objenesis/tck/TextReporter.java:229–243  ·  view source on GitHub ↗
(String text, int width)

Source from the content-addressed store, hash-verified

227 }
228
229 private String pad(String text, int width) {
230 if(text.length() == width) {
231 return text;
232 }
233 else if(text.length() > width) {
234 return text.substring(0, width);
235 }
236 else {
237 StringBuilder padded = new StringBuilder(text);
238 while(padded.length() < width) {
239 padded.append(' ');
240 }
241 return padded.toString();
242 }
243 }
244
245 private int lengthOfLongestStringIn(Collection<String> descriptions) {
246 int result = 0;

Callers 1

printResultMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected