comparison src/org/tmatesoft/hg/repo/HgRuntimeException.java @ 485:cdd53e5884ae

Do not add anything to exception message in case no details are known
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 09 Aug 2012 15:45:18 +0200
parents 31a89587eb04
children
comparison
equal deleted inserted replaced
484:ae4d6604debd 485:cdd53e5884ae
88 return details.setFileName(name); 88 return details.setFileName(name);
89 } 89 }
90 90
91 @Override 91 @Override
92 public String toString() { 92 public String toString() {
93 StringBuilder sb = new StringBuilder(super.toString()); 93 String base = super.toString();
94 sb.append(' '); 94 StringBuilder sb = new StringBuilder();
95 sb.append('(');
96 details.appendDetails(sb); 95 details.appendDetails(sb);
97 sb.append(')'); 96 if (sb.length() == 0) {
98 return sb.toString(); 97 return base;
98 }
99 return new StringBuilder(base).append(' ').append('(').append(sb).append(')').toString();
99 } 100 }
100 } 101 }