input
stringlengths
96
415
output
stringlengths
18
303
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String message ) { if ( ( getActivity ( ) ) != null ) { METHOD_2 ( true ) ; TYPE_1 . METHOD_3 ( getActivity ( ) , message , VAR_1 ) . show ( ) ; } }
public void METHOD_1 ( java.lang.String message ) { if ( ( getActivity ( ) ) != null ) { METHOD_2 ( false ) ; TYPE_1 . METHOD_3 ( getActivity ( ) , message , VAR_1 ) . show ( ) ; } }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) || ( VAR_1 . METHOD_3 ( ) ) ) { return ; } VAR_1 . METHOD_4 ( ) . METHOD_5 ( null , VAR_2 ) ; }
private void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) || ( VAR_1 . METHOD_3 ( ) ) ) { return ; } VAR_1 . METHOD_4 ( ) . METHOD_5 ( null , VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public java.lang.String toString ( ) { return new java.lang.StringBuilder ( ) . append ( STRING_1 ) . append ( VAR_1 ) . append ( STRING_2 ) . append ( VAR_2 ) . append ( STRING_3 ) . toString ( ) ; }
public java.lang.String toString ( ) { return ( ( ( STRING_1 + ( VAR_1 ) ) + STRING_2 ) + ( VAR_2 ) ) + STRING_3 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . info ( ( STRING_1 + ( this . VAR_2 ) ) ) ; this . VAR_2 = false ; }
public void METHOD_1 ( ) { synchronized ( this ) { VAR_1 . info ( ( STRING_1 + ( this . VAR_2 ) ) ) ; this . VAR_2 = false ; } }
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 ) { return new TYPE_1 ( VAR_1 , VAR_3 , VAR_2 ) ; }
protected TYPE_1 METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_3 , java.lang.String VAR_2 ) { return new TYPE_1 ( VAR_1 , VAR_3 , VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 ) { if ( ! ( METHOD_2 ( VAR_1 ) ) ) { return true ; } return false ; }
public boolean METHOD_1 ( TYPE_1 VAR_1 ) { if ( METHOD_2 ( VAR_1 ) ) { return false ; } return true ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( this ) . METHOD_3 ( VAR_1 ) ; }
public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( this ) . METHOD_3 ( VAR_1 ) ; super . METHOD_1 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) throws java.lang.Exception { java.lang.String VAR_3 = VAR_1 + ( VAR_4 . METHOD_2 ( VAR_2 ) ) ; METHOD_3 ( VAR_3 ) ; }
public void METHOD_1 ( java.lang.String VAR_1 ) throws java.lang.Exception { java.lang.String VAR_3 = VAR_4 . METHOD_2 ( VAR_1 ) ; METHOD_3 ( VAR_3 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { ( VAR_1 ) ++ ; if ( ( VAR_1 ) == ( VAR_2 ) ) { METHOD_2 ( ) ; } }
private void METHOD_1 ( ) { ( VAR_1 ) ++ ; if ( ( VAR_1 ) == ( VAR_2 ) ) { METHOD_2 ( ) ; } }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final TYPE_1 VAR_1 , final int VAR_2 , byte [ ] VAR_3 ) { VAR_4 . METHOD_2 ( new TYPE_2 ( ) { public void METHOD_3 ( ) { METHOD_4 ( VAR_1 , VAR_2 ) ; } } ) ; }
public void METHOD_1 ( final TYPE_1 VAR_1 , final int VAR_2 , byte [ ] VAR_3 ) { METHOD_4 ( VAR_1 , VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 < TYPE_2 , java.lang.Integer > VAR_1 ) { this . VAR_1 = VAR_1 ; this . VAR_1 . METHOD_2 ( VAR_2 class ) ; }
public void METHOD_1 ( TYPE_1 < TYPE_2 , java.lang.Integer > VAR_1 ) { this . VAR_1 = VAR_1 ; }
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { java.lang.System.out.println ( STRING_1 ) ; return METHOD_2 ( VAR_1 ) . add ( METHOD_3 ( VAR_1 ) ) ; }
private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { return METHOD_2 ( VAR_1 ) . add ( METHOD_3 ( VAR_1 ) ) ; }
The following code may contain bugs. Write a refined code without bugs. private < TYPE_1 > TYPE_1 getValue ( TYPE_1 value , TYPE_1 VAR_1 ) { return value == null ? VAR_1 : value ; }
private < TYPE_1 > TYPE_1 getValue ( TYPE_1 value , TYPE_1 VAR_1 ) { return value != null ? value : VAR_1 ; }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( VAR_2 ) ; VAR_3 = TYPE_2 . METHOD_3 ( this ) ; METHOD_4 ( ) ; METHOD_5 ( ) ; }
protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( VAR_2 ) ; VAR_3 = TYPE_2 . METHOD_3 ( this ) ; METHOD_4 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.io.IOException , TYPE_1 { VAR_1 . METHOD_2 ( ) ; METHOD_3 ( 1 ) ; TYPE_2 . METHOD_4 ( VAR_2 , TYPE_2 . METHOD_5 ( 1 ) ) . METHOD_6 ( ) ; }
public void METHOD_1 ( ) throws java.io.IOException , TYPE_1 { VAR_1 . METHOD_2 ( ) ; TYPE_2 . METHOD_4 ( VAR_2 , TYPE_2 . METHOD_5 ( 1 ) ) . METHOD_6 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( java.lang.String title , TYPE_2 VAR_1 ) { TYPE_1 VAR_2 = new TYPE_1 ( title ) ; VAR_2 . METHOD_2 ( VAR_3 ) ; VAR_2 . METHOD_3 ( false ) ; VAR_2 . METHOD_4 ( VAR_1 . toString ( ) ) ; return VAR_2 ; }
protected TYPE_1 METHOD_1 ( java.lang.String title , TYPE_2 VAR_1 ) { TYPE_1 VAR_2 = new TYPE_1 ( title ) ; VAR_2 . METHOD_2 ( VAR_3 ) ; VAR_2 . METHOD_3 ( false ) ; VAR_2 . METHOD_4 ( VAR_1 . toString ( ) ) ; return VAR_2 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_3 ( VAR_4 ) ; }
public void METHOD_1 ( ) { VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_3 ( VAR_4 ) ; }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { if ( ( ( TYPE_1 . METHOD_2 ( ) ) - ( VAR_1 ) ) > INT_1 ) METHOD_3 ( ) ; }
private void METHOD_1 ( ) { METHOD_3 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void update ( java.lang.Object msg ) { VAR_1 . METHOD_1 ( msg . x , msg . y , VAR_2 ) ; if ( VAR_1 . METHOD_2 ( ) ) { VAR_3 . METHOD_3 ( new TYPE_1 ( VAR_3 , VAR_4 ) ) ; } }
public void update ( java.lang.Object msg ) { }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( ( INT_1 * INT_2 ) ) ; }
protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( INT_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { if ( VAR_1 . METHOD_2 ( ) . contains ( VAR_3 ) ) { TYPE_3 VAR_4 = new TYPE_3 ( STRING_1 ) ; VAR_1 . METHOD_3 ( VAR_4 ) ; } }
public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { }
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( int VAR_1 , int VAR_2 , int VAR_3 , int VAR_4 ) { TYPE_1 . METHOD_2 ( STRING_1 ) ; if ( VAR_5 ) { VAR_5 = false ; return true ; } else { return false ; } }
public boolean METHOD_1 ( int VAR_1 , int VAR_2 , int VAR_3 , int VAR_4 ) { TYPE_1 . METHOD_2 ( STRING_1 ) ; return false ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { text . setText ( VAR_1 . toString ( ) ) ; }
public void METHOD_1 ( ) { this . text . setText ( this . VAR_1 . toString ( ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 ) { return new TYPE_1 ( VAR_1 , VAR_2 , VAR_3 ) ; }
public static TYPE_1 METHOD_1 ( java.lang.String VAR_3 , java.lang.String VAR_2 ) { return new TYPE_1 ( VAR_3 , VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final java.lang.String VAR_1 ) throws java.lang.Throwable { TYPE_1 . assertEquals ( result , VAR_1 . equals ( STRING_1 ) ) ; }
public void METHOD_1 ( final java.lang.String VAR_1 ) throws java.lang.Throwable { TYPE_1 . assertEquals ( VAR_1 . equals ( STRING_1 ) , result ) ; }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( boolean VAR_1 ) { this . VAR_1 = VAR_1 ; return this ; }
public void METHOD_1 ( boolean VAR_1 ) { this . VAR_1 = VAR_1 ; }
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { return ( ( int ) ( ( VAR_3 ) - ( VAR_4 ) ) ) ; }
public int METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { final long diff = ( VAR_3 ) - ( VAR_4 ) ; return diff == 0 ? 0 : diff > 0 ? 1 : - 1 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 ) == null ) throw new TYPE_1 ( STRING_1 ) ; if ( VAR_1 . METHOD_2 ( ) ) throw new TYPE_2 ( ( ( STRING_2 + ( VAR_2 ) ) + STRING_3 ) ) ; }
protected void METHOD_1 ( ) { if ( ( VAR_1 ) == null ) throw new TYPE_1 ( STRING_1 ) ; if ( VAR_1 . METHOD_2 ( ) ) throw new TYPE_2 ( ( ( STRING_2 + ( VAR_2 ) ) + STRING_3 ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { VAR_1 = null ; TYPE_2 . METHOD_2 ( ) ; TYPE_3 . METHOD_3 ( ) ; }
public void METHOD_1 ( TYPE_1 event ) { VAR_1 = null ; TYPE_2 . METHOD_2 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 n ) { if ( n == null ) { return ; } java.lang.System.out.println ( n . getData ( ) ) ; METHOD_2 ( n . METHOD_3 ( ) ) ; METHOD_2 ( n . METHOD_4 ( ) ) ; }
public void METHOD_1 ( TYPE_1 n ) { if ( n == null ) { return ; } java.lang.System.out.println ( n . getData ( ) ) ; METHOD_1 ( n . METHOD_3 ( ) ) ; METHOD_1 ( n . METHOD_4 ( ) ) ; }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { java.lang.System.out.println ( STRING_1 ) ; }
private void METHOD_1 ( ) { java.lang.System.out.println ( STRING_1 ) ; java.lang.System.exit ( 0 ) ; }
The following code may contain bugs. Write a refined code without bugs. private static void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) ; VAR_2 = false ; }
private static void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; } VAR_1 = null ; }
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( int state ) { return TYPE_1 . METHOD_2 ( state ) ; }
public static boolean METHOD_1 ( int state ) { return TYPE_1 . METHOD_2 ( java.lang.Math.abs ( state ) ) ; }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; METHOD_2 ( ) ; TYPE_1 . i ( VAR_1 , ( STRING_1 + ( VAR_2 . METHOD_3 ( ) ) ) ) ; }
protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; METHOD_2 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. TYPE_1 METHOD_1 ( TYPE_1 b ) { return METHOD_2 ( new TYPE_1 ( ( - ( b . METHOD_3 ( ) ) ) , b . METHOD_4 ( ) ) ) ; }
TYPE_1 METHOD_1 ( TYPE_1 b ) { if ( b == null ) { return METHOD_2 ( null ) ; } return METHOD_2 ( new TYPE_1 ( ( - ( b . METHOD_3 ( ) ) ) , b . METHOD_4 ( ) ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { VAR_1 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; VAR_1 . METHOD_5 ( new java.io.File ( STRING_1 ) ) ; }
public static void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { VAR_1 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { this . METHOD_2 ( ) ; this . METHOD_3 ( null ) ; this . METHOD_4 ( ) ; this . METHOD_5 ( ) ; this . METHOD_6 ( ) ; }
private void METHOD_1 ( ) { this . METHOD_2 ( ) ; this . METHOD_3 ( null ) ; this . METHOD_4 ( ) ; this . METHOD_6 ( ) ; this . METHOD_5 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( new TYPE_1 ( ) ) ; }
public void METHOD_1 ( ) { METHOD_2 ( new TYPE_1 ( ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.Date VAR_1 ) { this . VAR_2 = VAR_1 ; }
public void METHOD_1 ( java.util.Date VAR_1 ) { if ( VAR_1 == null ) { this . VAR_2 = null ; } else { this . VAR_2 = new java.util.Date ( VAR_1 . getTime ( ) ) ; } }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( ( VAR_1 ) != null ) { METHOD_2 ( this ) ; } }
protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( ( VAR_1 ) != null ) { METHOD_2 ( this ) ; this . VAR_1 = null ; } }
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( int message ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ( STRING_1 + ( java.lang.String . METHOD_3 ( message ) ) ) . METHOD_4 ( VAR_2 ) ) ; } }
void METHOD_1 ( int message ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( java.lang.String . METHOD_3 ( message ) . METHOD_4 ( VAR_2 ) ) ; } }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { final TYPE_1 VAR_1 = TYPE_1 . METHOD_2 ( null , null , TYPE_2 . METHOD_2 ( ) . METHOD_3 ( ) ) ; VAR_1 . METHOD_4 ( true ) ; VAR_1 . show ( METHOD_5 ( ) , STRING_1 ) ; }
private void METHOD_1 ( ) { final TYPE_1 VAR_1 = TYPE_1 . METHOD_2 ( null , null ) ; VAR_1 . METHOD_4 ( true ) ; VAR_1 . show ( METHOD_5 ( ) , STRING_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { this . VAR_1 = TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ) ; }
public void METHOD_1 ( ) { this . VAR_1 = 1 ; }
The following code may contain bugs. Write a refined code without bugs. boolean METHOD_1 ( ) { if ( ( ( VAR_1 . METHOD_2 ( ) ) && ( VAR_1 . METHOD_3 ( ) ) ) && ( VAR_1 . METHOD_4 ( ) ) ) { return true ; } else { METHOD_5 ( VAR_2 ) ; return true ; } }
boolean METHOD_1 ( ) { if ( ( ( VAR_1 . METHOD_2 ( ) ) && ( VAR_1 . METHOD_3 ( ) ) ) && ( VAR_1 . METHOD_4 ( ) ) ) { return true ; } else { METHOD_5 ( VAR_2 ) ; return false ; } }
The following code may contain bugs. Write a refined code without bugs. private void init ( ) { METHOD_1 ( ) ; METHOD_2 ( ) ; METHOD_3 ( ) ; }
private void start ( ) { METHOD_2 ( ) ; METHOD_3 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( int VAR_1 , int VAR_2 , android.content.Intent data ) { switch ( VAR_1 ) { case VAR_3 : if ( VAR_2 == ( VAR_4 ) ) { METHOD_2 ( data , true ) ; } break ; default : break ; } }
protected void METHOD_1 ( int VAR_1 , int VAR_2 , android.content.Intent data ) { switch ( VAR_1 ) { case VAR_3 : if ( VAR_2 == ( VAR_4 ) ) { METHOD_2 ( data ) ; } break ; default : break ; } }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { if ( TYPE_1 . METHOD_2 ( METHOD_3 ( ) ) ) { VAR_2 . METHOD_4 ( ) ; } else { TYPE_2 . METHOD_5 ( METHOD_3 ( ) , STRING_1 , VAR_3 ) . show ( ) ; } }
public void METHOD_1 ( android.view.View VAR_1 ) { if ( TYPE_1 . METHOD_2 ( METHOD_3 ( ) ) ) { METHOD_4 ( ) ; } else { TYPE_2 . METHOD_5 ( METHOD_3 ( ) , STRING_1 , VAR_3 ) . show ( ) ; } }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 state , TYPE_3 format , TYPE_4 < TYPE_5 , TYPE_6 > VAR_1 ) { return new TYPE_7 ( format , VAR_1 ) ; }
public TYPE_1 METHOD_1 ( TYPE_2 state , TYPE_3 format , TYPE_4 < TYPE_5 , TYPE_6 > VAR_1 ) { return new TYPE_7 ( format ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( float VAR_1 ) { VAR_2 = VAR_1 ; VAR_3 = VAR_4 ; VAR_5 = VAR_6 ; VAR_7 = false ; VAR_8 . setText ( java.lang.String.format ( STRING_1 , VAR_2 ) ) ; }
public void METHOD_1 ( float VAR_1 ) { VAR_2 = VAR_1 ; VAR_3 = VAR_4 ; VAR_5 = VAR_6 ; VAR_8 . setText ( java.lang.String.format ( STRING_1 , VAR_2 ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { return METHOD_2 ( VAR_1 , TYPE_3 . getString ( STRING_1 ) , TYPE_3 . format ( STRING_2 , VAR_2 . get ( VAR_3 ) ) ) ; }
public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { return METHOD_2 ( VAR_1 , TYPE_3 . getString ( STRING_1 ) , TYPE_3 . format ( STRING_2 , ( ( java.lang.Integer ) ( VAR_2 . get ( VAR_3 ) ) ) ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; VAR_1 = VAR_2 ; VAR_3 = null ; VAR_4 = null ; VAR_5 = 0 ; VAR_6 = 0 ; return VAR_7 ; }
public java.lang.String METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; return VAR_7 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( ) ; assertEquals ( STRING_1 , 0 , VAR_2 . size ( ) ) ; VAR_2 = null ; VAR_1 . METHOD_2 ( ) ; }
public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( ) ; assertEquals ( STRING_1 , 0 , VAR_2 . size ( ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) ; TYPE_2 . update ( ) ; VAR_1 . METHOD_3 ( VAR_1 . METHOD_4 ( ) ) ; }
public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) ; TYPE_2 . update ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_1 VAR_1 ) { int VAR_2 = ( this . METHOD_2 ( VAR_1 ) ) - 1 ; if ( VAR_2 > 0 ) return this . get ( ( VAR_2 - 1 ) ) ; else return null ; }
public TYPE_1 METHOD_1 ( TYPE_1 VAR_1 ) { int VAR_2 = ( this . METHOD_2 ( VAR_1 ) ) - 1 ; if ( VAR_2 >= 0 ) return this . get ( VAR_2 ) ; else return null ; }
The following code may contain bugs. Write a refined code without bugs. public java.util.List < TYPE_1 > METHOD_1 ( java.lang.String VAR_1 ) { java.util.Map < java.lang.String , java.lang.Object > VAR_2 = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; VAR_2 . put ( STRING_1 , VAR_1 ) ; return VAR_3 . METHOD_2 ( VAR_2 ) ; }
public java.util.List < TYPE_1 > METHOD_1 ( java.lang.String VAR_1 ) { java.util.Map < java.lang.String , java.lang.Object > VAR_2 = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; VAR_2 . put ( STRING_1 , VAR_1 ) ; return VAR_3 . METHOD_1 ( VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; java.lang.System.out.println ( STRING_1 ) ; METHOD_2 ( ) ; }
public void METHOD_1 ( ) { super . METHOD_1 ( ) ; METHOD_2 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String start ) { VAR_1 = start ; }
public void METHOD_1 ( java.lang.String VAR_1 ) { this . VAR_1 = VAR_1 ; }
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( ) { return new TYPE_2 ( true ) ; }
protected TYPE_1 METHOD_1 ( ) { return new TYPE_2 ( 1 , true ) ; }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( int VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; }
public void METHOD_1 ( int size ) { VAR_2 . METHOD_2 ( size ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { this . METHOD_2 ( ) ; this . METHOD_3 ( ) ; }
public void METHOD_1 ( ) { if ( ( content ) == null ) return ; this . METHOD_2 ( ) ; this . METHOD_3 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. static int METHOD_1 ( double VAR_1 , double VAR_2 , double VAR_3 ) { java.lang.Double VAR_4 ; int VAR_5 = VAR_6 ; VAR_4 = ( ( VAR_2 - VAR_1 ) * VAR_5 ) / ( VAR_3 - VAR_1 ) ; return VAR_4 . intValue ( ) ; }
static int METHOD_1 ( double VAR_1 , double VAR_2 , double VAR_3 , int VAR_5 ) { java.lang.Double VAR_4 ; VAR_4 = ( ( VAR_2 - VAR_1 ) * VAR_5 ) / ( VAR_3 - VAR_1 ) ; return VAR_4 . intValue ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { if ( VAR_1 ) { VAR_2 = java.lang.String . METHOD_2 ( event . values [ 0 ] ) ; TYPE_2 . METHOD_3 ( VAR_2 ) ; } }
public void METHOD_1 ( TYPE_1 event ) { VAR_2 = java.lang.String . METHOD_2 ( event . values [ 0 ] ) ; TYPE_2 . METHOD_3 ( VAR_2 ) ; }
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( true ) ; }
public static void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( 0 , true ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { VAR_2 . remove ( VAR_1 ) ; this . METHOD_2 ( VAR_1 ) ; TYPE_1 VAR_3 = VAR_2 . get ( VAR_1 ) ; if ( ( VAR_4 ) != null ) VAR_4 . METHOD_3 ( VAR_3 , VAR_1 ) ; }
public void METHOD_1 ( int VAR_1 ) { TYPE_1 VAR_3 = VAR_2 . get ( VAR_1 ) ; VAR_2 . remove ( VAR_1 ) ; this . METHOD_2 ( VAR_1 ) ; if ( ( VAR_4 ) != null ) VAR_4 . METHOD_3 ( VAR_3 , VAR_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( java.lang.String args ) { return new TYPE_2 ( ) ; }
private TYPE_1 METHOD_1 ( java.lang.String args ) { return new TYPE_2 ( 1 ) ; }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 < ? > VAR_1 , TYPE_1 < java.lang.Integer > VAR_2 , TYPE_1 < TYPE_2 > VAR_3 , TYPE_1 < ? extends TYPE_2 > VAR_4 , TYPE_3 VAR_5 ) { }
private void handle ( TYPE_1 < ? > VAR_1 , TYPE_1 < java.lang.Integer > VAR_2 , TYPE_1 < TYPE_2 > VAR_3 , TYPE_1 < ? extends TYPE_2 > VAR_4 , TYPE_3 VAR_5 ) { }
The following code may contain bugs. Write a refined code without bugs. public long METHOD_1 ( int position ) { if ( position <= ( VAR_1 . size ( ) ) ) return VAR_1 . get ( position ) . METHOD_2 ( ) ; else return ( VAR_1 . size ( ) ) + 1 ; }
public long METHOD_1 ( int position ) { if ( position < ( VAR_1 . size ( ) ) ) return VAR_1 . get ( position ) . METHOD_2 ( ) ; else return ( VAR_1 . size ( ) ) + 1 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final TYPE_1 info ) throws TYPE_2 { throw new TYPE_3 ( ) ; }
public void METHOD_1 ( final TYPE_1 info ) throws TYPE_2 { }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 VAR_2 = new TYPE_2 ( TYPE_3 . METHOD_2 ( VAR_1 ) ) ; VAR_2 . METHOD_3 ( 0 , null ) ; VAR_2 . METHOD_4 ( VAR_3 ) ; return VAR_2 . METHOD_5 ( ) ; }
public TYPE_1 METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 VAR_2 = new TYPE_2 ( TYPE_3 . METHOD_2 ( VAR_1 ) ) ; VAR_2 . METHOD_4 ( VAR_3 ) ; return VAR_2 . METHOD_5 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) ; if ( VAR_1 ) { throw new TYPE_2 ( STRING_1 ) ; } TYPE_3 . METHOD_3 ( VAR_2 ) ; VAR_2 = 0 ; VAR_3 = 0 ; VAR_4 = 0 ; VAR_1 = true ; }
public void METHOD_1 ( ) { if ( VAR_1 ) { throw new TYPE_2 ( STRING_1 ) ; } TYPE_3 . METHOD_3 ( VAR_2 ) ; VAR_2 = 0 ; VAR_3 = 0 ; VAR_4 = 0 ; VAR_1 = true ; }
The following code may contain bugs. Write a refined code without bugs. public boolean equals ( java.lang.Object obj ) { return ( ( TYPE_1 ) ( obj ) ) . METHOD_1 ( ) . equals ( VAR_1 ) ; }
public boolean equals ( java.lang.Object obj ) { if ( ( obj == null ) || ( ! ( obj instanceof TYPE_1 ) ) ) { return false ; } return ( ( TYPE_1 ) ( obj ) ) . METHOD_1 ( ) . equals ( VAR_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; METHOD_2 ( STRING_1 ) . build ( ) ; }
public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 t ) { java.lang.System.out.println ( METHOD_2 ( t ) ) ; java.lang.System.out.println ( METHOD_3 ( METHOD_2 ( t ) ) ) ; java.lang.System.out.println ( VAR_1 ) ; }
public void METHOD_1 ( TYPE_1 t ) { METHOD_3 ( METHOD_2 ( t ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_2 = 0 ; }
public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_2 = - 1 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( VAR_2 . METHOD_2 ( VAR_1 ) ) { VAR_2 . METHOD_1 ( VAR_1 ) ; VAR_3 = VAR_2 . METHOD_3 ( ) ; METHOD_4 ( ) ; } }
public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( VAR_2 . METHOD_2 ( VAR_1 ) ) { VAR_2 . METHOD_1 ( VAR_1 ) ; VAR_3 . remove ( VAR_1 ) ; METHOD_4 ( ) ; } }
The following code may contain bugs. Write a refined code without bugs. public static final boolean METHOD_1 ( float [ ] VAR_1 , float [ ] VAR_2 ) { return ( TYPE_1 . METHOD_2 ( VAR_1 , VAR_2 ) ) == null ; }
public static final boolean METHOD_1 ( float [ ] VAR_1 , float [ ] VAR_2 ) { return ( TYPE_1 . METHOD_2 ( VAR_1 , VAR_2 ) . length ) == 0 ; }
The following code may contain bugs. Write a refined code without bugs. public java.lang.Void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( ) ; return null ; }
public java.lang.Void METHOD_1 ( ) throws java.lang.Exception { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; } return null ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 -= 1 ; }
public void METHOD_1 ( ) { ( VAR_1 ) -- ; }
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , TYPE_3 VAR_2 , java.util.Collection < TYPE_4 > VAR_3 ) throws TYPE_5 { return METHOD_1 ( VAR_1 , VAR_2 , null , VAR_3 ) ; }
protected TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , TYPE_3 VAR_2 , java.util.Collection < TYPE_4 > VAR_3 ) throws TYPE_5 { return METHOD_1 ( VAR_1 , VAR_2 , null , VAR_3 , null ) ; }
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( ) { if ( ( VAR_1 ) != null ) VAR_2 = VAR_1 . METHOD_1 ( ) ; else if ( ( VAR_3 ) != null ) VAR_2 = VAR_3 . METHOD_1 ( ) ; return VAR_2 ; }
public double METHOD_1 ( ) { return VAR_2 ; }
The following code may contain bugs. Write a refined code without bugs. public synchronized void start ( ) { VAR_1 = new java.lang.Thread ( this ) ; VAR_1 . start ( ) ; this . VAR_2 = true ; this . METHOD_1 ( ) ; }
public synchronized void start ( ) { if ( VAR_2 ) { return ; } this . VAR_2 = true ; VAR_1 = new java.lang.Thread ( this ) ; VAR_1 . start ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { METHOD_2 ( INT_1 , INT_1 ) ; VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_4 ( ) ; }
public void METHOD_1 ( TYPE_1 event ) { VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_4 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int index , double VAR_1 ) { final double VAR_2 = this . VAR_3 [ this . VAR_4 ] ; if ( VAR_1 < VAR_2 ) { } this . VAR_3 [ index ] = VAR_1 ; }
public void METHOD_1 ( int index , double VAR_1 ) { final double VAR_2 = this . VAR_3 [ this . VAR_4 ] ; this . VAR_3 [ index ] = VAR_1 ; if ( VAR_1 < VAR_2 ) { this . VAR_4 = index ; } }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { ( VAR_2 ) ++ ; if ( ( ( VAR_2 ) % 1 ) == 0 ) TYPE_2 . METHOD_2 ( ) ; TYPE_3 . METHOD_3 ( ) ; }
public void METHOD_1 ( TYPE_1 VAR_1 ) { ( VAR_2 ) ++ ; }
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { TYPE_3 . METHOD_2 ( ( ! ( TYPE_4 . METHOD_3 ( ) ) ) , STRING_1 ) ; return METHOD_1 ( VAR_1 . METHOD_4 ( ) , VAR_1 . getName ( ) ) ; }
public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { return METHOD_1 ( VAR_1 . METHOD_4 ( ) , VAR_1 . getName ( ) ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( STRING_1 , ( ( ( STRING_2 + ( VAR_1 . METHOD_3 ( ) ) ) + STRING_3 ) + ( VAR_1 . METHOD_4 ( ) ) ) ) ; METHOD_5 ( VAR_1 ) ; }
public void METHOD_1 ( final TYPE_1 VAR_1 ) { METHOD_5 ( VAR_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( TYPE_2 . getValue ( ) , 0 ) ; new TYPE_3 ( ) . METHOD_2 ( STRING_1 ) ; }
public void METHOD_1 ( ) throws java.lang.Exception { new TYPE_3 ( ) . METHOD_2 ( STRING_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( VAR_1 ) { METHOD_2 ( VAR_2 ) ; VAR_1 = false ; } }
protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( VAR_1 ) { METHOD_2 ( VAR_2 ) ; } }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 ) { if ( ( VAR_1 . METHOD_2 ( STRING_1 ) ) || ( VAR_1 . METHOD_2 ( STRING_2 ) ) ) { VAR_1 . delete ( ) ; } ( VAR_2 ) ++ ; }
private void METHOD_1 ( TYPE_1 VAR_1 ) { if ( ( VAR_1 . METHOD_2 ( STRING_1 ) ) || ( VAR_1 . METHOD_2 ( STRING_2 ) ) ) { VAR_1 . delete ( ) ; return ; } ( VAR_2 ) ++ ; }
The following code may contain bugs. Write a refined code without bugs. private static TYPE_1 METHOD_1 ( java.lang.String fileName ) { }
private static TYPE_1 METHOD_1 ( java.lang.String fileName ) { return null ; }
The following code may contain bugs. Write a refined code without bugs. public static synchronized TYPE_1 METHOD_1 ( android.content.Context context ) { if ( ( VAR_1 ) == null ) { TYPE_2 . METHOD_2 ( VAR_2 , STRING_1 ) ; VAR_1 = new TYPE_1 ( context ) ; } return VAR_1 ; }
public static synchronized TYPE_1 METHOD_1 ( android.content.Context context ) { if ( ( VAR_1 ) == null ) { VAR_1 = new TYPE_1 ( context ) ; } return VAR_1 ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Throwable { TYPE_1 . METHOD_2 ( this . VAR_1 , this . VAR_2 , this . VAR_3 ) ; super . METHOD_1 ( ) ; }
protected void METHOD_1 ( ) throws java.lang.Throwable { TYPE_1 . METHOD_2 ( this . VAR_1 , this . VAR_2 , this . VAR_3 ) ; super . METHOD_1 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( ) ; } catch ( java.lang.Exception VAR_2 ) { VAR_3 . add ( null ) ; } }
public void METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( ) ; } catch ( java.lang.Exception VAR_2 ) { } }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , java.util.Scanner VAR_2 ) { java.lang.System.out.println ( STRING_1 ) ; VAR_1 . name = VAR_2 . METHOD_2 ( ) ; java.lang.System.out.println ( VAR_1 . name ) ; }
public void METHOD_1 ( TYPE_1 VAR_1 , java.util.Scanner VAR_2 ) { java.lang.System.out.println ( STRING_1 ) ; VAR_2 . METHOD_2 ( ) ; VAR_1 . name = VAR_2 . METHOD_2 ( ) ; java.lang.System.out.println ( VAR_1 . name ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.io.IOException { TYPE_1 VAR_1 = new TYPE_1 ( ) ; VAR_1 . METHOD_2 ( ) ; }
public void METHOD_1 ( ) throws java.io.IOException { TYPE_1 VAR_1 = new TYPE_1 ( ) ; VAR_1 . METHOD_2 ( true ) ; }
The following code may contain bugs. Write a refined code without bugs. public java.util.List < java.util.Map < java.lang.String , java.lang.Object > > METHOD_1 ( java.lang.String VAR_1 , int start , int end ) throws TYPE_1 { return VAR_2 . METHOD_1 ( VAR_1 , start , end ) ; }
public java.util.List < java.util.Map < java.lang.String , java.lang.Object > > METHOD_1 ( java.lang.String VAR_1 , int start , int number ) throws TYPE_1 { return VAR_2 . METHOD_1 ( VAR_1 , start , number ) ; }
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) { TYPE_1 . METHOD_1 ( ) ; }
public static void METHOD_1 ( ) { }
The following code may contain bugs. Write a refined code without bugs. public static void error ( final java.lang.String pattern , final java.lang.Object ... VAR_1 ) { final TYPE_1 VAR_2 = java.lang.Thread . METHOD_1 ( ) . METHOD_2 ( ) [ 1 ] ; TYPE_2 . METHOD_3 ( VAR_3 , null , pattern , VAR_2 , VAR_1 ) ; }
public static void error ( final java.lang.String pattern , final java.lang.Object ... VAR_1 ) { TYPE_2 . METHOD_3 ( VAR_3 , null , pattern , VAR_1 ) ; }
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( int VAR_1 , int min , int VAR_2 ) throws TYPE_1 { if ( ( VAR_1 < min ) || ( VAR_1 > VAR_2 ) ) throw new TYPE_1 ( ) ; }
private static void METHOD_1 ( int VAR_1 , int min , int VAR_2 ) throws TYPE_1 { if ( ( VAR_1 < min ) || ( VAR_1 > VAR_2 ) ) throw new TYPE_1 ( ) ; }
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , int position ) { TYPE_2 . METHOD_2 ( VAR_2 , STRING_1 ) ; this . VAR_1 = VAR_1 ; VAR_3 = position ; }
public void METHOD_1 ( TYPE_1 VAR_1 , int position ) { this . VAR_1 = VAR_1 ; VAR_3 = position ; }