src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java

changeset 910
ebf7c13df6c0
parent 554
9d9f26857129
child 1359
25e14ad23cef
equal deleted inserted replaced
909:7798e3a5ecf5 910:ebf7c13df6c0
1 /* 1 /*
2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
224 public String flatSignature() { 224 public String flatSignature() {
225 return makeSignature(false); 225 return makeSignature(false);
226 } 226 }
227 227
228 private String makeSignature(boolean full) { 228 private String makeSignature(boolean full) {
229 StringBuffer result = new StringBuffer(); 229 StringBuilder result = new StringBuilder();
230 result.append("("); 230 result.append("(");
231 for (List<Type> types = sym.type.getParameterTypes(); types.nonEmpty(); ) { 231 for (List<Type> types = sym.type.getParameterTypes(); types.nonEmpty(); ) {
232 Type t = types.head; 232 Type t = types.head;
233 result.append(TypeMaker.getTypeString(env, t, full)); 233 result.append(TypeMaker.getTypeString(env, t, full));
234 types = types.tail; 234 types = types.tail;
249 } 249 }
250 250
251 /** 251 /**
252 * Generate a key for sorting. 252 * Generate a key for sorting.
253 */ 253 */
254 @Override
254 CollationKey generateKey() { 255 CollationKey generateKey() {
255 String k = name() + flatSignature() + typeParametersString(); 256 String k = name() + flatSignature() + typeParametersString();
256 // ',' and '&' are between '$' and 'a': normalize to spaces. 257 // ',' and '&' are between '$' and 'a': normalize to spaces.
257 k = k.replace(',', ' ').replace('&', ' '); 258 k = k.replace(',', ' ').replace('&', ' ');
258 // System.out.println("COLLATION KEY FOR " + this + " is \"" + k + "\""); 259 // System.out.println("COLLATION KEY FOR " + this + " is \"" + k + "\"");
261 262
262 /** 263 /**
263 * Return the source position of the entity, or null if 264 * Return the source position of the entity, or null if
264 * no position is available. 265 * no position is available.
265 */ 266 */
267 @Override
266 public SourcePosition position() { 268 public SourcePosition position() {
267 if (sym.enclClass().sourcefile == null) return null; 269 if (sym.enclClass().sourcefile == null) return null;
268 return SourcePositionImpl.make(sym.enclClass().sourcefile, 270 return SourcePositionImpl.make(sym.enclClass().sourcefile,
269 (tree==null) ? 0 : tree.pos, 271 (tree==null) ? 0 : tree.pos,
270 lineMap); 272 lineMap);

mercurial