Parcourir la source

[H C EC] Call to equals() comparing different types [EC_UNRELATED_TYPES]

This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime.
Julian il y a 16 ans
Parent
commit
6e671c0740
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

+ 1 - 2
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

@@ -2921,8 +2921,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
         if (_effectTemplates == null) 
         	return _emptyEffectSet;
         
-        if ((!effector.equals(effected)) && effected.isInvul())
-            return _emptyEffectSet;
+        if (effected.isInvul()) return _emptyEffectSet;
         
         if ((isDebuff() || isOffensive()) && effector.getOwner() != effected &&
         		effector.getOwner().isGM() &&