String (Description description, String className, String methodName) { try { Field descriptionField = Description.class.getDeclaredField("fUniqueId"); descriptionField.setAccessible(true); String elementUrl = descriptionField.get(description).toString(); String elementSMUrl = elementUrl; if (elementUrl.startsWith(CLASSPATH_PREFIX)) { elementUrl = elementUrl.substring(CLASSPATH_PREFIX.length()); int colonIndex = elementUrl.lastIndexOf(":"); if (colonIndex < 0) { return ""; } int lineNumber = Integer.parseInt(elementUrl.substring(colonIndex + 1)); elementUrl = elementUrl.substring(0, colonIndex); URL url = this.getClass().getResource("/" + elementUrl); if (url == null) { return ""; } elementSMUrl = FILE_URL_PREFIX + url.getFile() + ":" + lineNumber; } else if (elementUrl.startsWith(FILE_COLON_PREFIX)){ elementUrl = elementUrl.substring(FILE_COLON_PREFIX.length()); elementUrl = System.getProperty("user.dir") + File.separator + elementUrl; elementSMUrl = FILE_URL_PREFIX + elementUrl; } return "locationHint='" + MapSerializerUtil.escapeStr(elementSMUrl, MapSerializerUtil.STD_ESCAPER) + "'"; } catch (NoSuchFieldException | IllegalAccessException ignored) { } return ""; }