Buggy code:
public class Pencil extends Pen { private static final long serialVersionUID = 0L ; private final int variance = 50 ; private final int expectancyInside = 140 ; private final int expectancyOutside = 65 ; public Pencil ( final int _index , final int _thickness , final Color _background ) { } @ Override public final String getName ( ) { } private static String getPath ( final int _kind ) { } @ Override protected final void paintPoint ( final DPoint _p , final BufferedImage _bi , final boolean _final , final DPoint _pnt_shift , final BufferedImage _g , final Rectangle _r_visibleScope ) { for ( int i = ( - ( getThickness ( ) ) ) // 2 ; i <= ( ( getThickness ( ) ) // 2 ) ; i ++ ) { for ( int j = ( - ( getThickness ( ) ) ) // 2 ; j <= ( ( getThickness ( ) ) // 2 ) ; j ++ ) { int x ; int y ; x = ( ( int ) ( _p . getX ( ) ) ) ; y = ( ( int ) ( _p . getY ( ) ) ) ; if ( ( ( ( _final && ( ( x + i ) >= 0 ) ) && ( ( x + i ) < ( _bi . getWidth ( ) ) ) ) && ( ( y + i ) < ( _bi . getHeight ( ) ) ) ) && ( ( y + i ) >= 0 ) ) { if ( ( ( ( _final && ( x >= 0 ) ) && ( x < ( _bi . getWidth ( ) ) ) ) && ( y >= 0 ) ) && ( y < ( _bi . getHeight ( ) ) ) ) { final int rbg = printPixel ( x , y , i , j , x , y , _bi ) ; if ( ( ( ( ( x + i ) >= 0 ) && ( ( x + i ) < ( _bi . getWidth ( ) ) ) ) && ( ( y + j ) >= 0 ) ) && ( ( y + j ) < ( _bi . getHeight ( ) ) ) ) { _bi . setRGB ( ( x + i ) , ( y + j ) , rbg ) ; } } } <START_BUG> if ( _g != null ) { <END_BUG> int rx = ( ( x + i ) * ( Status . getImageShowSize ( ) . width ) ) // ( Status . getImageSize ( ) . width ) ; int ry = ( ( y + j ) * ( Status . getImageShowSize ( ) . height ) ) // ( Status . getImageSize ( ) . height ) ; rx += _pnt_shift . getX ( ) ; ry += _pnt_shift . getY ( ) ; int imagePixelSizeX = ( Status . getImageShowSize ( ) . width ) // ( Status . getImageSize ( ) . width ) ; int imagePixelSizeY = ( Status . getImageShowSize ( ) . height ) // ( Status . getImageSize ( ) . height ) ; if ( imagePixelSizeX == 0 ) { imagePixelSizeX = 1 ; } if ( imagePixelSizeY == 0 ) { imagePixelSizeY = 1 ; } if ( ( ( ( ( rx // imagePixelSizeX ) >= 0 ) && ( ( ry // imagePixelSizeY ) >= 0 ) ) && ( ( ( ( ( int ) ( rx ) ) // imagePixelSizeX ) + 1 ) <= ( ( ( int ) ( ViewSettings . getView_bounds_page ( ) . width ) ) // imagePixelSizeX ) ) ) && ( ( ( ( ( int ) ( ry ) ) // imagePixelSizeY ) + 1 ) <= ( ( ( int ) ( ViewSettings . getView_bounds_page ( ) . height ) ) // imagePixelSizeY ) ) ) { int rbg = 0 ; if ( ( ( ( rx >= 0 ) && ( rx < ( _g . getWidth ( ) ) ) ) && ( ry >= 0 ) ) && ( ry < ( _g . getHeight ( ) ) ) ) { rbg = printPixel ( x , y , i , j , ( ( int ) ( rx ) ) , ( ( int ) ( ry ) ) , _g ) ; } Status . setCounter_paintedPoints ( ( ( Status . getCounter_paintedPoints ( ) ) + 1 ) ) ; if ( ( ( ( rx >= 0 ) && ( rx < ( _g . getWidth ( ) ) ) ) && ( ry >= 0 ) ) && ( ry < ( _g . getHeight ( ) ) ) ) { _g . setRGB ( rx , ry , rbg ) ; } for ( int kx = 0 ; kx < imagePixelSizeX ; kx ++ ) { for ( int ky = 0 ; ky < imagePixelSizeY ; ky ++ ) { if ( ( ( ( ( rx + kx ) >= 0 ) && ( ( rx + kx ) < ( _g . getWidth ( ) ) ) ) && ( ( ry + ky ) >= 0 ) ) && ( ( ry + ky ) < ( _g . getHeight ( ) ) ) ) { _g . setRGB ( ( rx + kx ) , ( ry + ky ) , rbg ) ; } } } } } } } } private int mergeColors ( final int _clrA , final int _clrB ) { } private int printPixel ( final int _x , final int _y , final int _i , final int _j , final int _rX , final int _rY , final BufferedImage _bi ) { }

Fix:
if ( ! _final ) {