SimpleTextAttributes () { Color color = getColor(); // the most common case is no color, regular attributes, avoid memory allocation in this case return color == null ? SimpleTextAttributes.REGULAR_ATTRIBUTES : new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color); }