@Test public void testParseNoDocumentation() throws Exception { final int startIndex = 3478; @SuppressWarnings("unchecked") final List<String> lines = mock(List.class); final int endingIndex = 1377; final String parameterName = "parameter_name"; final String smooshed = "@param " + parameterName; final DocumentationTagIndexedSmoosher smoosher = mock(DocumentationTagIndexedSmoosher.class); when(smoosher.getEndingIndex()).thenReturn(endingIndex); when(smoosher.smoosh(startIndex, lines)).thenReturn(smooshed); whenNew(DocumentationTagIndexedSmoosher.class).withNoArguments().thenReturn(smoosher); final Parameter parameter = parser.parse(startIndex, lines); assertThat(parameter.getName()).isEqualTo(parameterName); assertThat(parameter.getDescription()).isEmpty(); }
@Override public Parameter parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int tagEndPos = smooshed.indexOf(' '); final int descriptionStartPos = smooshed.indexOf(' ', tagEndPos + 1); if (descriptionStartPos < 0) { return new Parameter(smooshed.substring(tagEndPos + 1)); } return new Parameter(smooshed.substring(tagEndPos + 1, descriptionStartPos), smooshed.substring(descriptionStartPos + 1)); } finally { point.collect(); } }
ParameterParser extends AbstractIndexedParser<Parameter> { @Override public Parameter parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int tagEndPos = smooshed.indexOf(' '); final int descriptionStartPos = smooshed.indexOf(' ', tagEndPos + 1); if (descriptionStartPos < 0) { return new Parameter(smooshed.substring(tagEndPos + 1)); } return new Parameter(smooshed.substring(tagEndPos + 1, descriptionStartPos), smooshed.substring(descriptionStartPos + 1)); } finally { point.collect(); } } }
ParameterParser extends AbstractIndexedParser<Parameter> { @Override public Parameter parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int tagEndPos = smooshed.indexOf(' '); final int descriptionStartPos = smooshed.indexOf(' ', tagEndPos + 1); if (descriptionStartPos < 0) { return new Parameter(smooshed.substring(tagEndPos + 1)); } return new Parameter(smooshed.substring(tagEndPos + 1, descriptionStartPos), smooshed.substring(descriptionStartPos + 1)); } finally { point.collect(); } }  }
ParameterParser extends AbstractIndexedParser<Parameter> { @Override public Parameter parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int tagEndPos = smooshed.indexOf(' '); final int descriptionStartPos = smooshed.indexOf(' ', tagEndPos + 1); if (descriptionStartPos < 0) { return new Parameter(smooshed.substring(tagEndPos + 1)); } return new Parameter(smooshed.substring(tagEndPos + 1, descriptionStartPos), smooshed.substring(descriptionStartPos + 1)); } finally { point.collect(); } }  @Override boolean canParse(final String line); @Override Parameter parse(final int startingIndex, final List<String> lines); }
ParameterParser extends AbstractIndexedParser<Parameter> { @Override public Parameter parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int tagEndPos = smooshed.indexOf(' '); final int descriptionStartPos = smooshed.indexOf(' ', tagEndPos + 1); if (descriptionStartPos < 0) { return new Parameter(smooshed.substring(tagEndPos + 1)); } return new Parameter(smooshed.substring(tagEndPos + 1, descriptionStartPos), smooshed.substring(descriptionStartPos + 1)); } finally { point.collect(); } }  @Override boolean canParse(final String line); @Override Parameter parse(final int startingIndex, final List<String> lines);  }