To those who compare enums with .equals() -- moomarc, Sloth

Dear fellow developers, keep in ming that SpellAbility method getAPI() may return you a null and you'll get a funny NPE with the code you wrote like
http://stackoverflow.com/questions/1750 ... -or-equals
- Code: Select all
if (sa.getApi().toString().equals("DealDamage")) {
- and -
|| (!a.getApi().equals(ApiType.Mana) && !a.getApi().equals(ApiType.ManaReflected))) {
- Code: Select all
if (sa.getApi() == ApiType.DealDamage) {
- and -
|| (a.getApi() != ApiType.Mana && a.getApi() != ApiType.ManaReflected)) {
http://stackoverflow.com/questions/1750 ... -or-equals