@Ignore @Test public void testNotFirstLineNoLeadingSpaces() { doReturn("").when(document).getLineContent(0); doReturn("") .build(); Assert.assertEquals(expected, output); }
@Override public TextChange processChange(final TextChange change, ReadOnlyDocument document) { final RegExp regex = RegExp.compile("^\n(\\s*)\\*\\s*$"); final MatchResult matchResult = regex.exec(change.getNewText()); if (matchResult != null) { final String line = document.getLineContent(change.getFrom().getLine()); return new TextChange.Builder().from(change.getFrom()).to(change.getFrom()).insert(modifiedInsert).build(); } else { return null; } }
CloseCStyleCommentChangeInterceptor implements TextChangeInterceptor { @Override public TextChange processChange(final TextChange change, ReadOnlyDocument document) { final RegExp regex = RegExp.compile("^\n(\\s*)\\*\\s*$"); final MatchResult matchResult = regex.exec(change.getNewText()); if (matchResult != null) { final String line = document.getLineContent(change.getFrom().getLine()); return new TextChange.Builder().from(change.getFrom()).to(change.getFrom()).insert(modifiedInsert).build(); } else { return null; } } }
CloseCStyleCommentChangeInterceptor implements TextChangeInterceptor { @Override public TextChange processChange(final TextChange change, ReadOnlyDocument document) { final RegExp regex = RegExp.compile("^\n(\\s*)\\*\\s*$"); final MatchResult matchResult = regex.exec(change.getNewText()); if (matchResult != null) { final String line = document.getLineContent(change.getFrom().getLine()); return new TextChange.Builder().from(change.getFrom()).to(change.getFrom()).insert(modifiedInsert).build(); } else { return null; } }  }
CloseCStyleCommentChangeInterceptor implements TextChangeInterceptor { @Override public TextChange processChange(final TextChange change, ReadOnlyDocument document) { final RegExp regex = RegExp.compile("^\n(\\s*)\\*\\s*$"); final MatchResult matchResult = regex.exec(change.getNewText()); if (matchResult != null) { final String line = document.getLineContent(change.getFrom().getLine()); return new TextChange.Builder().from(change.getFrom()).to(change.getFrom()).insert(modifiedInsert).build(); } else { return null; } }  @Override TextChange processChange(final TextChange change, ReadOnlyDocument document); }
CloseCStyleCommentChangeInterceptor implements TextChangeInterceptor { @Override public TextChange processChange(final TextChange change, ReadOnlyDocument document) { final RegExp regex = RegExp.compile("^\n(\\s*)\\*\\s*$"); final MatchResult matchResult = regex.exec(change.getNewText()); if (matchResult != null) { final String line = document.getLineContent(change.getFrom().getLine()); return new TextChange.Builder().from(change.getFrom()).to(change.getFrom()).insert(modifiedInsert).build(); } else { return null; } }  @Override TextChange processChange(final TextChange change, ReadOnlyDocument document);  }