@Fix(IPPDiagnostics.ISSUE_UNWANTED_ML_COMMENT)
public void changeMLCommentToSLComment(final Issue issue, final IssueResolutionAcceptor acceptor) {
final IModificationContext modificationContext = getModificationContextFactory().createModificationContext(
issue);
final IXtextDocument xtextDocument = modificationContext.getXtextDocument();
xtextDocument.readOnly(new IUnitOfWork.Void<XtextResource>() {
@Override
public void process(XtextResource state) throws Exception {
resourceScope.enter(state);
try {
String issueString = xtextDocument.get(issue.getOffset(), issue.getLength());
final boolean endsWithBreak = issue.getData() != null && issue.getData().length == 1 &&
"true".equals(issue.getData()[0]);
CommentProcessor commentProcessor = new CommentProcessor();
JavaLikeMLCommentContainer mlContainer = new ICommentContainerInformation.JavaLikeMLCommentContainer();
HashSLCommentContainer hashContainer = new ICommentContainerInformation.HashSLCommentContainer();
int offsetOfNode = issue.getOffset();
int posOnLine = offsetOfNode -
Math.max(0, 1 + CharSequences.lastIndexOf(
xtextDocument.get(0, xtextDocument.getLength()), "\n", offsetOfNode - 1));
CommentText commentText = commentProcessor.separateCommentFromContainer(
issueString, mlContainer.create(posOnLine), "\n");
TextFlow result = commentProcessor.formatComment(
commentText, hashContainer.create(posOnLine), new CommentFormattingOptions(