/*
 * FindBugs - Find Bugs in Java programs
 * Copyright (C) 2003-2008 University of Maryland
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.umd.cs.findbugs;

public enum BugRankCategory {
    SCARIEST(4), SCARY(9), TROUBLING(14), OF_CONCERN(20);
    public final int maxRank;
    static public BugRankCategory getRank(int rank) {
        for(BugRankCategory c : values()) 
            if (rank <= c.maxRank)
                return c;
            
        throw new IllegalArgumentException("Rank of " + rank + " is outside legal rank");
    }

    private BugRankCategory(int maxRank) {
        this.maxRank = maxRank;
    }
}

@@ -1075,16 +1075,17 @@
 lues()) 
+%7B
 %0A       
@@ -1111,16 +1111,18 @@
 maxRank)
+ %7B
 %0A       
@@ -1152,16 +1152,27 @@
         
+%7D%0A        %7D
 %0A       
@@ -1296,32 +1296,32 @@
 (int maxRank) %7B%0A
-
         this.max
@@ -1341,11 +1341,230 @@
 k;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        if(this == OF_CONCERN) %7B%0A            return %22Of Concern%22;%0A        %7D%0A        return name().substring(0,1) + name().toLowerCase().substring(1, name().length());%0A    %7D
 %0A%7D%0A

Provide human readable names