Buggy code:
public class SquintMainWindow extends JPanel implements KeyListener { private static final long serialVersionUID = - 8781116976800446850L ; public static final String TITLE = "...Squares<seq2seq4repair_space>Interactive<seq2seq4repair_space>GUI..." ; public static final String AVATAR_SUBDIR = "avatars//re//" ; public static final String IMAGES_DIR = "res//images//" ; public static final List < String > SOLIDS = Arrays . asList ( "wall" , "trans" ) ; public static final int CANVAS_WIDTH = 800 ; public static final int CANVAS_HEIGHT = 800 ; private final boolean AI_MODE = false ; private Player [ ] ai_players ; private Timer autoMoveTimer ; private static final int NUM_AI_PLAYERS = 1972 ; public static final int AI_MOVE_DELAY = 100 ; public static final int TERRAIN_ANIMATION_DELAY = 200 ; public Player player = null ; public int num_players = 0 ; public List < Integer > heldKeys = new ArrayList < Integer > ( ) ; public static final int MAP_DIM = 40 ; private static enum Level { interior , exterior ; } private BufferedImage roomBackgroundImage = null ; private MapSquare [ ] [ ] mapSquares = null ; private MapSquare [ ] animatedSquares = null ; Map level = null ; public static final int MAP_LAYERS = 4 ; AvatarGroup avatars = null ; public static final int MAP_LEVEL = 0 ; private ResourceLoader resLoad = null ; public SquintMainWindow ( ) { } private void editLevel ( MapEditor level ) { } private void initAI ( ) { } public BufferedImage makeImage ( Texture [ ] [ ] [ ] textures , Point [ ] [ ] coords ) { } @ Override public void paintComponent ( Graphics g ) { } private void drawMap ( Graphics g , SquintMainWindow . Level level ) { } private void drawAnimatedTerrain ( Graphics g ) { for ( MapSquare animatedSquare : animatedSquares ) { <START_BUG> drawImageToGrid ( level . map . animator . getCurrentPhaseTexture ( ) . textureFile , ( ( animatedSquare . row ) * ( SquintMainWindow . MAP_DIM ) ) , ( ( animatedSquare . col ) * ( SquintMainWindow . MAP_DIM ) ) , g , false , false ) ; <END_BUG> } } private void drawAvatars ( Graphics2D g2d , boolean modeIsAI ) { } private void drawGrid ( Graphics g , Texture [ ] [ ] [ ] textures , Point [ ] [ ] coords ) { } private void drawImageToGrid ( File imageFile , int x_coord , int y_coord , Graphics g , boolean isShading , boolean scaleImage ) { } private Image resizeToBig ( Image originalImage , int biggerWidth , int biggerHeight ) { } private void drawPlayer ( Player player , Graphics g ) { } public static void main ( String [ ] args ) { } @ Override public void keyPressed ( KeyEvent e ) { } private void movePlayer ( int direction , Player player ) { } public void changeMapOccupation ( int playerX , int playerY , int playerIdx , Boolean occupied ) { } public class PlayerAnimator implements Callable < Void > { private Player player = null ; public void setPlayer ( Player player ) { } @ Override public Void call ( ) throws Exception { } } public class TerrainAnimator implements Callable < Void > { @ Override public Void call ( ) throws Exception { } } private void updatePlayerLocation ( Player player ) { } private Point getNewPlayerPosition ( Player player , int direction ) { } @ Override public void keyReleased ( KeyEvent e ) { } @ Override public void keyTyped ( KeyEvent e ) { } }

Fix:
drawImageToGrid ( level . map . animator . getCurrentPhaseTexture ( ) . textureFile , ( ( animatedSquare . col ) * ( SquintMainWindow . MAP_DIM ) ) , ( ( animatedSquare . row ) * ( SquintMainWindow . MAP_DIM ) ) , g , false , false ) ;