jlahoda commented on code in PR #5152:
URL: https://github.com/apache/netbeans/pull/5152#discussion_r1059718006
##########
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:
##########
@@ -1193,47 +1204,60 @@ private void dumpArguments(List<? extends
VariableElement> list, List<? extends
addSpace = true;
}
-
+
result.append(')');
}
private void dumpThrows(List<? extends TypeMirror> list) {
if (list.isEmpty()) {
return ;
}
-
+
boolean addSpace = false;
-
+
result.append(" throws ");
-
+
for (TypeMirror t : list) {
if (addSpace) {
result.append(", ");
}
-
+
result.append(getTypeName(info, t, true));
-
+
addSpace = true;
}
}
-
+
}
-
+
private static String getTypeName(CompilationInfo info, TypeMirror t,
boolean fqn) {
return translate(Utilities.getTypeName(info, t, fqn).toString());
}
-
+
private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; //
NOI18N
private static String[] tags = new String[] {"&", "<", ">",
"<br>", """}; // NOI18N
-
+
private static String translate(String input) {
for (int cntr = 0; cntr < c.length; cntr++) {
input = input.replace(c[cntr], tags[cntr]);
}
-
+
return input;
}
-
+
+ static String findFileName(Element resolved) {
Review Comment:
I suspect the best way would be to add an API method somewhere into
java.source.base, returning a "source file name" for Elements that originate in
a classfile - presumably, it could suggest it returns the value of the
attribute. Or, vaguely speak about some "source file name", which could work
for all Elements, whether form class or from source.
`ElementUtilities` would normally be a fine place for a well-defined method,
but I suspect this method may be a bit vague (and possibly single-purpose), so
`SourceUtils` would sound better for a method like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists