Merge pull request #1381 from thatsIch/e-overriden-annotions

Adds annotations by contract of the interface
This commit is contained in:
thatsIch 2015-05-02 19:22:19 +02:00
commit 503d325021
5 changed files with 20 additions and 9 deletions

View file

@ -19,6 +19,8 @@
package appeng.client.me;
import javax.annotation.Nonnull;
import net.minecraft.util.StatCollector;
import appeng.tile.inventory.AppEngInternalInventory;
@ -52,7 +54,7 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
}
@Override
public int compareTo( ClientDCInternalInv o )
public int compareTo( @Nonnull ClientDCInternalInv o )
{
return ItemSorters.compareLong( this.sortBy, o.sortBy );
}

View file

@ -19,6 +19,8 @@
package appeng.container.implementations;
import javax.annotation.Nonnull;
import appeng.api.networking.crafting.ICraftingCPU;
import appeng.util.ItemSorters;
@ -40,7 +42,7 @@ public class CraftingCPURecord implements Comparable<CraftingCPURecord>
}
@Override
public int compareTo( CraftingCPURecord o )
public int compareTo( @Nonnull CraftingCPURecord o )
{
int a = ItemSorters.compareLong( o.processors, this.processors );
if( a != 0 )

View file

@ -22,6 +22,7 @@ package appeng.crafting;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import javax.annotation.Nonnull;
import appeng.api.networking.crafting.ICraftingWatcher;
import appeng.api.networking.crafting.ICraftingWatcherHost;
@ -68,20 +69,23 @@ public class CraftingWatcher implements ICraftingWatcher
return this.myInterests.contains( o );
}
@Nonnull
@Override
public Iterator<IAEStack> iterator()
{
return new ItemWatcherIterator( this, this.myInterests.iterator() );
}
@Nonnull
@Override
public Object[] toArray()
{
return this.myInterests.toArray();
}
@Nonnull
@Override
public <T> T[] toArray( T[] a )
public <T> T[] toArray( @Nonnull T[] a )
{
return this.myInterests.toArray( a );
}
@ -104,13 +108,13 @@ public class CraftingWatcher implements ICraftingWatcher
}
@Override
public boolean containsAll( Collection<?> c )
public boolean containsAll( @Nonnull Collection<?> c )
{
return this.myInterests.containsAll( c );
}
@Override
public boolean addAll( Collection<? extends IAEStack> c )
public boolean addAll( @Nonnull Collection<? extends IAEStack> c )
{
boolean didChange = false;
@ -123,7 +127,7 @@ public class CraftingWatcher implements ICraftingWatcher
}
@Override
public boolean removeAll( Collection<?> c )
public boolean removeAll( @Nonnull Collection<?> c )
{
boolean didSomething = false;
for( Object o : c )
@ -134,7 +138,7 @@ public class CraftingWatcher implements ICraftingWatcher
}
@Override
public boolean retainAll( Collection<?> c )
public boolean retainAll( @Nonnull Collection<?> c )
{
boolean changed = false;
Iterator<IAEStack> i = this.iterator();

View file

@ -19,6 +19,8 @@
package appeng.me.cache.helpers;
import javax.annotation.Nonnull;
import net.minecraft.crash.CrashReportCategory;
import appeng.api.networking.IGridNode;
@ -73,7 +75,7 @@ public class TickTracker implements Comparable<TickTracker>
}
@Override
public int compareTo( TickTracker t )
public int compareTo( @Nonnull TickTracker t )
{
int nextTick = (int) ( ( this.lastTick - this.host.getCurrentTick() ) + this.current_rate );
int ts_nextTick = (int) ( ( t.lastTick - this.host.getCurrentTick() ) + t.current_rate );

View file

@ -27,6 +27,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
import net.minecraft.block.Block;
import net.minecraft.world.World;
@ -175,7 +176,7 @@ public class CompassService implements ThreadFactory
}
@Override
public Thread newThread( Runnable job )
public Thread newThread( @Nonnull Runnable job )
{
return new Thread( job, "AE Compass Service" );
}