input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( getActivity ( ) , VAR_1 . METHOD_3 ( ) ) ; TYPE_2 . METHOD_4 ( getActivity ( ) , STRING_1 , VAR_2 ) . show ( ) ; getActivity ( ) . METHOD_5 ( ) ; } | public void METHOD_1 ( ) { TYPE_2 . METHOD_4 ( getActivity ( ) , STRING_1 , VAR_2 ) . show ( ) ; TYPE_1 . METHOD_2 ( getActivity ( ) ) ; getActivity ( ) . METHOD_5 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) throws java.io.IOException { return VAR_1 . equals ( VAR_1 ) ? new TYPE_2 ( VAR_2 ) : VAR_3 . METHOD_1 ( VAR_1 ) ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) throws java.io.IOException { return this . VAR_1 . equals ( VAR_1 ) ? new TYPE_2 ( VAR_2 ) : VAR_3 . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_2 ( 1 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_2 ( 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { java.util.Iterator < TYPE_1 > VAR_1 = METHOD_2 ( ) . iterator ( ) ; while ( VAR_1 . METHOD_3 ( ) ) { TYPE_1 VAR_2 = VAR_1 . METHOD_4 ( ) ; VAR_2 . METHOD_5 ( STRING_1 ) ; } } | public void METHOD_1 ( ) { final java.util.Iterator < TYPE_1 > VAR_1 = METHOD_2 ( ) . iterator ( ) ; while ( VAR_1 . METHOD_3 ( ) ) { final TYPE_1 VAR_2 = VAR_1 . METHOD_4 ( ) ; VAR_2 . METHOD_5 ( STRING_1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String message , TYPE_1 VAR_1 ) throws java.io.IOException , TYPE_2 { java.lang.System.out.println ( ( STRING_1 + message ) ) ; METHOD_2 ( VAR_1 , message ) ; java.lang.System.out.println ( ( STRING_2 + ( VAR_2 . size ( ) ) ) ) ; } | public void METHOD_1 ( java.lang.String message , TYPE_1 VAR_1 ) throws java.io.IOException , TYPE_2 { java.lang.System.out.println ( ( STRING_1 + message ) ) ; METHOD_2 ( VAR_1 , message ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static final java.lang.String METHOD_1 ( java.io.InputStream VAR_1 ) { return TYPE_1 . METHOD_2 ( new TYPE_2 ( VAR_1 ) ) ; } | public static final java.lang.String METHOD_1 ( java.io.InputStream VAR_1 ) { if ( VAR_1 == null ) { return null ; } return TYPE_1 . METHOD_2 ( new TYPE_2 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static java.util.List < TYPE_1 > METHOD_1 ( ) { TYPE_1 [ ] array = new TYPE_1 [ ] { VAR_1 , VAR_2 , VAR_3 , VAR_4 , VAR_5 , VAR_6 } ; return java.util.Arrays.asList ( array ) ; } | public static java.util.List < TYPE_1 > METHOD_1 ( ) { return TYPE_1 . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String list ( ) { return java.lang.String.format ( STRING_1 , name , VAR_1 , ( ( java.lang.Math.round ( ( ( VAR_2 ) / FLOAT_1 ) ) ) * FLOAT_1 ) ) ; } | public java.lang.String toString ( ) { return java.lang.String.format ( STRING_1 , name , VAR_1 , ( ( java.lang.Math.round ( ( ( VAR_2 ) / FLOAT_1 ) ) ) * FLOAT_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 . get ( ) ) != null ) { VAR_1 . get ( ) . METHOD_2 ( ) ; } VAR_2 . setState ( VAR_3 ) ; } | public void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; } VAR_2 . setState ( VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . add ( VAR_1 ) ; VAR_3 += 1 ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_2 . add ( VAR_1 ) ; this . VAR_3 += 1 ; }
|
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( ) { return new TYPE_1 ( this , new TYPE_2 [ ] { VAR_1 , VAR_2 } ) ; } | protected TYPE_1 METHOD_1 ( ) { return new TYPE_1 ( this , VAR_1 , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.content.Intent intent ) { super . METHOD_1 ( intent ) ; TYPE_1 . METHOD_1 ( intent ) ; } | public void METHOD_1 ( android.content.Intent intent ) { TYPE_1 . METHOD_1 ( intent ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.List < TYPE_1 > METHOD_1 ( ) { if ( this . VAR_1 . isEmpty ( ) ) { this . VAR_1 = VAR_2 . METHOD_2 ( ) ; } return VAR_1 ; } | public java.util.List < TYPE_1 > METHOD_1 ( ) { this . VAR_1 = VAR_2 . METHOD_2 ( ) ; return VAR_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 ) { TYPE_1 . METHOD_1 ( STRING_1 , STRING_2 , VAR_1 , VAR_2 ) ; } | public static void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { TYPE_1 . METHOD_1 ( STRING_1 , STRING_2 , VAR_1 , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. int METHOD_1 ( TYPE_1 obj , double [ ] data , long VAR_1 , double VAR_2 , int VAR_3 ) ; | int METHOD_1 ( TYPE_1 obj , double [ ] data , int VAR_1 , double VAR_2 , int VAR_3 ) ;
|
The following code may contain bugs. Write a refined code without bugs. public java.util.List < TYPE_1 > METHOD_1 ( int VAR_1 ) { return VAR_2 . METHOD_1 ( VAR_1 ) ; } | public java.util.List < TYPE_1 > METHOD_1 ( int VAR_1 ) { java.util.List < TYPE_1 > list = VAR_2 . METHOD_1 ( VAR_1 ) ; return list ; }
|
The following code may contain bugs. Write a refined code without bugs. public double [ ] [ ] METHOD_1 ( java.util.Scanner info , int VAR_1 , int VAR_2 ) { double [ ] [ ] output = new double [ INT_1 ] [ 0 ] ; return output ; } | public double [ ] [ ] METHOD_1 ( java.util.Scanner info , int VAR_1 , int VAR_2 ) { double [ ] [ ] output = new double [ 0 ] [ INT_1 ] ; return output ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ! ( METHOD_2 ( ) . METHOD_3 ( ) ) ) METHOD_4 ( ) ; else METHOD_5 ( ) ; } | public void METHOD_1 ( ) { if ( ! ( METHOD_2 ( ) . METHOD_3 ( ) ) ) METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) throws TYPE_1 , TYPE_2 { METHOD_1 ( false ) ; } | protected void METHOD_1 ( ) throws TYPE_1 , TYPE_2 { METHOD_1 ( false , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return METHOD_1 ( VAR_1 , true ) ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return METHOD_1 ( VAR_1 , true , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_1 ) ; } | public int METHOD_1 ( ) { if ( ( ( VAR_1 ) == null ) || ( ( VAR_1 . METHOD_2 ( ) ) == null ) ) return 0 ; return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { return new TYPE_1 ( 0 , 0 , VAR_1 . METHOD_2 ( ) , VAR_1 . METHOD_3 ( ) ) ; } | public TYPE_1 METHOD_1 ( ) { return new TYPE_1 ( 0 , 0 , ( ( VAR_1 . METHOD_2 ( ) ) - 1 ) , ( ( VAR_1 . METHOD_3 ( ) ) - 1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { try { VAR_1 = new TYPE_1 ( new java.io.BufferedWriter ( new java.io.FileWriter ( this . fileName , true ) ) ) ; } catch ( java.lang.Exception VAR_2 ) { java.lang.System.out.println ( STRING_1 ) ; } } | public void METHOD_1 ( ) { try { VAR_1 = new TYPE_1 ( new java.io.BufferedWriter ( new java.io.FileWriter ( this . fileName , false ) ) ) ; } catch ( java.lang.Exception VAR_2 ) { java.lang.System.out.println ( STRING_1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. long METHOD_1 ( TYPE_1 obj , int [ ] VAR_1 , double [ ] VAR_2 , long VAR_3 , long VAR_4 , double VAR_5 , int [ ] VAR_6 ) ; | long METHOD_1 ( TYPE_1 obj , int [ ] VAR_1 , double [ ] VAR_2 , int VAR_3 , int VAR_4 , double VAR_5 , int [ ] VAR_6 ) ;
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 , int VAR_2 ) { METHOD_2 ( new TYPE_1 ( VAR_3 , VAR_1 , VAR_2 ) ) ; } | public void METHOD_1 ( java.lang.String VAR_1 ) { METHOD_2 ( new TYPE_1 ( VAR_3 , VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { METHOD_2 ( ) ; VAR_1 . METHOD_1 ( ) ; } } | protected void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_1 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_2 ) ; } | public int METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_2 ) ; } else { return 0 ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( boolean VAR_1 ) { if ( ( VAR_2 ) == VAR_1 ) { return ; } VAR_2 = VAR_1 ; if ( ! VAR_1 ) { VAR_3 . METHOD_2 ( false ) ; } } | public void METHOD_1 ( boolean VAR_1 ) { if ( ( VAR_2 ) == VAR_1 ) { return ; } VAR_2 = VAR_1 ; if ( ( ! VAR_1 ) && ( ( VAR_3 ) != null ) ) { VAR_3 . METHOD_2 ( false ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.io.IOException , TYPE_1 , TYPE_2 , TYPE_3 { java.lang.String VAR_1 = TYPE_4 . METHOD_2 ( STRING_1 ) ; TYPE_5 VAR_2 = METHOD_3 ( VAR_1 ) ; METHOD_4 ( INT_1 ) ; TYPE_6 . METHOD_5 ( VAR_2 , VAR_3 ) ; } | public void METHOD_1 ( ) throws java.io.IOException , TYPE_1 , TYPE_2 , TYPE_3 { java.lang.String VAR_1 = TYPE_4 . METHOD_2 ( STRING_1 ) ; TYPE_5 VAR_2 = METHOD_3 ( VAR_1 ) ; TYPE_6 . METHOD_5 ( VAR_2 , VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( int x ) { return ( ( int ) ( ( ( double ) ( x ) ) / ( TYPE_1 . METHOD_2 ( ) ) ) ) ; } | public int METHOD_1 ( int x ) { return ( ( int ) ( ( ( double ) ( x ) ) / ( METHOD_2 ( ) ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static double METHOD_1 ( double n ) { if ( n < 0 ) { throw new TYPE_1 ( STRING_1 ) ; } return TYPE_2 . METHOD_2 ( n , 1 ) ; } | public static double METHOD_1 ( double n ) { if ( n < 0 ) { throw new TYPE_1 ( STRING_1 ) ; } if ( n == 0.0 ) { return 0.0 ; } return TYPE_2 . METHOD_2 ( n , 1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { try { METHOD_2 ( ) . METHOD_3 ( new TYPE_2 < TYPE_1 > ( VAR_1 ) ) ; } catch ( TYPE_3 | TYPE_4 | TYPE_5 | TYPE_6 VAR_2 ) { VAR_2 . METHOD_4 ( ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 ) throws TYPE_6 , TYPE_3 , TYPE_5 , TYPE_4 { METHOD_2 ( ) . METHOD_3 ( new TYPE_2 < TYPE_1 > ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( long f ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; return VAR_2 . format ( f ) . replace ( STRING_1 , STRING_2 ) ; } | public java.lang.String METHOD_1 ( long f ) { return VAR_2 . format ( f ) . replace ( STRING_1 , STRING_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) { if ( ( this . VAR_1 ) != ( - 1 ) ) { VAR_2 . METHOD_2 ( VAR_1 ) ; } else { VAR_2 . METHOD_2 ( ) ; } return VAR_2 . METHOD_3 ( ) ; } | private TYPE_1 METHOD_1 ( ) { if ( ( this . VAR_1 ) != ( - 1 ) ) { VAR_2 . METHOD_2 ( VAR_1 , true ) ; } else { VAR_2 . METHOD_2 ( ) ; } return VAR_2 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { TYPE_1 VAR_2 = VAR_3 . get ( VAR_1 ) ; VAR_2 . METHOD_2 ( ) ; } | public void METHOD_1 ( int VAR_1 ) { TYPE_1 VAR_2 = VAR_3 . get ( ( VAR_1 - 1 ) ) ; VAR_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_1 = VAR_1 ; VAR_2 = VAR_1 . type ; VAR_3 = VAR_1 . position ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( VAR_1 == null ) return ; this . VAR_1 = VAR_1 ; VAR_2 = VAR_1 . type ; VAR_3 = VAR_1 . position ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( java.lang.String message , java.lang.Throwable t ) { for ( int i = 0 ; i < ( TYPE_1 . size ( ) ) ; i ++ ) { TYPE_1 . get ( 0 ) . METHOD_1 ( message , null ) ; } } | public static void METHOD_1 ( java.lang.String message , java.lang.Throwable t ) { for ( int i = 0 ; i < ( TYPE_1 . size ( ) ) ; i ++ ) { TYPE_1 . get ( i ) . METHOD_1 ( message , null ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_2 ( ) ; java.lang.System.out.println ( ( STRING_1 + VAR_1 ) ) ; METHOD_2 ( VAR_1 ) ; } | public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_2 ( ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( float VAR_1 ) { return TYPE_2 . METHOD_2 ( VAR_2 , this , VAR_1 ) ; } | public TYPE_1 METHOD_2 ( float VAR_1 ) { return TYPE_2 . METHOD_2 ( VAR_2 , this , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; try { METHOD_2 ( VAR_1 , VAR_2 ) ; return null ; } catch ( TYPE_2 VAR_3 ) { return VAR_3 . METHOD_3 ( ) ; } } | public java.lang.String METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; try { METHOD_2 ( VAR_1 , VAR_2 ) ; return null ; } catch ( java.lang.Exception VAR_3 ) { return VAR_3 . METHOD_3 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object METHOD_1 ( java.lang.Object VAR_1 ) throws TYPE_1 { if ( VAR_1 == null ) { return null ; } return new TYPE_2 ( this . VAR_2 , this . type ) ; } | public java.lang.Object METHOD_1 ( java.lang.Object VAR_1 ) throws TYPE_1 { if ( VAR_1 == null ) { return null ; } return new TYPE_2 ( ( ( TYPE_2 ) ( VAR_1 ) ) . VAR_2 , ( ( TYPE_2 ) ( VAR_1 ) ) . type ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.Void VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; if ( VAR_2 ) { VAR_3 . set ( ( ( VAR_3 . size ( ) ) - INT_1 ) , VAR_4 ) ; } } | protected void METHOD_1 ( java.lang.Void VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; if ( VAR_2 ) { VAR_3 . set ( ( ( VAR_3 . size ( ) ) - 1 ) , VAR_4 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String error ( java.lang.Integer status ) { return new TYPE_1 < > ( status ) . METHOD_1 ( ) ; } | public static java.lang.String error ( java.lang.Integer status ) { return new TYPE_1 < > ( status , true ) . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( ) ; VAR_1 = null ; METHOD_4 ( ) ; TYPE_1 . METHOD_5 ( VAR_2 , STRING_1 ) ; } } | private void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( ) ; VAR_1 = null ; TYPE_1 . METHOD_5 ( VAR_2 , STRING_1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.String VAR_2 = VAR_1 . METHOD_2 ( STRING_1 ) ; if ( VAR_2 != null ) { VAR_3 = VAR_2 ; VAR_4 = true ; } } | public static void METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.String VAR_2 = VAR_1 . METHOD_2 ( STRING_1 ) ; if ( ( ( VAR_4 ) == false ) && ( VAR_2 != null ) ) { VAR_3 = VAR_2 ; VAR_4 = true ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { VAR_1 = event . METHOD_2 ( ) ; VAR_2 = event . METHOD_3 ( ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 event ) { VAR_1 = event . METHOD_2 ( ) ; VAR_2 = event . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) ; TYPE_2 . METHOD_2 ( ) ; TYPE_3 . METHOD_2 ( ) ; TYPE_4 . METHOD_2 ( ) ; TYPE_5 . METHOD_2 ( ) ; TYPE_6 . METHOD_2 ( ) ; TYPE_7 . METHOD_2 ( ) ; } | public static void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) ; TYPE_2 . METHOD_2 ( ) ; TYPE_3 . METHOD_2 ( ) ; TYPE_4 . METHOD_2 ( ) ; TYPE_5 . METHOD_2 ( ) ; TYPE_6 . METHOD_2 ( ) ; }
|
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 ) ; android.content.Intent intent = getIntent ( ) ; long VAR_3 = java.util.Calendar.getInstance ( ) . METHOD_3 ( ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( VAR_2 ) ; VAR_3 = java.util.Calendar.getInstance ( ) . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.ArrayList < TYPE_1 > data ) { METHOD_2 ( false ) ; VAR_1 . update ( data ) ; } | public void METHOD_1 ( java.util.ArrayList < TYPE_1 > data ) { METHOD_2 ( false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( double VAR_1 ) { this . VAR_2 . METHOD_2 ( VAR_1 , ( - VAR_1 ) ) ; } | public void METHOD_1 ( double VAR_1 ) { this . VAR_2 . METHOD_2 ( VAR_1 , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( this , METHOD_2 ( ) ) ; METHOD_3 ( VAR_1 ) ; } | public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( this , METHOD_2 ( ) ) ; METHOD_3 ( VAR_1 ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String METHOD_1 ( final java.lang.String string ) { return string . replaceAll ( STRING_1 , "\n" ) ; } | public static java.lang.String METHOD_1 ( final java.lang.String string ) { return string . replace ( STRING_1 , "\n" ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( TYPE_1 item ) { METHOD_2 ( ) ; return ( ( VAR_1 ) > ( item . METHOD_3 ( ) . VAR_2 ) ) && ( ( VAR_3 ) > ( item . METHOD_4 ( ) . VAR_4 ) ) ; } | private boolean METHOD_1 ( TYPE_1 item ) { METHOD_2 ( ) ; return ( ( VAR_1 ) >= ( item . METHOD_3 ( ) . VAR_2 ) ) && ( ( VAR_3 ) >= ( item . METHOD_4 ( ) . VAR_4 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) == 0 ) { super . METHOD_1 ( ) ; } else { VAR_1 . METHOD_3 ( ( ( VAR_1 . METHOD_2 ( ) ) - 1 ) ) ; } } | public void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) == 1 ) { } else { VAR_1 . METHOD_3 ( 1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . add ( INT_1 ) ; VAR_1 . add ( INT_2 ) ; while ( ! ( VAR_1 . contains ( 1 ) ) ) ; VAR_1 . remove ( 1 ) ; } | public void METHOD_1 ( ) { VAR_1 . add ( INT_1 ) ; VAR_1 . add ( INT_2 ) ; while ( ! ( VAR_1 . remove ( 1 ) ) ) ; }
|
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 ( ( METHOD_2 ( ) ) && ( TYPE_3 . equals ( VAR_2 . get ( VAR_3 , VAR_1 ) ) ) ) { METHOD_3 ( VAR_1 , null ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { if ( ( METHOD_2 ( ) ) && ( TYPE_3 . equals ( VAR_2 . get ( VAR_3 , VAR_1 ) ) ) ) { METHOD_3 ( VAR_1 , null , false ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void end ( ) { VAR_1 . METHOD_1 ( ) ; VAR_1 = null ; } | public void end ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = ( ( TYPE_1 ) ( METHOD_2 ( VAR_2 ) ) ) ; VAR_1 . setText ( ( ( ( getString ( VAR_3 ) ) + STRING_1 ) + ( VAR_4 ) ) ) ; } | public void METHOD_1 ( ) { TYPE_1 VAR_1 = ( ( TYPE_1 ) ( METHOD_2 ( VAR_2 ) ) ) ; VAR_1 . setText ( ( ( ( getString ( VAR_3 ) ) + STRING_1 ) + ( VAR_4 ) ) ) ; ( VAR_4 ) ++ ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 item ) { switch ( item . METHOD_2 ( ) ) { case VAR_1 : METHOD_3 ( ) ; default : return super . METHOD_1 ( item ) ; } } | public boolean METHOD_1 ( TYPE_1 item ) { switch ( item . METHOD_2 ( ) ) { case VAR_1 : METHOD_3 ( ) ; return true ; default : return super . METHOD_1 ( item ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) throws java.lang.Exception { METHOD_2 ( VAR_1 ) ; super . METHOD_1 ( VAR_1 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) throws java.lang.Exception { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( long n ) throws java.io.IOException { VAR_1 . METHOD_2 ( n ) ; } | public void METHOD_1 ( long n ) throws java.io.IOException { VAR_1 . METHOD_1 ( n ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; VAR_3 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 . METHOD_2 ( STRING_1 ) ; VAR_2 . METHOD_3 ( VAR_3 ) ; METHOD_4 ( android.content.Intent . METHOD_5 ( VAR_2 , STRING_2 ) , 0 ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { METHOD_4 ( android.content.Intent . METHOD_5 ( VAR_2 , STRING_2 ) , 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( double VAR_1 , double VAR_2 , java.lang.StringBuilder VAR_3 ) { return VAR_4 . METHOD_2 ( VAR_1 , VAR_2 , VAR_3 ) ; } | public boolean METHOD_1 ( double VAR_1 , double VAR_2 , java.lang.StringBuilder VAR_3 ) { return VAR_4 . METHOD_1 ( VAR_1 , VAR_2 , VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( STRING_1 , ( STRING_2 + VAR_1 ) ) ; VAR_2 . METHOD_3 ( this , VAR_1 . METHOD_4 ( ) ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public static void main ( java.lang.String [ ] args ) { TYPE_1 VAR_1 = TYPE_2 . METHOD_1 ( STRING_1 ) ; TYPE_3 . METHOD_2 ( VAR_1 . METHOD_3 ( ) . get ( 0 ) ) ; } | public static void main ( java.lang.String [ ] args ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( VAR_2 , ( STRING_1 + ( VAR_3 ) ) ) ; VAR_1 . METHOD_3 ( VAR_4 , VAR_3 ) ; VAR_1 . METHOD_4 ( VAR_5 , VAR_6 ) ; super . METHOD_1 ( VAR_1 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_1 . METHOD_3 ( VAR_4 , VAR_3 ) ; VAR_1 . METHOD_4 ( VAR_5 , VAR_6 ) ; super . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String toString ( ) { return value . toString ( ) ; } | public java.lang.String toString ( ) { return value ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { this . VAR_1 . setText ( STRING_1 ) ; this . VAR_2 . METHOD_2 ( ) ; } | private void METHOD_1 ( ) { this . VAR_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean add ( TYPE_1 t ) { METHOD_1 ( 1 ) ; return buffer . add ( t ) ; } | public boolean add ( TYPE_1 t ) { return ( METHOD_1 ( 1 ) ) && ( buffer . add ( t ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 . METHOD_2 ( false ) ; VAR_3 . METHOD_2 ( true ) ; VAR_4 = false ; } | public void METHOD_1 ( android.view.View VAR_1 ) { VAR_4 = false ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.lang.String METHOD_1 ( TYPE_1 VAR_1 ) { return ( ( ( ( VAR_2 ) + STRING_1 ) + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_1 ) + ( VAR_1 . METHOD_3 ( ) ) ; } | private java.lang.String METHOD_1 ( ) { return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 ) { if ( ( VAR_3 ) > 0 ) { METHOD_2 ( VAR_3 ) ; } VAR_1 . METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 ) { if ( ( VAR_3 ) >= 0 ) { METHOD_2 ( VAR_3 ) ; } VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { if ( VAR_1 ) { VAR_2 . METHOD_2 ( true ) ; } else { VAR_2 . METHOD_2 ( false ) ; METHOD_3 ( false ) ; } } | private void METHOD_1 ( ) { if ( VAR_1 ) { VAR_2 . METHOD_2 ( true ) ; } else { VAR_2 . METHOD_2 ( false ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 ) == ( VAR_2 . size ( ) ) ) { VAR_1 = 0 ; } else { ( VAR_1 ) ++ ; } VAR_3 = VAR_2 . get ( VAR_1 ) ; } | public void METHOD_1 ( ) { if ( ( VAR_1 ) == ( ( VAR_2 . size ( ) ) - 1 ) ) { VAR_1 = 0 ; } else { ( VAR_1 ) ++ ; } VAR_3 = VAR_2 . get ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { METHOD_2 ( p ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 ) { if ( ( VAR_2 ) == INT_1 ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; VAR_2 = 0 ; } else { ( VAR_2 ) ++ ; } return true ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 ) { ( VAR_2 ) ++ ; if ( ( VAR_2 ) == INT_1 ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; VAR_2 = 0 ; } return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { VAR_2 . show ( METHOD_2 ( ) , STRING_1 ) ; } | public void METHOD_1 ( java.lang.String VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. TYPE_1 < TYPE_2 > METHOD_1 ( TYPE_3 VAR_1 ) { return new TYPE_1 ( VAR_2 , VAR_3 , VAR_1 , VAR_4 ) ; } | TYPE_1 < TYPE_2 > METHOD_1 ( TYPE_3 VAR_1 ) { return new TYPE_1 < TYPE_2 > ( VAR_2 , VAR_3 , VAR_1 , VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void init ( java.util.Properties VAR_1 , TYPE_1 VAR_2 ) { java.lang.System.out.println ( ( STRING_1 + ( VAR_3 ) ) ) ; VAR_4 = false ; } | public void init ( java.util.Properties VAR_1 , TYPE_1 VAR_2 ) { VAR_4 = false ; }
|
The following code may contain bugs. Write a refined code without bugs. public void error ( final java.lang.Throwable VAR_1 , final java.lang.String format , final java.lang.Object ... args ) { super . error ( VAR_1 , ( STRING_1 + format ) , this . listener , TYPE_1 . METHOD_1 ( this . listener , args ) ) ; } | public void error ( final java.lang.String format , final java.lang.Object ... args ) { super . error ( ( STRING_1 + format ) , TYPE_1 . METHOD_1 ( this . listener , args ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , TYPE_3 VAR_3 ) throws TYPE_4 { VAR_4 . METHOD_2 ( VAR_5 , INT_1 , FLOAT_1 , new TYPE_5 ( 1 , 1 , 1 , FLOAT_2 ) ) ; VAR_6 . METHOD_2 ( VAR_5 , INT_1 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , TYPE_3 VAR_3 ) throws TYPE_4 { VAR_6 . METHOD_2 ( VAR_5 , INT_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( float VAR_1 , TYPE_1 VAR_2 ) { VAR_3 -= VAR_1 ; if ( ( VAR_3 ) <= 0 ) { METHOD_2 ( VAR_2 ) ; return true ; } return false ; } | public void METHOD_1 ( float VAR_1 , TYPE_1 VAR_2 ) { VAR_3 -= VAR_1 ; if ( ( VAR_3 ) <= 0 ) { METHOD_2 ( VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) { return VAR_1 . get ( ( ( TYPE_2 . METHOD_2 ( ) ) % ( VAR_1 . size ( ) ) ) ) ; } | private TYPE_1 METHOD_1 ( ) { return VAR_1 . get ( java.lang.Math.abs ( ( ( TYPE_2 . METHOD_2 ( ) ) % ( VAR_1 . size ( ) ) ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.CharSequence VAR_1 ) { if ( ( VAR_1 . length ( ) ) >= INT_1 ) { METHOD_2 ( ) ; } else { METHOD_3 ( ) ; } } | public void METHOD_1 ( java.lang.CharSequence VAR_1 ) { if ( ( VAR_1 . length ( ) ) >= 1 ) { METHOD_2 ( ) ; } else { METHOD_3 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( final TYPE_1 VAR_1 , final java.lang.String VAR_2 ) { if ( VAR_1 == null ) { throw new TYPE_2 ( STRING_1 ) ; } return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_3 , VAR_2 ) . build ( ) ; } | public static TYPE_1 METHOD_1 ( final TYPE_1 VAR_1 , final java.lang.String VAR_2 ) { return VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_3 , VAR_2 ) . build ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { for ( TYPE_1 VAR_1 : VAR_2 ) { VAR_1 . METHOD_2 ( ) ; } for ( TYPE_1 VAR_1 : VAR_3 ) { VAR_1 . METHOD_2 ( ) ; } METHOD_3 ( ) ; } | private void METHOD_1 ( ) { for ( TYPE_1 VAR_1 : VAR_2 ) { VAR_1 . METHOD_2 ( ) ; } for ( TYPE_1 VAR_1 : VAR_3 ) { VAR_1 . METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( float VAR_1 ) { if ( ( ( VAR_2 ) >= ( VAR_3 ) ) && ( ( VAR_2 ) <= ( VAR_4 ) ) ) VAR_2 = VAR_1 ; else TYPE_1 . METHOD_2 ( STRING_1 ) ; } | public static void METHOD_1 ( float VAR_1 ) { if ( ( VAR_1 >= ( VAR_3 ) ) && ( VAR_1 <= ( VAR_4 ) ) ) VAR_2 = VAR_1 ; else TYPE_1 . METHOD_2 ( STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object METHOD_1 ( ) { return VAR_1 [ ( ( ( ( VAR_2 ) - 1 ) + ( VAR_1 . length ) ) % ( VAR_1 . length ) ) ] ; } | public java.lang.Object METHOD_1 ( ) { assert ( size ) > 0 ; return VAR_1 [ ( ( ( ( VAR_2 ) - 1 ) + ( VAR_1 . length ) ) % ( VAR_1 . length ) ) ] ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { return VAR_1 . equals ( VAR_3 . METHOD_2 ( VAR_2 ) . METHOD_3 ( ) ) ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { if ( ( VAR_3 . METHOD_2 ( VAR_2 ) ) != null ) { return VAR_1 . equals ( VAR_3 . METHOD_2 ( VAR_2 ) . METHOD_3 ( ) ) ; } return false ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ) ; super . METHOD_1 ( ) ; } | public void METHOD_1 ( ) { if ( ( TYPE_1 . METHOD_2 ( ) ) != null ) TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ) ; super . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String toString ( ) { return ( ( ( ( this . VAR_1 . toString ( ) ) + STRING_1 ) + ( this . VAR_2 ) ) + STRING_2 ) + ( this . VAR_3 . toString ( ) ) ; } | public java.lang.String toString ( ) { return ( ( ( ( this . VAR_1 ) + STRING_1 ) + ( this . VAR_2 ) ) + STRING_2 ) + ( this . VAR_3 . toString ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ( STRING_1 + VAR_1 ) ) ; VAR_2 . remove ( VAR_1 ) ; } | public void METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( ( STRING_1 + VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( int VAR_1 ) { int VAR_2 = ( TYPE_1 . METHOD_2 ( METHOD_3 ( VAR_1 ) ) ) + ( TYPE_1 . METHOD_2 ( METHOD_4 ( VAR_1 ) ) ) ; return VAR_2 ; } | public int METHOD_1 ( int VAR_1 ) { int VAR_2 = ( METHOD_3 ( VAR_1 ) ) + ( METHOD_4 ( VAR_1 ) ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( INT_1 , INT_2 ) ; assertEquals ( 0 , VAR_1 . METHOD_3 ( ) ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( INT_1 , 0 ) ; assertEquals ( 0 , VAR_1 . METHOD_3 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { new TYPE_1 ( METHOD_2 ( ) ) . METHOD_3 ( STRING_1 ) . METHOD_4 ( TYPE_2 . METHOD_5 ( VAR_2 ) ) . METHOD_6 ( VAR_3 , null ) . show ( ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { new TYPE_1 ( this ) . METHOD_3 ( STRING_1 ) . METHOD_4 ( TYPE_2 . METHOD_5 ( VAR_2 ) ) . METHOD_6 ( VAR_3 , null ) . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { METHOD_2 ( true ) ; TYPE_1 . METHOD_3 ( this ) ; } | public void METHOD_1 ( ) { TYPE_1 . METHOD_3 ( this ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { METHOD_2 ( VAR_1 . METHOD_3 ( ) , VAR_1 . METHOD_4 ( ) ) ; super . METHOD_1 ( ) ; } | public void METHOD_1 ( ) { METHOD_2 ( VAR_1 . METHOD_3 ( ) , VAR_1 . METHOD_4 ( ) ) ; super . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . setText ( STRING_1 ) ; VAR_3 . setText ( STRING_2 ) ; VAR_4 . setText ( STRING_3 ) ; VAR_5 . setText ( STRING_4 ) ; VAR_6 . setText ( STRING_5 ) ; } | private void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . setText ( STRING_1 ) ; VAR_3 . setText ( STRING_2 ) ; VAR_4 . setText ( STRING_3 ) ; VAR_5 . setText ( STRING_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { android.content.Intent VAR_1 = new android.content.Intent ( this , VAR_2 class ) ; VAR_1 . METHOD_2 ( VAR_3 ) ; METHOD_3 ( VAR_1 ) ; this . METHOD_4 ( ) ; } | private void METHOD_1 ( ) { android.content.Intent intent = new android.content.Intent ( this , VAR_2 class ) ; intent . METHOD_2 ( VAR_3 ) ; METHOD_3 ( intent ) ; this . METHOD_4 ( ) ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.