Always suppress unchecked warnings on an individual declaration plus
assignment, not an entire method. Eclipse is helpfully stupid about this, but we'll just have to use our big brains and help it out. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@701 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -80,6 +80,5 @@ public abstract class StatModifier<T extends Stat>
|
||||
public abstract void modify (T stat);
|
||||
|
||||
/** The type of the stat on which we're operating. */
|
||||
@NotStreamable
|
||||
protected Stat.Type _type;
|
||||
@NotStreamable protected Stat.Type _type;
|
||||
}
|
||||
|
||||
@@ -65,19 +65,19 @@ public final class StatSet extends DSet<Stat>
|
||||
* It will increment the Stat's modCount, and won't set its dirty bit if it's not already
|
||||
* set, to prevent the Stat from being re-written to the repo unnecessarily.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Stat> void syncStat (StatModifier<T> modifier)
|
||||
{
|
||||
boolean wasModified = false;
|
||||
Stat stat = getStat(modifier.getType());
|
||||
@SuppressWarnings("unchecked") T stat = (T)getStat(modifier.getType());
|
||||
if (stat != null) {
|
||||
wasModified = stat.isModified();
|
||||
modifier.modify((T)stat);
|
||||
modifier.modify(stat);
|
||||
updateStat(stat);
|
||||
|
||||
} else {
|
||||
stat = modifier.getType().newStat();
|
||||
modifier.modify((T)stat);
|
||||
@SuppressWarnings("unchecked") T nstat = (T)modifier.getType().newStat();
|
||||
stat = nstat;
|
||||
modifier.modify(stat);
|
||||
addStat(stat);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user