Returns the class name without its package prefix. @param clazz the class to shorten @return the shortened class name, or #NOT_APPLICABLE
(Class clazz)
| 358 | * @return the shortened class name, or {@link #NOT_APPLICABLE} |
| 359 | */ |
| 360 | public static String shortName(Class clazz) { |
| 361 | if (null == clazz) return NOT_APPLICABLE; |
| 362 | String className = clazz.getName(); |
| 363 | if (null == clazz.getPackage()) return className; |
| 364 | String packageName = clazz.getPackage().getName(); |
| 365 | int offset = packageName.length(); |
| 366 | if (offset > 0) offset++; |
| 367 | className = className.substring(offset); |
| 368 | return className; |
| 369 | } |
| 370 | |
| 371 | private static String makeTypesInfo(Class[] types) { |
| 372 | StringBuilder sb = new StringBuilder(32); |
no test coverage detected