@@ -229,6 +229,7 @@ public static void writeEMailAddress(Writer out, String address)
229229 * @param urlPrefix a defined instance
230230 * @param project a possibly defined instance or null
231231 * @param symbol the symbol to write
232+ * @param id the symbol to write, normalized according to language-specific conventions
232233 * @param keywords a set of keywords recognized by this analyzer (no links
233234 * will be generated if the symbol is a keyword)
234235 * @param line the line number on which the symbol appears
@@ -240,7 +241,7 @@ public static void writeEMailAddress(Writer out, String address)
240241 * @throws IOException if an error occurs while writing to the stream
241242 */
242243 public static boolean writeSymbol (Writer out , Definitions defs ,
243- String urlPrefix , Project project , String symbol , Set <String > keywords ,
244+ String urlPrefix , Project project , String symbol , String id , Set <String > keywords ,
244245 int line , boolean caseSensitive , boolean isKeyword )
245246 throws IOException {
246247 String [] strs = new String [1 ];
@@ -255,7 +256,7 @@ public static boolean writeSymbol(Writer out, Definitions defs,
255256 return false ;
256257 }
257258
258- if (defs != null && defs .hasDefinitionAt (symbol , line , strs )) {
259+ if (defs != null && defs .hasDefinitionAt (id , line , strs )) {
259260 // This is the definition of the symbol.
260261 String type = strs [0 ];
261262 String style_class = "d" ;
@@ -281,15 +282,15 @@ public static boolean writeSymbol(Writer out, Definitions defs,
281282 out .append ("<a class=\" " );
282283 out .append (style_class );
283284 out .append ("\" name=\" " );
284- Util .htmlize (symbol , out );
285+ Util .htmlize (id , out );
285286 out .append ("\" />" );
286287 }
287288
288289 // 2) Create a link that searches for all references to this symbol.
289290 out .append ("<a href=\" " );
290291 out .append (urlPrefix );
291292 out .append ("refs=" );
292- Util .qurlencode (symbol , out );
293+ Util .qurlencode (id , out );
293294 appendProject (out , project );
294295 out .append ("\" class=\" " );
295296 out .append (style_class );
@@ -298,8 +299,8 @@ public static boolean writeSymbol(Writer out, Definitions defs,
298299 out .append (">" );
299300 Util .htmlize (symbol , out );
300301 out .append ("</a>" );
301- } else if (defs != null && defs .occurrences (symbol ) == 1 ) {
302- writeSameFileLinkSymbol (out , symbol );
302+ } else if (defs != null && defs .occurrences (id ) == 1 ) {
303+ writeSameFileLinkSymbol (out , symbol , id );
303304 } else {
304305 // This is a symbol that is not defined in this file, or a symbol
305306 // that is defined more than once in this file. In either case, we
@@ -308,7 +309,7 @@ public static boolean writeSymbol(Writer out, Definitions defs,
308309 out .append ("<a href=\" " );
309310 out .append (urlPrefix );
310311 out .append ("defs=" );
311- Util .qurlencode (symbol , out );
312+ Util .qurlencode (id , out );
312313 appendProject (out , project );
313314 out .append ("\" " );
314315 out .append (" class=\" intelliWindow-symbol\" " );
@@ -325,10 +326,11 @@ public static boolean writeSymbol(Writer out, Definitions defs,
325326 * exactly one location in the same file.
326327 * @param out a defined, target instance
327328 * @param symbol the symbol to write
329+ * @param id the symbol to write, normalized according to language-specific conventions
328330 * @throws IOException if {@link Writer#append(java.lang.CharSequence)}
329331 * fails
330332 */
331- public static void writeSameFileLinkSymbol (Writer out , String symbol )
333+ public static void writeSameFileLinkSymbol (Writer out , String symbol , String id )
332334 throws IOException {
333335 // This is a reference to a symbol defined exactly once in this file.
334336 String style_class = "d" ;
@@ -337,7 +339,7 @@ public static void writeSameFileLinkSymbol(Writer out, String symbol)
337339 out .append ("<a class=\" " );
338340 out .append (style_class );
339341 out .append (" intelliWindow-symbol\" href=\" #" );
340- Util .URIEncode (symbol , out );
342+ Util .URIEncode (id , out );
341343 out .append ("\" " );
342344 out .append (" data-definition-place=\" defined-in-file\" " );
343345 out .append (">" );
0 commit comments