input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { getView ( ) . METHOD_2 ( ) . setText ( VAR_1 . getText ( ) ) ; java.lang.System.err.println ( ( ( VAR_1 . getText ( ) ) + STRING_1 ) ) ; } | private void METHOD_1 ( ) { getView ( ) . METHOD_2 ( ) . setText ( VAR_1 . getText ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 , TYPE_2 . METHOD_3 ( ) ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 . METHOD_2 ( STRING_2 , TYPE_2 . METHOD_3 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; METHOD_2 ( ) . METHOD_3 ( ) . add ( VAR_2 , VAR_1 ) . commit ( ) ; VAR_1 . METHOD_4 ( this ) ; } | public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; METHOD_2 ( ) . METHOD_3 ( ) . replace ( VAR_2 , VAR_1 ) . commit ( ) ; VAR_1 . METHOD_4 ( this ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( java.lang.String msg ) { if ( ( msg != null ) && ( msg . startsWith ( VAR_1 ) ) ) { return true ; } else { return false ; } } | public boolean METHOD_1 ( java.lang.String msg ) { if ( ( msg != null ) && ( msg . startsWith ( VAR_1 ) ) ) { return true ; } else { return false ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 = ( ( int ) ( VAR_3 . METHOD_2 ( VAR_4 ) . METHOD_3 ( ) ) ) ; VAR_3 . METHOD_4 ( ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { VAR_3 . METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.io.File file ) { if ( ( VAR_1 ) != null ) { VAR_1 . delete ( ) ; VAR_1 = file ; } else { VAR_1 = file ; } } | public void METHOD_1 ( java.lang.String file ) { if ( ( VAR_1 ) != null ) { new java.io.File ( VAR_1 ) . delete ( ) ; VAR_1 = file ; } else { VAR_1 = file ; } }
|
The following code may contain bugs. Write a refined code without bugs. private static void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ( ( VAR_1 . METHOD_3 ( ) ) - 1 ) ) ; } | public static void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ( ( VAR_1 . METHOD_3 ( ) ) - 1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( byte [ ] VAR_1 ) { TYPE_2 VAR_2 = new TYPE_2 ( VAR_1 ) ; TYPE_1 VAR_3 = TYPE_3 . METHOD_2 ( VAR_2 ) ; return VAR_3 ; } | public static TYPE_1 METHOD_1 ( byte [ ] VAR_1 ) { TYPE_1 VAR_3 = null ; if ( VAR_1 != null ) { TYPE_2 VAR_2 = new TYPE_2 ( VAR_1 ) ; VAR_3 = TYPE_3 . METHOD_2 ( VAR_2 ) ; } return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { if ( VAR_2 ) METHOD_2 ( this . VAR_3 , VAR_4 , this . VAR_5 , VAR_6 ) ; else METHOD_3 ( this . VAR_3 , VAR_4 , this . VAR_7 , VAR_8 ) ; } | public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { if ( VAR_2 ) METHOD_2 ( VAR_4 , VAR_6 ) ; else METHOD_3 ( VAR_4 , VAR_8 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.content.Context context ) { VAR_1 . context = context ; } | public void METHOD_1 ( android.content.Context context ) { this . context = context ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { this . VAR_1 . set ( java.lang.String . METHOD_2 ( VAR_1 ) ) ; } | public void METHOD_1 ( int VAR_1 ) { this . VAR_1 . set ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int [ ] VAR_1 ) { this . VAR_2 . METHOD_2 ( METHOD_3 ( array ) ) ; } | public void METHOD_1 ( int [ ] VAR_1 ) { this . VAR_2 . METHOD_2 ( METHOD_3 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 delete ( TYPE_2 id , TYPE_3 VAR_1 ) { TYPE_4 VAR_2 = METHOD_1 ( id ) ; return VAR_3 . delete ( ) . build ( ) ; } | public TYPE_1 delete ( TYPE_2 id , TYPE_3 VAR_1 ) { METHOD_1 ( id ) ; return VAR_3 . delete ( ) . build ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.Void result ) { super . METHOD_1 ( result ) ; this . VAR_1 . METHOD_1 ( VAR_2 ) ; } | protected void METHOD_1 ( java.lang.Void result ) { super . METHOD_1 ( result ) ; if ( ( this . VAR_1 ) != null ) this . VAR_1 . METHOD_1 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( int VAR_1 , TYPE_2 VAR_2 ) { TYPE_1 VAR_3 = new TYPE_1 ( STRING_1 ) ; VAR_3 . METHOD_2 ( VAR_4 , VAR_2 ) ; VAR_3 . METHOD_2 ( VAR_5 , VAR_1 ) ; return VAR_3 ; } | private static TYPE_1 METHOD_1 ( int VAR_1 , TYPE_2 VAR_2 ) { TYPE_1 VAR_3 = new TYPE_1 ( STRING_1 ) ; VAR_3 . METHOD_2 ( VAR_4 , VAR_2 ) ; VAR_3 . METHOD_2 ( VAR_5 , VAR_1 ) ; return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String METHOD_1 ( java.util.Date date ) { return TYPE_1 . METHOD_2 ( date , STRING_1 ) ; } | public static java.lang.String METHOD_1 ( java.util.Date date ) { if ( date == null ) { date = new java.util.Date ( ) ; } return TYPE_1 . METHOD_2 ( date , STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 name ( java.lang.String name ) { this . name = name ; return this ; } | public TYPE_1 name ( java.lang.String name ) { this . name = name ; this . message = name ; return this ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( int target ) throws java.io.IOException { while ( ( VAR_1 = METHOD_2 ( ) ) < target ) { return VAR_1 ; } return VAR_1 ; } | public int METHOD_1 ( int target ) throws java.io.IOException { while ( ( VAR_1 = METHOD_2 ( ) ) < target ) { } return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( ) throws java.io.IOException { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( ) ; VAR_1 = null ; } | void METHOD_1 ( ) throws java.io.IOException { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { java.lang.System.out.println ( STRING_1 ) ; for ( TYPE_1 VAR_1 : VAR_2 ) { VAR_1 . METHOD_2 ( ) . remove ( this ) ; } } | private void METHOD_1 ( ) { for ( TYPE_1 VAR_1 : VAR_2 ) { VAR_1 . METHOD_2 ( ) . remove ( this ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 , TYPE_1 listener ) { java.util.Vector VAR_2 = ( ( java.util.Vector ) ( VAR_3 . get ( VAR_1 ) ) ) ; if ( VAR_2 == null ) VAR_2 . remove ( listener ) ; } | public void METHOD_1 ( java.lang.String VAR_1 , TYPE_1 listener ) { java.util.Vector VAR_2 = ( ( java.util.Vector ) ( VAR_3 . get ( VAR_1 ) ) ) ; if ( VAR_2 != null ) { VAR_2 . remove ( listener ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { java.lang.System.out.println ( STRING_1 ) ; int [ ] VAR_1 = new int [ ] { INT_1 , INT_2 } ; VAR_2 . METHOD_2 ( VAR_1 ) ; } | public void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { TYPE_1 . METHOD_2 ( VAR_2 , STRING_1 ) ; VAR_3 [ 1 ] . setText ( VAR_4 ) ; VAR_5 = VAR_6 . get ( 1 ) . METHOD_3 ( ) ; METHOD_4 ( ) ; METHOD_5 ( ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { TYPE_1 . METHOD_2 ( VAR_2 , STRING_1 ) ; VAR_3 [ 1 ] . setText ( VAR_4 ) ; VAR_5 = VAR_6 . get ( 1 ) . METHOD_3 ( ) ; METHOD_5 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( android.content.Context context ) { return ( ( TYPE_1 . getInt ( context . METHOD_2 ( ) , VAR_1 , 1 ) ) == 1 ) && ( context . METHOD_3 ( ) . getBoolean ( VAR_2 ) ) ; } | public static boolean METHOD_1 ( android.content.Context context ) { return ( TYPE_1 . getInt ( context . METHOD_2 ( ) , VAR_1 , 1 ) ) == 1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . remove ( VAR_2 ) ; VAR_3 . remove ( VAR_4 ) ; VAR_3 . remove ( VAR_5 ) ; VAR_5 . remove ( VAR_6 ) ; METHOD_2 ( ) ; VAR_7 . METHOD_3 ( true ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( ) { VAR_1 . remove ( VAR_2 ) ; VAR_3 . remove ( VAR_4 ) ; VAR_3 . remove ( VAR_5 ) ; VAR_5 . remove ( VAR_6 ) ; METHOD_2 ( ) ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int compareTo ( final TYPE_1 VAR_1 ) { throw new TYPE_2 ( STRING_1 ) ; } | public abstract int compareTo ( final TYPE_1 VAR_1 ) ;
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int i ) { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; } | public void METHOD_1 ( int i ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws TYPE_1 { TYPE_2 VAR_1 = TYPE_3 . METHOD_2 ( INT_1 , STRING_1 ) ; VAR_1 . METHOD_3 ( ) ; assert true ; } | public void METHOD_1 ( ) throws TYPE_1 { TYPE_2 VAR_1 = TYPE_3 . METHOD_2 ( INT_1 , STRING_1 ) ; assertNotNull ( VAR_1 ) ; VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) { java.util.LinkedList < TYPE_1 > VAR_1 = VAR_2 . get ( ) ; if ( VAR_1 . isEmpty ( ) ) { return null ; } return VAR_3 ? VAR_1 . METHOD_2 ( ) : null ; } | private TYPE_1 METHOD_1 ( ) { java.util.LinkedList < TYPE_1 > VAR_1 = VAR_2 . get ( ) ; if ( VAR_1 . isEmpty ( ) ) { return null ; } return VAR_3 . get ( ) ? VAR_1 . METHOD_2 ( ) : null ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 words ) { super . METHOD_1 ( words ) ; VAR_1 . METHOD_2 ( context , status ) ; VAR_2 . METHOD_3 ( new TYPE_2 ( context ) ) ; } | protected void METHOD_1 ( TYPE_1 words ) { super . METHOD_1 ( words ) ; if ( VAR_1 . METHOD_2 ( context , status ) ) return ; VAR_2 . METHOD_3 ( new TYPE_2 ( context ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { if ( VAR_1 == null ) return ; METHOD_2 ( VAR_1 . METHOD_3 ( ) , true ) ; } | public void METHOD_1 ( TYPE_1 < TYPE_2 > VAR_1 ) { if ( VAR_1 == null ) return ; METHOD_2 ( VAR_1 . METHOD_3 ( ) , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { METHOD_2 ( ) ; VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_1 . METHOD_4 ( ( ( VAR_2 ) * ( VAR_3 ) ) ) ; } | public void METHOD_1 ( ) { init ( ) ; VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_1 . METHOD_4 ( ( ( VAR_2 ) * ( VAR_3 ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { METHOD_2 ( new TYPE_1 ( ) ) ; } | protected void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { synchronized ( VAR_2 ) { METHOD_2 ( VAR_1 ) ; } } | public java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { synchronized ( VAR_2 ) { return METHOD_2 ( VAR_1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { try { java.io.File file = new java.io.File ( VAR_1 ) ; } catch ( java.lang.Exception VAR_2 ) { throw new TYPE_1 ( STRING_1 , VAR_2 ) ; } } | public void METHOD_1 ( java.lang.String VAR_1 ) { try { java.io.File file = new java.io.File ( VAR_1 ) ; file . delete ( ) ; } catch ( java.lang.Exception VAR_2 ) { throw new TYPE_1 ( STRING_1 , VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . setText ( VAR_3 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View view ) { android.content.Intent intent = new android.content.Intent ( this , VAR_1 class ) ; long VAR_2 = VAR_3 . METHOD_2 ( VAR_4 ) ; intent . METHOD_3 ( STRING_1 , VAR_3 . METHOD_2 ( VAR_4 ) ) ; METHOD_4 ( intent ) ; } | public void METHOD_1 ( android.view.View view ) { android.content.Intent intent = new android.content.Intent ( this , VAR_1 class ) ; intent . METHOD_3 ( STRING_1 , VAR_3 . METHOD_2 ( VAR_4 ) ) ; METHOD_4 ( intent ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String date ) { TYPE_2 VAR_1 = new TYPE_2 ( STRING_1 ) ; TYPE_1 result = VAR_2 . METHOD_1 ( date ) ; return result ; } | public TYPE_1 METHOD_1 ( java.lang.String date ) { TYPE_1 result = VAR_2 . METHOD_1 ( date ) ; return result ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Object response ) { VAR_1 . METHOD_2 ( VAR_2 ) ; } | public void METHOD_1 ( java.lang.Object response ) { VAR_1 . METHOD_2 ( 1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( true ) ; METHOD_3 ( VAR_2 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( false ) ; METHOD_3 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( android.content.Context VAR_1 ) { return new TYPE_2 ( this , VAR_1 ) ; } | public TYPE_1 METHOD_1 ( android.content.Context VAR_1 ) { return new TYPE_2 ( this , VAR_1 , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { java.util.List < TYPE_1 > VAR_1 = VAR_2 . METHOD_1 ( ) ; TYPE_2 . assertEquals ( INT_1 , VAR_1 . size ( ) ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { java.util.List < TYPE_1 > VAR_1 = VAR_2 . METHOD_1 ( ) ; assertEquals ( INT_1 , VAR_1 . size ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean isEmpty ( java.lang.String VAR_1 ) { return ( VAR_1 == null ) || ( ( VAR_1 . length ( ) ) == 0 ) ; } | public static boolean isEmpty ( java.lang.String value ) { return ( value == null ) || ( ( value . length ( ) ) == 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.ArrayList < TYPE_1 > VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; } | public void METHOD_1 ( java.util.List < TYPE_1 > VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Exception error ) { METHOD_2 ( ( ( STRING_1 + ( this . VAR_1 ) ) + STRING_2 ) , error ) ; this . VAR_2 . METHOD_3 ( ) ; } | public void METHOD_1 ( java.lang.Exception error ) { METHOD_2 ( ( ( STRING_1 + ( this . VAR_1 ) ) + STRING_2 ) , error ) ; this . error = error ; this . VAR_2 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void main ( java.lang.String [ ] args ) throws TYPE_1 { TYPE_2 TYPE_3 = new TYPE_2 ( ) ; TYPE_3 . METHOD_1 ( STRING_1 ) ; TYPE_3 . METHOD_2 ( ) ; TYPE_3 . METHOD_3 ( args [ 1 ] ) ; } | public static void main ( java.lang.String [ ] args ) throws TYPE_1 { TYPE_2 TYPE_3 = new TYPE_2 ( ) ; TYPE_3 . METHOD_1 ( args [ 0 ] ) ; TYPE_3 . METHOD_2 ( ) ; TYPE_3 . METHOD_3 ( args [ 1 ] ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.Collection < TYPE_1 > METHOD_1 ( ) { synchronized ( VAR_1 ) { return VAR_1 ; } } | public java.util.Collection < TYPE_1 > METHOD_1 ( ) { return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.Map < java.lang.String , TYPE_1 > METHOD_1 ( ) { return TYPE_2 . METHOD_2 ( VAR_1 ) ; } | public java.util.Map < java.lang.String , TYPE_1 > METHOD_1 ( ) { return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { for ( TYPE_1 VAR_3 : VAR_1 . METHOD_2 ( ) ) { if ( TYPE_3 . METHOD_3 ( VAR_3 . name ( ) ) ) { return VAR_3 ; } } throw new TYPE_4 ( ) ; } | public static TYPE_1 METHOD_1 ( TYPE_1 VAR_1 ) { for ( TYPE_1 VAR_3 : VAR_1 . METHOD_2 ( ) ) { if ( TYPE_3 . METHOD_3 ( VAR_3 . name ( ) ) ) { return VAR_3 ; } } throw new TYPE_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( final TYPE_1 VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( VAR_2 , VAR_1 ) ; return true ; } | public boolean METHOD_1 ( final TYPE_1 VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( VAR_2 , VAR_1 ) ; return super . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( true ) ; VAR_2 . METHOD_3 ( ) ; VAR_1 . METHOD_2 ( false ) ; } | public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( false ) ; VAR_2 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 , int type ) throws TYPE_1 { VAR_4 . METHOD_2 ( VAR_1 , VAR_2 ) ; VAR_5 . METHOD_3 ( VAR_1 , VAR_3 , type ) ; } | protected void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) throws TYPE_1 { VAR_4 . METHOD_2 ( VAR_1 , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { java.lang.String [ ] args = new java.lang.String [ ] { STRING_1 } ; VAR_1 . METHOD_2 ( args ) ; TYPE_1 . assertEquals ( 1 , VAR_1 . METHOD_3 ( ) ) ; } | public void METHOD_1 ( ) { java.lang.String [ ] args = new java.lang.String [ ] { STRING_1 } ; VAR_1 . METHOD_2 ( args ) ; TYPE_1 . assertEquals ( 0 , VAR_1 . METHOD_3 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( java.util.Calendar VAR_1 ) { double VAR_2 = TYPE_1 . METHOD_2 ( VAR_3 , VAR_1 ) ; VAR_2 = VAR_2 / INT_1 ; return VAR_2 ; } | public double METHOD_1 ( java.util.Calendar VAR_1 ) { return 0 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( true ) ; assertEquals ( VAR_1 . METHOD_3 ( new TYPE_1 ( INT_1 , INT_2 , INT_3 ) ) , VAR_2 ) ; } | public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( true ) ; assertEquals ( VAR_2 , VAR_1 . METHOD_3 ( new TYPE_1 ( INT_1 , INT_2 , INT_3 ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( ) { for ( int i = 0 ; i < ( VAR_1 ) ; i ++ ) if ( ( VAR_2 [ i ] [ 1 ] ) != 0 ) return true ; return false ; } | public boolean METHOD_1 ( ) { for ( int i = 0 ; i < ( VAR_1 ) ; i ++ ) if ( ( VAR_2 [ 1 ] [ i ] ) != 0 ) return true ; return false ; }
|
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 ( VAR_1 . METHOD_2 ( ) . METHOD_3 ( ) . intValue ( ) ) - ( VAR_2 . METHOD_2 ( ) . METHOD_3 ( ) . intValue ( ) ) ; } | public int METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { return ( VAR_1 . METHOD_2 ( ) . METHOD_3 ( ) ) - ( VAR_2 . METHOD_2 ( ) . METHOD_3 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( STRING_1 , STRING_2 , STRING_3 , STRING_4 ) ; java.lang.String result = target . METHOD_3 ( STRING_1 , STRING_2 ) ; TYPE_1 . assertThat ( result , TYPE_2 . METHOD_4 ( STRING_5 ) ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { listener . METHOD_2 ( VAR_2 ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { if ( listener != null ) { listener . METHOD_2 ( VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public boolean offset ( TYPE_1 file ) throws TYPE_2 { return false ; } | public boolean offset ( TYPE_1 file ) throws TYPE_2 { return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( java.lang.String VAR_1 , TYPE_1 VAR_2 ) { try { VAR_2 . METHOD_2 ( VAR_1 , 0 ) ; return true ; } catch ( TYPE_1 VAR_3 ) { return false ; } } | static boolean METHOD_1 ( java.lang.String VAR_1 , TYPE_1 VAR_2 ) { try { VAR_2 . METHOD_2 ( VAR_1 , 0 ) ; return true ; } catch ( TYPE_1 VAR_3 ) { return false ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . remove ( VAR_1 ) ; java.lang.String msg = ( STRING_1 + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_2 ; METHOD_3 ( msg ) ; METHOD_4 ( msg ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . remove ( VAR_1 ) ; java.lang.String msg = ( STRING_1 + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_2 ; METHOD_4 ( msg ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_1 ( VAR_1 . getActivity ( ) ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_1 ( VAR_1 . getActivity ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( STRING_1 ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; METHOD_5 ( ) ; METHOD_6 ( ) ; METHOD_7 ( ) ; } | public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( STRING_1 ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; METHOD_5 ( ) ; METHOD_6 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 c ) { return METHOD_2 ( c , VAR_1 . get ( c ) ) ; } | public TYPE_1 METHOD_1 ( TYPE_2 c ) { return METHOD_2 ( c , VAR_1 . get ( c ) , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { METHOD_2 ( false ) ; METHOD_3 ( true ) ; METHOD_4 ( false ) ; METHOD_5 ( false ) ; METHOD_6 ( VAR_1 ) ; } | private void METHOD_1 ( ) { METHOD_2 ( false ) ; METHOD_3 ( true ) ; METHOD_4 ( false ) ; METHOD_5 ( false , false ) ; METHOD_6 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( ) { VAR_1 = ( VAR_2 ) - ( ( VAR_3 ) / ( VAR_4 ) ) ; return VAR_1 ; } | public double METHOD_1 ( ) { VAR_1 = ( VAR_2 ) - ( VAR_3 ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public synchronized void METHOD_1 ( java.lang.String VAR_1 ) { VAR_2 = true ; METHOD_2 ( VAR_1 ) ; } | public synchronized void METHOD_1 ( java.lang.String VAR_1 ) { METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = VAR_3 ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return new java.lang.Integer ( VAR_1 . METHOD_2 ( STRING_1 ) . getValue ( ) ) ; } | public int METHOD_1 ( ) { return java.lang.Integer.parseInt ( VAR_1 . METHOD_2 ( STRING_1 ) . getValue ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( ) { if ( VAR_1 ) { return ; } commit ( ) ; VAR_2 = VAR_3 ; VAR_4 = VAR_5 ; VAR_6 = VAR_7 ; VAR_8 = VAR_9 ; METHOD_2 ( ) ; } | void METHOD_1 ( ) { if ( VAR_1 ) { return ; } VAR_2 = VAR_3 ; VAR_4 = VAR_5 ; VAR_6 = VAR_7 ; VAR_8 = VAR_9 ; commit ( ) ; METHOD_2 ( ) ; }
|
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 ) ; } else { VAR_2 = true ; METHOD_3 ( VAR_1 ) ; } METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_3 ( VAR_1 ) ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return METHOD_1 ( true ) ; } | public int METHOD_1 ( ) { return METHOD_1 ( true , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.content.Intent data , int VAR_1 , int result , int VAR_2 ) { switch ( VAR_2 ) { case VAR_3 : TYPE_1 . METHOD_2 ( getContext ( ) , data , VAR_1 , result ) ; break ; } } | public void METHOD_1 ( android.content.Intent data , int VAR_1 , int result , int VAR_2 ) { switch ( VAR_2 ) { case VAR_3 : TYPE_1 . METHOD_2 ( this , data , VAR_1 , result ) ; break ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static double METHOD_1 ( ) { double value = VAR_1 . METHOD_2 ( ) ; if ( value == 0 ) { return 0 ; } value = 1 / value ; return VAR_1 . METHOD_3 ( ) ? value : - value ; } | public static double METHOD_1 ( ) { double value = VAR_1 . METHOD_2 ( ) ; if ( value == 0 ) { return 0 ; } value = ( 1 / value ) - 1 ; return VAR_1 . METHOD_3 ( ) ? value : - value ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { try { METHOD_2 ( ) ; VAR_1 = 0 ; } catch ( java.lang.Throwable VAR_2 ) { VAR_2 . METHOD_3 ( ) ; } } | protected void METHOD_1 ( ) throws java.lang.Throwable { METHOD_2 ( ) ; VAR_1 = 0 ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( int VAR_1 , int VAR_2 ) { return ( VAR_3 [ VAR_1 ] ) == VAR_2 ; } | public boolean METHOD_1 ( int VAR_1 , int VAR_2 ) { return ( VAR_3 [ VAR_1 ] ) >= VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { out . METHOD_2 ( STRING_1 ) ; try { java.lang.System.out.println ( STRING_2 ) ; VAR_1 . METHOD_3 ( ) ; } catch ( java.io.IOException VAR_2 ) { } } | public void METHOD_1 ( ) throws java.io.IOException { out . METHOD_2 ( STRING_1 ) ; java.lang.System.out.println ( STRING_2 ) ; VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , int VAR_2 ) { VAR_3 = VAR_1 . getContext ( ) ; android.view.View VAR_4 = TYPE_3 . METHOD_2 ( VAR_3 ) . METHOD_3 ( VAR_5 , VAR_1 , false ) ; return new TYPE_1 ( VAR_4 , VAR_6 ) ; } | public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , int VAR_2 ) { android.view.View VAR_4 = TYPE_3 . METHOD_2 ( VAR_3 ) . METHOD_3 ( VAR_5 , VAR_1 , false ) ; return new TYPE_1 ( VAR_4 , VAR_6 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { VAR_1 ^= true ; METHOD_2 ( VAR_2 ) ; VAR_3 = STRING_1 ; VAR_4 . METHOD_3 ( 0 ) ; } | private void METHOD_1 ( ) { VAR_1 ^= true ; METHOD_2 ( ) ; VAR_3 = STRING_1 ; VAR_4 . METHOD_3 ( 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) throws java.lang.Exception { java.util.Scanner VAR_1 = new java.util.Scanner ( VAR_2 ) ; VAR_2 . METHOD_2 ( VAR_2 . METHOD_3 ( ) ) ; java.lang.String VAR_3 ; VAR_3 = VAR_1 . METHOD_4 ( ) ; VAR_1 . METHOD_5 ( ) ; return VAR_3 ; } | public java.lang.String METHOD_1 ( ) throws java.lang.Exception { java.util.Scanner VAR_1 = new java.util.Scanner ( VAR_2 ) ; VAR_2 . METHOD_2 ( VAR_2 . METHOD_3 ( ) ) ; java.lang.String VAR_3 ; VAR_3 = VAR_1 . METHOD_4 ( ) ; return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) { TYPE_2 VAR_1 = ( ( TYPE_2 ) ( VAR_2 ) ) ; return new TYPE_1 ( VAR_1 . METHOD_2 ( ) ) ; } | private TYPE_1 METHOD_1 ( ) { return new TYPE_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; int VAR_2 = VAR_1 . METHOD_2 ( STRING_1 ) ; METHOD_3 ( VAR_2 , 0 ) ; } | public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; java.lang.String arg = STRING_1 ; int VAR_2 = VAR_1 . METHOD_2 ( arg ) ; assertEquals ( VAR_2 , 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { state = null ; } | protected void METHOD_1 ( ) { state = null ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 [ ] METHOD_1 ( ) { TYPE_1 [ ] VAR_1 = new TYPE_1 [ VAR_2 . size ( ) ] ; return VAR_2 . METHOD_2 ( VAR_1 ) ; } | public TYPE_1 [ ] METHOD_1 ( ) { if ( ( VAR_2 ) == null ) return null ; TYPE_1 [ ] VAR_1 = new TYPE_1 [ VAR_2 . size ( ) ] ; return VAR_2 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { if ( ( VAR_1 . METHOD_2 ( ) ) < 0 ) { return VAR_2 ; } else { return VAR_1 ; } } | private TYPE_1 METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { if ( ( VAR_1 . METHOD_2 ( ) ) <= 0 ) { return VAR_2 ; } else { return VAR_1 ; } }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) . execute ( new TYPE_1 ( ) { public void METHOD_3 ( ) { TYPE_2 . METHOD_4 ( VAR_2 , ( STRING_1 + ( VAR_3 ) ) ) ; METHOD_5 ( VAR_4 ) ; } } ) ; } | void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) . execute ( new TYPE_1 ( ) { public void METHOD_3 ( ) { TYPE_2 . METHOD_4 ( VAR_2 , ( STRING_1 + ( VAR_3 ) ) ) ; METHOD_5 ( VAR_3 ) ; } } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( ) { final TYPE_1 TYPE_2 = TYPE_1 . METHOD_2 ( ) ; return ( TYPE_2 . METHOD_3 ( STRING_1 ) ) != null ; } | private boolean METHOD_1 ( ) { final TYPE_1 TYPE_2 = TYPE_1 . METHOD_2 ( ) ; if ( TYPE_2 == null ) { return false ; } return ( TYPE_2 . METHOD_3 ( STRING_1 ) ) != null ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 ) { return ( STRING_1 . METHOD_2 ( VAR_1 . getName ( ) ) ) || ( STRING_2 . METHOD_2 ( VAR_1 . getName ( ) ) ) ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 ) { return STRING_1 . METHOD_2 ( VAR_1 . getName ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void add ( final java.lang.String fieldName , final int value ) { this . add ( fieldName , java.lang.String . METHOD_1 ( value ) ) ; } | private java.lang.String METHOD_1 ( final int value ) { return java.lang.String . METHOD_1 ( value ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( TYPE_1 VAR_1 ) throws java.io.IOException , TYPE_2 { return TYPE_3 . METHOD_2 ( VAR_1 , ( INT_1 * INT_2 ) , true ) ; } | public static boolean METHOD_1 ( TYPE_1 VAR_1 ) throws java.io.IOException , TYPE_2 { return TYPE_3 . METHOD_2 ( VAR_1 , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( VAR_1 ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( VAR_1 , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.Integer VAR_1 ) { return VAR_2 . METHOD_1 ( VAR_1 ) ; } | public void METHOD_1 ( java.lang.Integer VAR_1 ) { VAR_2 . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String VAR_1 , TYPE_2 VAR_2 ) { TYPE_1 VAR_3 = VAR_4 . METHOD_1 ( VAR_1 ) ; VAR_3 . METHOD_2 ( VAR_2 ) ; VAR_3 . METHOD_3 ( VAR_2 ) ; return VAR_3 ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 , TYPE_2 VAR_2 ) { TYPE_1 VAR_3 = VAR_4 . METHOD_1 ( VAR_1 ) ; VAR_3 . METHOD_3 ( VAR_2 ) ; VAR_3 . METHOD_2 ( VAR_2 ) ; return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 item ) { if ( ( item . METHOD_2 ( ) ) == ( VAR_1 ) ) { METHOD_3 ( ) ; return true ; } else return false ; } | public boolean METHOD_1 ( TYPE_1 item ) { if ( ( item . METHOD_2 ( ) ) == ( VAR_1 ) ) METHOD_3 ( ) ; return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( final TYPE_2 VAR_1 ) throws TYPE_3 , TYPE_4 { return METHOD_1 ( VAR_1 , false ) ; } | public TYPE_1 METHOD_1 ( final TYPE_2 VAR_1 ) throws TYPE_3 , TYPE_4 { return METHOD_1 ( VAR_1 , false , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void init ( TYPE_1 event ) { super . init ( event ) ; VAR_1 = new TYPE_2 ( ) ; TYPE_3 . METHOD_1 ( VAR_1 ) ; } | public void init ( TYPE_1 event ) { super . init ( event ) ; TYPE_3 . METHOD_1 ( new TYPE_2 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; if ( ! ( VAR_1 . METHOD_3 ( ) ) ) { this . VAR_1 = new TYPE_2 ( VAR_1 ) ; } this . VAR_1 = VAR_1 ; return this ; } | public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; if ( VAR_1 . METHOD_3 ( ) ) { this . VAR_1 = new TYPE_2 ( VAR_1 ) ; } this . VAR_1 = VAR_1 ; return this ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; return false ; } | public boolean METHOD_1 ( java.lang.String VAR_1 ) { return false ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.Map < java.lang.String , java.lang.Integer > VAR_1 ) { this . VAR_1 = TYPE_1 . METHOD_2 ( VAR_1 ) ; } | public void METHOD_1 ( java.util.Map < java.lang.String , java.lang.Integer > VAR_1 ) { if ( VAR_1 != null ) { this . VAR_1 = TYPE_1 . METHOD_2 ( VAR_1 ) ; } }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.