use of com.intellij.openapi.diff.impl.string.DiffStringBuilder in project intellij-community by JetBrains.
the class DiffFragment method appendText2.
public void appendText2(@Nullable DiffString str) {
if (str == null)
return;
if (myText2 instanceof DiffStringBuilder) {
((DiffStringBuilder) myText2).append(str);
return;
}
if (myText2 instanceof DiffString) {
DiffString text2 = (DiffString) myText2;
if (DiffString.canInplaceConcatenate(text2, str)) {
myText2 = DiffString.concatenate(text2, str);
} else {
DiffStringBuilder builder = new DiffStringBuilder(text2.length() + str.length());
builder.append(text2);
builder.append(str);
myText2 = builder;
}
return;
}
throw new IllegalStateException("Bad DiffFragment: " + (myText2 != null ? myText2.getClass() : "null"));
}
use of com.intellij.openapi.diff.impl.string.DiffStringBuilder in project intellij-community by JetBrains.
the class DiffFragment method appendText1.
public void appendText1(@Nullable DiffString str) {
if (str == null)
return;
if (myText1 instanceof DiffStringBuilder) {
((DiffStringBuilder) myText1).append(str);
return;
}
if (myText1 instanceof DiffString) {
DiffString text1 = (DiffString) myText1;
if (DiffString.canInplaceConcatenate(text1, str)) {
myText1 = DiffString.concatenate(text1, str);
} else {
DiffStringBuilder builder = new DiffStringBuilder(text1.length() + str.length());
builder.append(text1);
builder.append(str);
myText1 = builder;
}
return;
}
throw new IllegalStateException("Bad DiffFragment: " + (myText1 != null ? myText1.getClass() : "null"));
}
Aggregations