KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > detect > RefComparisonWarningProperty


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

19 package edu.umd.cs.findbugs.detect;
20
21 import edu.umd.cs.findbugs.props.AbstractWarningProperty;
22 import edu.umd.cs.findbugs.props.PriorityAdjustment;
23
24 /**
25  * Warning properties for FindRefComparison detector.
26  *
27  * @author David Hovemeyer
28  */

29 public class RefComparisonWarningProperty extends AbstractWarningProperty {
30     private RefComparisonWarningProperty(String JavaDoc name, PriorityAdjustment priorityAdjustment) {
31         super(name, priorityAdjustment);
32     }
33     
34     /** There is a call to equals() in the method. */
35     public static final RefComparisonWarningProperty SAW_CALL_TO_EQUALS =
36         new RefComparisonWarningProperty("SAW_CALL_TO_EQUALS", PriorityAdjustment.LOWER_PRIORITY);
37     /** Method is private (or package-protected). */
38     public static final RefComparisonWarningProperty PRIVATE_METHOD =
39         new RefComparisonWarningProperty("PRIVATE_METHOD", PriorityAdjustment.LOWER_PRIORITY);
40     /** Comparing static strings using equals operator. */
41     public static final RefComparisonWarningProperty COMPARE_STATIC_STRINGS =
42         new RefComparisonWarningProperty("COMPARE_STATIC_STRINGS", PriorityAdjustment.FALSE_POSITIVE);
43     /** Comparing a dynamic string using equals operator. */
44     public static final RefComparisonWarningProperty DYNAMIC_AND_UNKNOWN =
45         new RefComparisonWarningProperty("DYNAMIC_AND_UNKNOWN", PriorityAdjustment.RAISE_PRIORITY);
46     public static final RefComparisonWarningProperty STRING_PARAMETER_IN_PUBLIC_METHOD =
47         new RefComparisonWarningProperty("STATIC_AND_PARAMETER_IN_PUBLIC_METHOD", PriorityAdjustment.RAISE_PRIORITY);
48     public static final RefComparisonWarningProperty STRING_PARAMETER =
49         new RefComparisonWarningProperty("STATIC_AND_PARAMETER", PriorityAdjustment.NO_ADJUSTMENT);
50
51     /** Comparing static string and an unknown string. */
52     public static final RefComparisonWarningProperty STATIC_AND_UNKNOWN =
53         new RefComparisonWarningProperty("STATIC_AND_UNKNOWN", PriorityAdjustment.LOWER_PRIORITY);
54     /** Saw a call to String.intern(). */
55     public static final RefComparisonWarningProperty SAW_INTERN =
56         new RefComparisonWarningProperty("SAW_INTERN", PriorityAdjustment.LOWER_PRIORITY);
57 }
58
Popular Tags