Skip to content

Commit

Permalink
Merge pull request #43 from dialex/fix/39-deprecate-clear
Browse files Browse the repository at this point in the history
BREAK: remove all usages of deprecated clear()
  • Loading branch information
dialex committed Dec 28, 2019
2 parents a5e5e75 + 23aee80 commit 094a305
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,4 @@ private void formattedPrint(Object msg, String ansiFormatCode, boolean appendNew
String formattedMsg = Ansi.formatMessage(output.toString(), ansiFormatCode);
System.out.print(formattedMsg);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ public void setBackgroundColor(BColor c) {
// OTHER METHODS
// ===============

@Override
@Deprecated
public void clear() {
setAttribute(Attribute.CLEAR);
setForegroundColor(FColor.NONE);
setBackgroundColor(BColor.NONE);
print(""); // refresh terminal line, so that the changes take immediate effect
}

@Override
@Deprecated
public String generateCode() {
Expand All @@ -97,4 +88,4 @@ public String generateCode() {
public String generateCode(Attribute attr, FColor fg, BColor bg) {
return Ansi.generateCode(attr, fg, bg);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ public interface IColoredPrinter extends IPrinter {
*/
void setBackgroundColor(BColor background);

/**
* Clears the current format and sets it to terminal's default format.
*/
@Deprecated
void clear();

/**
* @return the ansi code which contains all three components' codes. This is
* the code used to tell the terminal the format of the message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public void ShouldColorForegroundEvenWithoutBackground() {

// ACT
cp.println("Should have YELLOW foreground");
cp.clear();

// ASSERT
assertThat("This test is for humans only, so it always passes on CI", true, is(true));
Expand Down

0 comments on commit 094a305

Please sign in to comment.