While I agree that redundant code isn't optimal, I don't believe that putting this functionality in ChatColor is the proper solution.

Separating the color stripping method from MapPalette wouldn't be an appropriate course of action unless we were to also migrate the color codes, which most certainly do not belong in ChatColor.

If anything, we'd have to move such a function to a utility class and call it from both ChatColor and MapPalette.

On Apr 21, 2013, at 13:44, ST-DDT <notifications@github.com> wrote:

> In src/main/java/org/bukkit/map/MapPalette.java:
> 
> >  
> >  /**
> >   * Represents the palette that map items use.
> >   */
> >  public final class MapPalette {
> > +    public static final char COLOR_CHAR = '\u00A7';
> > +    private static final Pattern STRIP_COLOR_PATTERN = Pattern.compile(String.valueOf(COLOR_CHAR) + "[0-9]+;");
> But i guess it still should be added to ChatColor.
> Including the same for Format Codes (although not required)
> Maybe split it to another PR including the strip methods stripColorCodesColors and stripColorCodesFormats
> 
> centralise logic/code to simplify maintenance
> 
> —
> Reply to this email directly or view it on GitHub.