[Clirr-devel] CVS: clirr/core/src/java/net/sf/clirr/core Severity.java, 1.2, 1.3
Status: Alpha
Brought to you by:
lkuehne
From: Lars Küh. <lk...@us...> - 2009-03-24 21:32:55
|
Update of /cvsroot/clirr/clirr/core/src/java/net/sf/clirr/core In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21085/core/src/java/net/sf/clirr/core Modified Files: Severity.java Log Message: code cleanup and fixes for findbug problems Index: Severity.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/java/net/sf/clirr/core/Severity.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Severity.java 3 Aug 2005 17:16:13 -0000 1.2 +++ Severity.java 24 Mar 2009 21:32:43 -0000 1.3 @@ -27,8 +27,8 @@ public final class Severity implements Comparable { - private String representation; - private int value; + private final String representation; + private final int value; private Severity(String representation, int value) { @@ -57,4 +57,27 @@ Severity other = (Severity) o; return this.value - other.value; } + + public int hashCode() + { + return value; + } + + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + Severity other = (Severity) obj; + return (value == other.value); + } } |