/*
 * FindBugs - Find Bugs in Java programs
 * Copyright (C) 2005, 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.ba;

import edu.umd.cs.findbugs.annotations.CheckForNull;

/**
 * @author pugh
 */
public class CheckReturnValueAnnotation extends AnnotationEnumeration {

	public final static CheckReturnValueAnnotation CHECK_RETURN_VALUE = new CheckReturnValueAnnotation(
			"CheckReturnValue", 1);

	public final static CheckReturnValueAnnotation OK_TO_IGNORE_RETURN_VALUE = new CheckReturnValueAnnotation(
			"OkToIgnoreReturnValue", 2);

	public final static CheckReturnValueAnnotation UNKNOWN_CHECKRETURNVALUE = new CheckReturnValueAnnotation(
			"UnknownCheckReturnValue", 0);

	private final static CheckReturnValueAnnotation[] myValues = { UNKNOWN_CHECKRETURNVALUE,
		CHECK_RETURN_VALUE, OK_TO_IGNORE_RETURN_VALUE };
	
	@CheckForNull public static CheckReturnValueAnnotation parse(String s) {
		for(CheckReturnValueAnnotation v : myValues) 
			if (s.endsWith(v.name)) return v;

		return null;
	}
	public static CheckReturnValueAnnotation[] values() {
		return myValues.clone();
	}

	private CheckReturnValueAnnotation(String s, int i) {
		super(s,i);
		
	}

	

}

@@ -1072,32 +1072,40 @@
 ECK_RETURN_VALUE
+_UNKNOWN
  = new CheckRetu
@@ -1127,16 +1127,23 @@
 on(%0A%09%09%09%22
+Unknown
 CheckRet
@@ -1157,13 +1157,12 @@
 e%22, 
-1
+0
 );%0A
-%0A
 %09pub
@@ -1205,28 +1205,159 @@
 otation 
-OK_TO_IGNORE
+CHECK_RETURN_VALUE_HIGH = new CheckReturnValueAnnotation(%0A%09%09%09%22CheckReturnValueHigh%22, 1);%0A%0A%09public final static CheckReturnValueAnnotation CHECK
 _RETURN_
@@ -1357,24 +1357,31 @@
 RETURN_VALUE
+_MEDIUM
  = new Check
@@ -1411,18 +1411,13 @@
 %09%09%09%22
-OkToIgnore
+Check
 Retu
@@ -1430,17 +1430,16 @@
 e%22, 2);%0A
-%0A
 %09public 
@@ -1482,32 +1482,30 @@
 ion 
-UNKNOWN_
 CHECK
+_
 RETURN
+_
 VALUE
+_LOW
  = n
@@ -1535,36 +1535,172 @@
 tation(%0A%09%09%09%22
-UnknownCheck
+CheckReturnValueLow%22, 3);%0A%09public final static CheckReturnValueAnnotation CHECK_RETURN_VALUE_IGNORE = new CheckReturnValueAnnotation(%0A%09%09%09%22OkToIgnore
 ReturnValue%22
@@ -1705,13 +1705,15 @@
 e%22, 
-0
+4
 );%0A%0A
+%0A%0A
 %09pri
@@ -1776,36 +1776,62 @@
 = %7B 
+CHECK_RETURN_VALUE_
 UNKNOWN
-_
+,%0A%09%09
 CHECK
+_
 RETURN
+_
 VALUE
-,%0A%09%09
+_HIGH,
 CHEC
@@ -1848,22 +1848,46 @@
 ALUE
-, OK_TO_IGNORE
+_MEDIUM, CHECK_RETURN_VALUE_LOW, CHECK
 _RET
@@ -1895,16 +1895,23 @@
 RN_VALUE
+_IGNORE
  %7D;%0A%09%0A%09@

Add priority levels