@Test public void extract_A$String_StringIsNull() throws Exception { Configuration config = new Configuration(); ImportedListExtractor target = new ImportedListExtractor(config); String sourceCodeString = null; try { target.extract(sourceCodeString); fail(); } catch (JUnitHelperCoreException e) { } }
public List<String> extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); List<String> dest = new ArrayList<String>(); sourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString).replaceAll(RegExp.CRLF, StringValue.Space); String[] splittedArray = sourceCodeString.split("import\\s+"); int len = splittedArray.length; for (int i = 1; i < len; i++) { String each = splittedArray[i].trim(); if (each.matches("\\s*(static)*[^;]+?;")) { dest.add(each.replaceAll(";", "")); } else if (each.matches("\\s*(static)*.+?;.+")) { dest.add(each.split(";")[0]); } } return dest; }
ImportedListExtractor { public List<String> extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); List<String> dest = new ArrayList<String>(); sourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString).replaceAll(RegExp.CRLF, StringValue.Space); String[] splittedArray = sourceCodeString.split("import\\s+"); int len = splittedArray.length; for (int i = 1; i < len; i++) { String each = splittedArray[i].trim(); if (each.matches("\\s*(static)*[^;]+?;")) { dest.add(each.replaceAll(";", "")); } else if (each.matches("\\s*(static)*.+?;.+")) { dest.add(each.split(";")[0]); } } return dest; } }
ImportedListExtractor { public List<String> extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); List<String> dest = new ArrayList<String>(); sourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString).replaceAll(RegExp.CRLF, StringValue.Space); String[] splittedArray = sourceCodeString.split("import\\s+"); int len = splittedArray.length; for (int i = 1; i < len; i++) { String each = splittedArray[i].trim(); if (each.matches("\\s*(static)*[^;]+?;")) { dest.add(each.replaceAll(";", "")); } else if (each.matches("\\s*(static)*.+?;.+")) { dest.add(each.split(";")[0]); } } return dest; } ImportedListExtractor(Configuration config); }
ImportedListExtractor { public List<String> extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); List<String> dest = new ArrayList<String>(); sourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString).replaceAll(RegExp.CRLF, StringValue.Space); String[] splittedArray = sourceCodeString.split("import\\s+"); int len = splittedArray.length; for (int i = 1; i < len; i++) { String each = splittedArray[i].trim(); if (each.matches("\\s*(static)*[^;]+?;")) { dest.add(each.replaceAll(";", "")); } else if (each.matches("\\s*(static)*.+?;.+")) { dest.add(each.split(";")[0]); } } return dest; } ImportedListExtractor(Configuration config); List<String> extract(String sourceCodeString); }
ImportedListExtractor { public List<String> extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); List<String> dest = new ArrayList<String>(); sourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString).replaceAll(RegExp.CRLF, StringValue.Space); String[] splittedArray = sourceCodeString.split("import\\s+"); int len = splittedArray.length; for (int i = 1; i < len; i++) { String each = splittedArray[i].trim(); if (each.matches("\\s*(static)*[^;]+?;")) { dest.add(each.replaceAll(";", "")); } else if (each.matches("\\s*(static)*.+?;.+")) { dest.add(each.split(";")[0]); } } return dest; } ImportedListExtractor(Configuration config); List<String> extract(String sourceCodeString);  }