@Test public void testGetLabel() { List<Abbreviation> abbreviations = Lists.newArrayList(new Abbreviation("com.my", "C"), new Abbreviation("org.apache", "A")); assertThat(GraphExportStyles.getLabel(abbreviations, "com.my.any.Clazz"), is("C.any.Clazz")); assertThat(GraphExportStyles.getLabel(abbreviations, "org.apache.Helper"), is("A.Helper")); assertThat(GraphExportStyles.getLabel(abbreviations, "org.apache"), is("A")); assertThat(GraphExportStyles.getLabel(abbreviations, "org"), is("org")); }
@SuppressWarnings("squid:S4248") public static String getLabel(List<Abbreviation> abbreviations, String name) { checkNotNull(abbreviations, "abbreviations"); if (name == null) { return null; } String result = name; for (Abbreviation abbreviation : abbreviations) { result = abbreviation.abbreviate(result); } result = result.replaceAll("_ROOT$", ""); return result; }
GraphExportStyles { @SuppressWarnings("squid:S4248") public static String getLabel(List<Abbreviation> abbreviations, String name) { checkNotNull(abbreviations, "abbreviations"); if (name == null) { return null; } String result = name; for (Abbreviation abbreviation : abbreviations) { result = abbreviation.abbreviate(result); } result = result.replaceAll("_ROOT$", ""); return result; } }
GraphExportStyles { @SuppressWarnings("squid:S4248") public static String getLabel(List<Abbreviation> abbreviations, String name) { checkNotNull(abbreviations, "abbreviations"); if (name == null) { return null; } String result = name; for (Abbreviation abbreviation : abbreviations) { result = abbreviation.abbreviate(result); } result = result.replaceAll("_ROOT$", ""); return result; } private  GraphExportStyles(); }
GraphExportStyles { @SuppressWarnings("squid:S4248") public static String getLabel(List<Abbreviation> abbreviations, String name) { checkNotNull(abbreviations, "abbreviations"); if (name == null) { return null; } String result = name; for (Abbreviation abbreviation : abbreviations) { result = abbreviation.abbreviate(result); } result = result.replaceAll("_ROOT$", ""); return result; } private  GraphExportStyles(); static EdgeStyle getEdgeStyle(Dependency rel); @SuppressWarnings("squid:S4248") // wants to move the RegExes into constants; would not help readability here. static String getId(String classname); @SuppressWarnings("squid:S4248") // wants to move the RegExes into constants; would not help readability here. static String getLabel(List<Abbreviation> abbreviations, String name); }
GraphExportStyles { @SuppressWarnings("squid:S4248") public static String getLabel(List<Abbreviation> abbreviations, String name) { checkNotNull(abbreviations, "abbreviations"); if (name == null) { return null; } String result = name; for (Abbreviation abbreviation : abbreviations) { result = abbreviation.abbreviate(result); } result = result.replaceAll("_ROOT$", ""); return result; } private  GraphExportStyles(); static EdgeStyle getEdgeStyle(Dependency rel); @SuppressWarnings("squid:S4248") // wants to move the RegExes into constants; would not help readability here. static String getId(String classname); @SuppressWarnings("squid:S4248") // wants to move the RegExes into constants; would not help readability here. static String getLabel(List<Abbreviation> abbreviations, String name);  }