KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > BugCode


1 /*
2  * FindBugs - Find bugs in Java programs
3  * Copyright (C) 2003,2004 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
20 package edu.umd.cs.findbugs;
21
22 /**
23  * A BugCode is an abbreviation that is shared among some number
24  * of BugPatterns. For example, the code "HE" is shared by
25  * all of the BugPatterns that represent hashcode/equals
26  * violations.
27  *
28  * @author David Hovemeyer
29  * @see BugPattern
30  */

31 public class BugCode {
32     private final String JavaDoc abbrev;
33     private final String JavaDoc description;
34
35     /**
36      * Constructor.
37      *
38      * @param abbrev the abbreviation for the bug code
39      * @param description a short textual description of the class of bug pattern
40      * represented by this bug code
41      */

42     public BugCode(String JavaDoc abbrev, String JavaDoc description) {
43         this.abbrev = abbrev;
44         this.description = description;
45     }
46
47     /**
48      * Get the abbreviation for this bug code.
49      */

50     public String JavaDoc getAbbrev() {
51         return abbrev;
52     }
53
54     /**
55      * Get the short textual description of the bug code.
56      */

57     public String JavaDoc getDescription() {
58         return description;
59     }
60     
61     /**
62      * Get the abbreviation fo this bug code.
63      */

64     @Override JavaDoc
65     public String JavaDoc toString() {
66         return "BugCode[" + abbrev + "]";
67     }
68 }
69
70 // vim:ts=4
71
Popular Tags