diff --git a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java
index b340f458c38e..c8e8ed97e9e5 100644
--- a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java
+++ b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java
@@ -43,6 +43,7 @@ import java.util.Map;
*
* @author Vladimir Kondratyev
*/
+@SuppressWarnings({"NonPrivateFieldAccessedInSynchronizedContext", "FieldAccessedSynchronizedAndUnsynchronized", "UnusedDeclaration"})
public class SimpleColoredComponent extends JComponent implements Accessible {
private static final Logger LOG = Logger.getInstance("#com.intellij.ui.SimpleColoredComponent");
public static final Color STYLE_SEARCH_MATCH_BACKGROUND = new Color(250, 250, 250, 140);
@@ -78,7 +79,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
* if the component represents a selected item in a focused JList.
* Border can be null.
*/
- private MyBorder myBorder;
+ private Border myBorder;
private int myMainTextLastIndex = -1;
@@ -107,6 +108,8 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
/**
* Appends string fragments to existing ones. Appended string
* will have specified attributes.
+ * @param fragment text fragment
+ * @param attributes text attributes
*/
public final void append(@NotNull final String fragment, @NotNull final SimpleTextAttributes attributes) {
append(fragment, attributes, myMainTextLastIndex < 0);
@@ -115,17 +118,22 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
/**
* Appends string fragments to existing ones. Appended string
* will have specified attributes.
+ * @param fragment text fragment
+ * @param attributes text attributes
+ * @param isMainText main text of not
*/
public void append(@NotNull final String fragment, @NotNull final SimpleTextAttributes attributes, boolean isMainText) {
- synchronized (this) {
- myFragments.add(fragment);
- myAttributes.add(attributes);
- if (isMainText) {
- myMainTextLastIndex = myFragments.size() - 1;
- }
- }
+ _append(fragment, attributes, isMainText);
revalidateAndRepaint();
}
+
+ private synchronized void _append(@NotNull final String fragment, @NotNull final SimpleTextAttributes attributes, boolean isMainText) {
+ myFragments.add(fragment);
+ myAttributes.add(attributes);
+ if (isMainText) {
+ myMainTextLastIndex = myFragments.size() - 1;
+ }
+ }
private void revalidateAndRepaint() {
if (myAutoInvalidate) {
@@ -136,19 +144,21 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
}
public void append(@NotNull final String fragment, @NotNull final SimpleTextAttributes attributes, Object tag) {
- synchronized (this) {
- append(fragment, attributes);
- if (myFragmentTags == null) {
- myFragmentTags = new ArrayList