Skip to content

Commit

Permalink
8191810: jjs should avoid hard coded javadoc base url for shift-tab d…
Browse files Browse the repository at this point in the history
…ocumentation feature

Reviewed-by: hannesw
  • Loading branch information
sundar committed Nov 23, 2017
1 parent 9bac78b commit 2134601
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ private void evalImpl(final Context context, final Global global, final String s
}
}

private static String JAVADOC_BASE = "https://docs.oracle.com/javase/9/docs/api/";
private static String JAVADOC_BASE = "https://docs.oracle.com/javase/%d/docs/api/";
private static void openBrowserForJavadoc(ScriptFunction browse, String relativeUrl) {
try {
final URI uri = new URI(JAVADOC_BASE + relativeUrl);
final URI uri = new URI(String.format(JAVADOC_BASE, Runtime.version().major()) + relativeUrl);
ScriptRuntime.apply(browse, null, uri);
} catch (Exception ignored) {
}
Expand Down

0 comments on commit 2134601

Please sign in to comment.