gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
Hash, hashCode i null vrednosti
[spa2-materijali.git] / Hash / Kancelarija.java
index 9447969..6d157b5 100644 (file)
@@ -64,7 +64,12 @@ public class Kancelarija extends InfoTip {
        }
 
        public int hashCode() {
-               return prezime.hashCode() * broj;
+               int rez = 1;
+               if (prezime != null) {
+                       rez *= prezime.hashCode();
+               }
+               rez *= broj;
+               return rez;
        }
 
        @Override
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner