@Test void getCanonicalName_packageIsEmpty() { proto.setPackage(new Package(proto, "")); String name = UserTypeUtil.getCanonicalName(message); assertEquals("MessageName", name); }
public static String getCanonicalName(UserType userType) { String name = getClassName(userType); String canonicalName; if (userType.isNested()) { Message parent = (Message) userType.getParent(); canonicalName = getCanonicalName(parent) + '.' + name; } else { Proto proto = userType.getProto(); String pkg = ProtoUtil.getPackage(proto); if (pkg.isEmpty()) { canonicalName = name; } else { canonicalName = pkg + '.' + name; } } return canonicalName; }
UserTypeUtil { public static String getCanonicalName(UserType userType) { String name = getClassName(userType); String canonicalName; if (userType.isNested()) { Message parent = (Message) userType.getParent(); canonicalName = getCanonicalName(parent) + '.' + name; } else { Proto proto = userType.getProto(); String pkg = ProtoUtil.getPackage(proto); if (pkg.isEmpty()) { canonicalName = name; } else { canonicalName = pkg + '.' + name; } } return canonicalName; } }
UserTypeUtil { public static String getCanonicalName(UserType userType) { String name = getClassName(userType); String canonicalName; if (userType.isNested()) { Message parent = (Message) userType.getParent(); canonicalName = getCanonicalName(parent) + '.' + name; } else { Proto proto = userType.getProto(); String pkg = ProtoUtil.getPackage(proto); if (pkg.isEmpty()) { canonicalName = name; } else { canonicalName = pkg + '.' + name; } } return canonicalName; } private  UserTypeUtil(); }
UserTypeUtil { public static String getCanonicalName(UserType userType) { String name = getClassName(userType); String canonicalName; if (userType.isNested()) { Message parent = (Message) userType.getParent(); canonicalName = getCanonicalName(parent) + '.' + name; } else { Proto proto = userType.getProto(); String pkg = ProtoUtil.getPackage(proto); if (pkg.isEmpty()) { canonicalName = name; } else { canonicalName = pkg + '.' + name; } } return canonicalName; } private  UserTypeUtil(); static String getClassName(UserType userType); static String getCanonicalName(UserType userType); }
UserTypeUtil { public static String getCanonicalName(UserType userType) { String name = getClassName(userType); String canonicalName; if (userType.isNested()) { Message parent = (Message) userType.getParent(); canonicalName = getCanonicalName(parent) + '.' + name; } else { Proto proto = userType.getProto(); String pkg = ProtoUtil.getPackage(proto); if (pkg.isEmpty()) { canonicalName = name; } else { canonicalName = pkg + '.' + name; } } return canonicalName; } private  UserTypeUtil(); static String getClassName(UserType userType); static String getCanonicalName(UserType userType);  }