diff --git a/core/src/main/java/hudson/AbstractMarkupText.java b/core/src/main/java/hudson/AbstractMarkupText.java index 4f1062615b..41e19e5b0c 100644 --- a/core/src/main/java/hudson/AbstractMarkupText.java +++ b/core/src/main/java/hudson/AbstractMarkupText.java @@ -86,6 +86,16 @@ public abstract class AbstractMarkupText { addMarkup(startPos,endPos,"",""); } + /** + * Inserts an A tag that surrounds the given position. + * But this hyperlink is less visible. + * + * @since 1.395 + */ + public void addHyperlinkLowKey( int startPos, int endPos, String url ) { + addMarkup(startPos,endPos,"",""); + } + /** * Adds a start tag and end tag around the entire text */ diff --git a/core/src/main/java/hudson/console/HudsonExceptionNote.java b/core/src/main/java/hudson/console/HudsonExceptionNote.java index bdc62874f9..379e612ff8 100644 --- a/core/src/main/java/hudson/console/HudsonExceptionNote.java +++ b/core/src/main/java/hudson/console/HudsonExceptionNote.java @@ -32,7 +32,7 @@ public class HudsonExceptionNote extends ConsoleNote { else return null; // unexpected format. abort. } - text.addHyperlink(charPos,end,annotateClassName(line.substring(charPos,end))); + text.addHyperlinkLowKey(charPos,end,annotateClassName(line.substring(charPos,end))); return new ConsoleAnnotator() { public ConsoleAnnotator annotate(Object context, MarkupText text) { @@ -40,7 +40,7 @@ public class HudsonExceptionNote extends ConsoleNote { Matcher m = STACK_TRACE_ELEMENT.matcher(line); if (m.find()) {// allow the match to happen in the middle of a line to cope with prefix. Ant and Maven put them, among many other tools. - text.addHyperlink(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4)))); + text.addHyperlinkLowKey(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4)))); return this; } @@ -49,7 +49,7 @@ public class HudsonExceptionNote extends ConsoleNote { int s = idx + CAUSED_BY.length(); int e = line.indexOf(':', s); if (e<0) e = line.length(); - text.addHyperlink(s,e,annotateClassName(line.substring(s,e))); + text.addHyperlinkLowKey(s,e,annotateClassName(line.substring(s,e))); return this; } @@ -65,13 +65,11 @@ public class HudsonExceptionNote extends ConsoleNote { // TODO; separate out the annotations and mark up private String annotateMethodName(String className, String methodName, String sourceFileName, int lineNumber) { - // for now - return "http://grepcode.com/search/?query="+className+'.'+methodName+"&entity=method"; + return "http://stacktrace.hudson-labs.org/search/?query="+className+'.'+methodName+"&entity=method"; } private String annotateClassName(String className) { - // for now - return "http://grepcode.com/search?query="+className; + return "http://stacktrace.hudson-labs.org/search?query="+className; } @Extension @@ -97,5 +95,5 @@ public class HudsonExceptionNote extends ConsoleNote { private static final String CAUSED_BY = "Caused by: "; - private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more"); + private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more\n"); } diff --git a/war/src/main/webapp/css/style.css b/war/src/main/webapp/css/style.css index de14f8ec9b..0fb7965faf 100644 --- a/war/src/main/webapp/css/style.css +++ b/war/src/main/webapp/css/style.css @@ -143,6 +143,21 @@ a:visited { color: #5c3566; } +a.lowkey:link { + text-decoration: none; + color: inherit; +} + +a.lowkey:hover { + text-decoration: underline; + color: inherit; +} + +a.lowkey:visited { + text-decoration: none; + color: inherit; +} + /* tip - anchors of class info */ a.tip { position:relative;