Buggy code:
public class Controller implements ViewDimensionAware { private LayoutPosition layoutInfo ; private DocumentWrapper doc ; private LayoutStrategy layout ; private OrionViewerActivity activity ; private Renderer renderer ; private int lastPage = - 1 ; private DocumentViewAdapter listener ; private String screenOrientation ; private Point lastScreenSize ; private int contrast ; private int threshold ; private boolean hasPendingEvents = false ; public Controller ( OrionViewerActivity activity , DocumentWrapper doc , LayoutStrategy layout , Renderer renderer ) { } public void drawPage ( int page ) { } public void drawPage ( ) { } public void drawPage ( LayoutPosition info ) { } public void processPendingEvents ( ) { } public void onDimensionChanged ( int newWidth , int newHeight ) { <START_BUG> if ( ( newWidth >= 0 ) && ( newHeight >= 0 ) ) { <END_BUG> Common . d ( ( ( ( "New<seq2seq4repair_space>screen<seq2seq4repair_space>size<seq2seq4repair_space>" + newWidth ) + "x" ) + newHeight ) ) ; layout . setDimension ( newWidth , newHeight ) ; GlobalOptions options = getActivity ( ) . getGlobalOptions ( ) ; layout . changeOverlapping ( options . getHorizontalOverlapping ( ) , options . getVerticalOverlapping ( ) ) ; int offsetX = layoutInfo . x . offset ; int offsetY = layoutInfo . y . offset ; layout . reset ( layoutInfo , layoutInfo . pageNumber ) ; if ( ( lastScreenSize ) != null ) { if ( ( newWidth == ( lastScreenSize . x ) ) && ( newHeight == ( lastScreenSize . y ) ) ) { layoutInfo . x . offset = offsetX ; layoutInfo . y . offset = offsetY ; } lastScreenSize = null ; } sendViewChangeNotification ( ) ; renderer . onResume ( ) ; activity . myprocessOnActivityVisible ( ) ; } } public void drawNext ( ) { } public void drawPrev ( ) { } public void translateAndZoom ( boolean changeZoom , float zoomScaling , float deltaX , float deltaY ) { } public void changeZoom ( int zoom ) { } public int getZoom10000Factor ( ) { } public double getCurrentPageZoom ( ) { } public void changeMargins ( int [ ] margins ) { } public void changeMargins ( int leftMargin , int topMargin , int rightMargin , int bottomMargin , boolean isEven , int leftEvenMargin , int rightEvenMargin ) { } public void getMargins ( int [ ] cropMargins ) { } public boolean isEvenCropEnabled ( ) { } public void destroy ( ) { } public void onPause ( ) { } public void setRotation ( int rotation ) { } public void changeOverlap ( int horizontal , int vertical ) { } public int getRotation ( ) { } public int getCurrentPage ( ) { } public int getPageCount ( ) { } public void init ( LastPageInfo info , Point dimension ) { } public void serialize ( LastPageInfo info ) { } public void sendViewChangeNotification ( ) { } public void sendPageChangedNotification ( ) { } public String getDirection ( ) { } public int getLayout ( ) { } public void setDirectionAndLayout ( String walkOrder , int pageLayout ) { } public void changetWalkOrder ( String walkOrder ) { } public void changetPageLayout ( int pageLayout ) { } public void changeContrast ( int contrast ) { } public void changeThreshhold ( int threshold ) { } public OrionViewerActivity getActivity ( ) { } public boolean isEvenPage ( ) { } public void changeOrinatation ( String orientationId ) { } public void changeColorMode ( String colorMode , boolean invalidate ) { } public OutlineItem [ ] getOutline ( ) { } public String getScreenOrientation ( ) { } public String selectText ( int startX , int startY , int widht , int height ) { } public boolean needPassword ( ) { } public boolean authentificate ( String password ) { } public DocumentWrapper getDoc ( ) { } public LayoutStrategy getLayoutStrategy ( ) { } }

Fix:
if ( ( newWidth > 0 ) && ( newHeight > 0 ) ) {