Skip to content

Commit

Permalink
Fix for underlined trailing spaces on project links. Tried various so…
Browse files Browse the repository at this point in the history
…lutions including the Jelly trim attribute, but in the end the only thing that would work was to remove the line break prior to the closing tag.
  • Loading branch information
dwdyer committed Aug 26, 2013
2 parents 59b3118 + 8df5cb8 commit e240b75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions core/src/main/java/hudson/Functions.java
Expand Up @@ -1082,10 +1082,11 @@ public static String getRelativeNameFrom(Item p, ItemGroup g, boolean useDisplay

Integer d = parents.get(gr);
if (d!=null) {
String s="";
for (int j=d; j>0; j--)
s+=".." + separationString;
return s+buf;
for (int j=d; j>0; j--) {
buf.insert(0,separationString);
buf.insert(0,"..");
}
return buf.toString();
}

if (gr instanceof Item)
Expand Down Expand Up @@ -1227,21 +1228,21 @@ public static String dumpThreadInfo(ThreadInfo ti, ThreadGroupMap map) {
StackTraceElement[] stackTrace = ti.getStackTrace();
for (int i=0; i < stackTrace.length; i++) {
StackTraceElement ste = stackTrace[i];
sb.append("\tat " + ste.toString());
sb.append("\tat ").append(ste);
sb.append('\n');
if (i == 0 && ti.getLockInfo() != null) {
Thread.State ts = ti.getThreadState();
switch (ts) {
case BLOCKED:
sb.append("\t- blocked on " + ti.getLockInfo());
sb.append("\t- blocked on ").append(ti.getLockInfo());
sb.append('\n');
break;
case WAITING:
sb.append("\t- waiting on " + ti.getLockInfo());
sb.append("\t- waiting on ").append(ti.getLockInfo());
sb.append('\n');
break;
case TIMED_WAITING:
sb.append("\t- waiting on " + ti.getLockInfo());
sb.append("\t- waiting on ").append(ti.getLockInfo());
sb.append('\n');
break;
default:
Expand All @@ -1250,7 +1251,7 @@ public static String dumpThreadInfo(ThreadInfo ti, ThreadGroupMap map) {

for (MonitorInfo mi : ti.getLockedMonitors()) {
if (mi.getLockedStackDepth() == i) {
sb.append("\t- locked " + mi);
sb.append("\t- locked ").append(mi);
sb.append('\n');
}
}
Expand All @@ -1261,7 +1262,7 @@ public static String dumpThreadInfo(ThreadInfo ti, ThreadGroupMap map) {
sb.append("\n\tNumber of locked synchronizers = " + locks.length);
sb.append('\n');
for (LockInfo li : locks) {
sb.append("\t- " + li);
sb.append("\t- ").append(li);
sb.append('\n');
}
}
Expand Down Expand Up @@ -1644,16 +1645,16 @@ public static String generateConsoleAnnotationScriptAndStylesheet() {
for (ConsoleAnnotatorFactory f : ConsoleAnnotatorFactory.all()) {
String path = cp + "/extensionList/" + ConsoleAnnotatorFactory.class.getName() + "/" + f.getClass().getName();
if (f.hasScript())
buf.append("<script src='"+path+"/script.js'></script>");
buf.append("<script src='").append(path).append("/script.js'></script>");
if (f.hasStylesheet())
buf.append("<link rel='stylesheet' type='text/css' href='"+path+"/style.css' />");
buf.append("<link rel='stylesheet' type='text/css' href='").append(path).append("/style.css' />");
}
for (ConsoleAnnotationDescriptor d : ConsoleAnnotationDescriptor.all()) {
String path = cp+"/descriptor/"+d.clazz.getName();
if (d.hasScript())
buf.append("<script src='"+path+"/script.js'></script>");
buf.append("<script src='").append(path).append("/script.js'></script>");
if (d.hasStylesheet())
buf.append("<link rel='stylesheet' type='text/css' href='"+path+"/style.css' />");
buf.append("<link rel='stylesheet' type='text/css' href='").append(path).append("/style.css' />");
}
return buf.toString();
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/layout/breakable.jelly
Expand Up @@ -31,5 +31,5 @@ THE SOFTWARE.
Unescaped value to output
</st:attribute>
</st:documentation>
${h.breakableString(h.escape(value))}
</j:jelly>
${h.breakableString(h.escape(value))}</j:jelly>

0 comments on commit e240b75

Please sign in to comment.