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:
Michael Bayne
2008-08-04 12:56:08 +00:00
parent cf1972870e
commit 299d63fd14
2 changed files with 6 additions and 7 deletions
@@ -80,6 +80,5 @@ public abstract class StatModifier<T extends Stat>
public abstract void modify (T stat); public abstract void modify (T stat);
/** The type of the stat on which we're operating. */ /** The type of the stat on which we're operating. */
@NotStreamable @NotStreamable protected Stat.Type _type;
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 * 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. * set, to prevent the Stat from being re-written to the repo unnecessarily.
*/ */
@SuppressWarnings("unchecked")
public <T extends Stat> void syncStat (StatModifier<T> modifier) public <T extends Stat> void syncStat (StatModifier<T> modifier)
{ {
boolean wasModified = false; boolean wasModified = false;
Stat stat = getStat(modifier.getType()); @SuppressWarnings("unchecked") T stat = (T)getStat(modifier.getType());
if (stat != null) { if (stat != null) {
wasModified = stat.isModified(); wasModified = stat.isModified();
modifier.modify((T)stat); modifier.modify(stat);
updateStat(stat); updateStat(stat);
} else { } else {
stat = modifier.getType().newStat(); @SuppressWarnings("unchecked") T nstat = (T)modifier.getType().newStat();
modifier.modify((T)stat); stat = nstat;
modifier.modify(stat);
addStat(stat); addStat(stat);
} }