@Test public void getCanonicalClassNameInMethodName_A$() throws Exception { String canonicalClassName = "com.example.Bean"; ExtInstantiation target = new ExtInstantiation(canonicalClassName); String actual = target.getCanonicalClassNameInMethodName(); String expected = "ceBean"; assertThat(actual, is(equalTo(expected))); }
public String getCanonicalClassNameInMethodName() { String[] splitted = canonicalClassName.replaceFirst("java\\.lang\\.", "").split("\\."); StringBuilder buf = new StringBuilder(); if (splitted.length == 1) { buf.append(splitted[0]); } else { for (int i = 0; i < (splitted.length - 1); i++) { buf.append(splitted[i].subSequence(0, 1)); } buf.append(splitted[splitted.length - 1]); } return buf.toString(); }
ExtInstantiation { public String getCanonicalClassNameInMethodName() { String[] splitted = canonicalClassName.replaceFirst("java\\.lang\\.", "").split("\\."); StringBuilder buf = new StringBuilder(); if (splitted.length == 1) { buf.append(splitted[0]); } else { for (int i = 0; i < (splitted.length - 1); i++) { buf.append(splitted[i].subSequence(0, 1)); } buf.append(splitted[splitted.length - 1]); } return buf.toString(); } }
ExtInstantiation { public String getCanonicalClassNameInMethodName() { String[] splitted = canonicalClassName.replaceFirst("java\\.lang\\.", "").split("\\."); StringBuilder buf = new StringBuilder(); if (splitted.length == 1) { buf.append(splitted[0]); } else { for (int i = 0; i < (splitted.length - 1); i++) { buf.append(splitted[i].subSequence(0, 1)); } buf.append(splitted[splitted.length - 1]); } return buf.toString(); } ExtInstantiation(String canonicalClassName); }
ExtInstantiation { public String getCanonicalClassNameInMethodName() { String[] splitted = canonicalClassName.replaceFirst("java\\.lang\\.", "").split("\\."); StringBuilder buf = new StringBuilder(); if (splitted.length == 1) { buf.append(splitted[0]); } else { for (int i = 0; i < (splitted.length - 1); i++) { buf.append(splitted[i].subSequence(0, 1)); } buf.append(splitted[splitted.length - 1]); } return buf.toString(); } ExtInstantiation(String canonicalClassName); String getCanonicalClassNameInMethodName(); }
ExtInstantiation { public String getCanonicalClassNameInMethodName() { String[] splitted = canonicalClassName.replaceFirst("java\\.lang\\.", "").split("\\."); StringBuilder buf = new StringBuilder(); if (splitted.length == 1) { buf.append(splitted[0]); } else { for (int i = 0; i < (splitted.length - 1); i++) { buf.append(splitted[i].subSequence(0, 1)); } buf.append(splitted[splitted.length - 1]); } return buf.toString(); } ExtInstantiation(String canonicalClassName); String getCanonicalClassNameInMethodName(); public String canonicalClassName; public List<String> importList; public String preAssignCode; public String assignCode; public String postAssignCode; }