#1674 - For ProfileLocation use in constructors trim label <init> to init .... (for safe label)

This commit is contained in:
rob bygrave committed 2019-04-12 02:25:05 +12:00
1 parent 2639e799c5
commit d32559baf4
3 files changed
+48 -3

No files matched your search

@@ -7,8 +7,19 @@ final class UtilLocation {
if (pos == -1) {
return shortDescription;
} else {
return shortDescription.substring(0, pos);
return trimInit(shortDescription.substring(0, pos));
}
}
/**
* Trim constructor init to be "safe" without greater than or less than chars.
*/
private static String trimInit(String desc) {
if (desc.endsWith("<init>")) {
// trim to make a safe label
return desc.substring(0, desc.length() - 6) + "init";
}
return desc;
}
}