input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. private java.lang.String METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.String VAR_2 = TYPE_2 . METHOD_2 ( VAR_1 ) ; java.lang.String VAR_3 = STRING_1 ; return VAR_3 ; } | private java.lang.String METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.String VAR_3 = STRING_1 ; return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void init ( TYPE_1 VAR_1 ) { boolean VAR_2 = ( VAR_3 ) == null ; if ( VAR_2 ) throw new TYPE_2 ( STRING_1 ) ; VAR_3 = new TYPE_3 ( VAR_1 ) ; VAR_4 = true ; } | public void init ( TYPE_1 VAR_1 ) { if ( ( VAR_3 ) != null ) throw new TYPE_2 ( STRING_1 ) ; VAR_3 = new TYPE_3 ( VAR_1 ) ; VAR_4 = true ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 i ) { VAR_1 . put ( ( ( VAR_2 ) ++ ) , i ) ; } | public void METHOD_1 ( TYPE_1 i ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; VAR_2 . METHOD_3 ( ) ; VAR_2 . METHOD_4 ( ) ; } | public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; VAR_2 . METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private static int METHOD_1 ( long VAR_1 ) { if ( VAR_1 == 0 ) return 0 ; return INT_1 - ( java.lang.Long . METHOD_2 ( VAR_1 ) ) ; } | private static int METHOD_1 ( long VAR_1 ) { if ( VAR_1 == 0 ) return 1 ; return INT_1 - ( java.lang.Long . METHOD_2 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean equals ( java.lang.Object VAR_1 ) { if ( ( VAR_2 ) instanceof TYPE_1 ) { TYPE_1 VAR_3 = ( ( TYPE_1 ) ( VAR_1 ) ) ; return this . getName ( ) . equals ( VAR_3 . getName ( ) ) ; } return false ; } | public boolean equals ( java.lang.Object VAR_1 ) { if ( VAR_1 instanceof TYPE_1 ) { TYPE_1 VAR_3 = ( ( TYPE_1 ) ( VAR_1 ) ) ; return this . getName ( ) . equals ( VAR_3 . getName ( ) ) ; } return false ; }
|
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 ) ; TYPE_2 . METHOD_2 ( true ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; start ( ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_2 . METHOD_2 ( true ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; }
|
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 ( 1 , STRING_1 , STRING_2 , STRING_3 ) ; TYPE_2 . assertEquals ( VAR_1 , VAR_2 . METHOD_1 ( 1 ) ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( 1 , STRING_1 , STRING_2 , STRING_3 ) ; assertEquals ( VAR_1 , VAR_2 . METHOD_1 ( 1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.io.File file , java.lang.String type ) throws java.io.IOException { if ( file == null ) throw new TYPE_1 ( STRING_1 ) ; TYPE_2 . METHOD_2 ( this . VAR_1 , type , file ) ; } | public void METHOD_1 ( java.io.File file , java.lang.String type ) throws java.io.IOException { if ( file == null ) { throw new TYPE_1 ( STRING_1 ) ; } TYPE_2 . METHOD_2 ( VAR_1 , type , file ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.String VAR_1 ) { java.lang.System.out.println ( VAR_1 ) ; return true ; } | public boolean METHOD_1 ( java.lang.String VAR_1 ) { return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { if ( ( ( VAR_2 ) == 0 ) && ( ( VAR_3 ) == 0 ) ) { VAR_3 = VAR_1 ; } else { VAR_3 = ( VAR_3 ) + ( VAR_1 - 1 ) ; } } | public void METHOD_1 ( int VAR_1 ) { if ( ( VAR_3 ) == 0 ) { VAR_3 = VAR_1 ; } else { VAR_3 = ( VAR_3 ) + ( VAR_1 - 1 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return ( data ) != null ? data . METHOD_1 ( ) : 0 ; } | public int METHOD_1 ( ) { return ( data ) == null ? 0 : data . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.CharSequence VAR_1 , TYPE_1 results ) { if ( ( results != null ) && ( ( results . count ) > 0 ) ) { METHOD_2 ( ) ; } else { } } | protected void METHOD_1 ( java.lang.CharSequence VAR_1 , TYPE_1 results ) { if ( ( results != null ) && ( ( results . count ) > 0 ) ) { METHOD_2 ( ) ; } else { METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static int get ( final java.lang.String key ) { if ( ! ( VAR_1 . METHOD_1 ( key ) ) ) TYPE_1 . METHOD_2 ( STRING_1 , key ) ; return VAR_1 . METHOD_1 ( key ) ? VAR_1 . get ( key ) : VAR_2 ; } | public static int get ( final java.lang.String key ) { return VAR_1 . METHOD_1 ( key ) ? VAR_1 . get ( key ) : VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( false ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { METHOD_1 ( false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { if ( ! ( METHOD_2 ( ) . METHOD_3 ( ) . equals ( STRING_1 ) ) ) return METHOD_4 ( STRING_2 ) ; return METHOD_5 ( STRING_3 ) ; } | public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return METHOD_5 ( STRING_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 method , TYPE_2 response ) { METHOD_2 ( ) ; } | public void METHOD_1 ( TYPE_1 method , TYPE_2 response ) { }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 , android.view.View view , int VAR_2 , java.lang.CharSequence text ) { METHOD_2 ( ( ( VAR_2 + STRING_1 ) + text ) ) ; VAR_3 = VAR_2 ; METHOD_3 ( ) ; METHOD_4 ( ) ; return true ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 , android.view.View view , int VAR_2 , java.lang.CharSequence text ) { VAR_3 = VAR_2 ; METHOD_3 ( ) ; METHOD_4 ( ) ; return true ; }
|
The following code may contain bugs. Write a refined code without bugs. private synchronized void METHOD_1 ( ) { if ( VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( VAR_2 ) ; VAR_1 = false ; } METHOD_2 ( ) . METHOD_4 ( VAR_3 ) ; VAR_4 = true ; } | private synchronized void METHOD_1 ( ) { if ( VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( VAR_2 ) ; VAR_1 = false ; } METHOD_2 ( ) . METHOD_4 ( VAR_3 , null , false ) ; VAR_4 = true ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( VAR_2 ) ; this . VAR_3 = new TYPE_2 ( VAR_1 , VAR_4 ) . METHOD_3 ( ) ; } | public void METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( VAR_2 ) ; if ( VAR_1 != null ) this . VAR_3 = new TYPE_2 ( VAR_1 , VAR_4 ) . METHOD_3 ( ) ; this . VAR_3 = new java.util.LinkedList < > ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. static TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , java.lang.String VAR_2 ) { return TYPE_1 . METHOD_2 ( VAR_1 , TYPE_3 . METHOD_3 ( ) , VAR_3 , ( STRING_1 + VAR_2 ) ) ; } | static TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , java.lang.String VAR_2 ) { return TYPE_1 . METHOD_2 ( TYPE_3 . METHOD_3 ( ) , VAR_3 , VAR_1 , ( STRING_1 + VAR_2 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String date , java.lang.String VAR_1 ) { if ( date != null ) { VAR_2 = true ; data . METHOD_2 ( VAR_1 ) ; view . METHOD_3 ( date ) ; view . METHOD_4 ( ) ; } } | public void METHOD_1 ( java.lang.String date , java.lang.String VAR_1 ) { if ( date != null ) { VAR_2 = true ; data . METHOD_2 ( VAR_1 ) ; view . METHOD_3 ( date ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.String VAR_1 ) { this . VAR_2 . setText ( ( STRING_1 + VAR_1 ) ) ; } | private void METHOD_1 ( java.lang.String VAR_1 ) { this . VAR_2 . setText ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { VAR_1 . setText ( fileName ) ; } | private void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { if ( ( METHOD_2 ( VAR_1 ) ) <= ( METHOD_2 ( VAR_2 ) ) ) return 1 ; else return - 1 ; } | public int METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { if ( ( METHOD_2 ( VAR_1 ) ) >= ( METHOD_2 ( VAR_2 ) ) ) return 1 ; else return - 1 ; }
|
The following code may contain bugs. Write a refined code without bugs. private static void METHOD_1 ( ) { VAR_1 = VAR_2 . format ( VAR_3 . date ) ; java.lang.System.out.println ( VAR_1 ) ; } | private static void METHOD_1 ( ) { VAR_3 . date = new java.util.Date ( ) ; VAR_1 = VAR_2 . format ( VAR_3 . date ) ; java.lang.System.out.println ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 < TYPE_2 > METHOD_1 ( ) { if ( ( VAR_1 ) == null ) { VAR_1 = VAR_2 . get ( ) ; } return VAR_1 ; } | public TYPE_1 < TYPE_2 > METHOD_1 ( ) { if ( ( VAR_1 ) == null ) { VAR_1 = VAR_2 . get ( ) ; VAR_1 . setValue ( value ) ; } return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void add ( TYPE_1 VAR_1 ) { VAR_2 . add ( VAR_1 ) ; METHOD_1 ( ( ( VAR_2 . size ( ) ) - 1 ) ) ; } | public boolean contains ( TYPE_1 VAR_1 ) { return VAR_2 . contains ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws TYPE_1 { java.lang.String VAR_1 = STRING_1 + ( STRING_2 + STRING_3 ) ; METHOD_2 ( VAR_1 , STRING_4 ) ; } | public void METHOD_1 ( ) throws TYPE_1 { java.lang.String VAR_1 = STRING_1 + ( STRING_2 + STRING_3 ) ; METHOD_2 ( VAR_1 , STRING_4 , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , boolean VAR_2 ) { VAR_3 . METHOD_2 ( VAR_2 ) ; TYPE_2 . get ( ) . METHOD_2 ( VAR_2 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , boolean VAR_2 ) { VAR_3 . METHOD_2 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { if ( VAR_2 ) { VAR_3 = VAR_4 ; } VAR_1 . METHOD_2 ( ) ; VAR_1 = null ; } } | public void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { if ( VAR_2 ) { VAR_3 = VAR_4 ; } else { VAR_1 . METHOD_2 ( ) ; VAR_1 = null ; } } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( this ) ; this . METHOD_3 ( ) . METHOD_4 ( this . METHOD_5 ( ) ) ; } | public void METHOD_1 ( ) { this . METHOD_3 ( ) . METHOD_4 ( this . METHOD_5 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( ( ( VAR_1 . METHOD_3 ( ) . count ( ) ) > 0 ) , STRING_1 , VAR_1 , VAR_1 , VAR_1 , VAR_1 . toString ( ) ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( ( ( VAR_1 . METHOD_3 ( ) . count ( ) ) > 0 ) , STRING_1 , VAR_1 , VAR_1 , VAR_1 . toString ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 c = new TYPE_1 ( VAR_1 ) ; assertEquals ( c . equals ( STRING_1 ) , false ) ; } | public void METHOD_1 ( ) { TYPE_1 c = new TYPE_1 ( VAR_1 ) ; assertEquals ( false , c . equals ( STRING_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { ( ( TYPE_1 ) ( getActivity ( ) ) ) . METHOD_2 ( VAR_1 ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; METHOD_5 ( ) ; METHOD_6 ( ) ; } | private void METHOD_1 ( ) { ( ( TYPE_1 ) ( getActivity ( ) ) ) . METHOD_2 ( VAR_1 ) ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { if ( VAR_1 . isEmpty ( ) ) { VAR_1 = STRING_1 ; } return VAR_1 ; } | public java.lang.String METHOD_1 ( ) { return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; VAR_2 . METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String id ) { VAR_1 . remove ( id ) ; } | public boolean METHOD_1 ( java.lang.String id ) { if ( ( VAR_1 . remove ( id ) ) == null ) return false ; return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.String VAR_1 , TYPE_1 VAR_2 , TYPE_2 VAR_3 ) { if ( ! ( METHOD_2 ( METHOD_3 ( VAR_2 ) ) ) ) { return false ; } return true ; } | public boolean METHOD_1 ( java.lang.String VAR_1 , TYPE_1 VAR_2 , TYPE_2 VAR_3 ) { return METHOD_2 ( METHOD_3 ( VAR_2 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 p , TYPE_2 c ) { if ( c != null ) { VAR_1 = c ; p . METHOD_2 ( c ) ; } else { java.lang.System.out.println ( STRING_1 ) ; } } | public void METHOD_1 ( TYPE_1 p , TYPE_2 c ) { VAR_1 = c ; p . METHOD_2 ( c ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( TYPE_2 context ) { if ( ( VAR_1 ) == null ) { VAR_1 = new TYPE_1 ( context ) ; } VAR_2 = context ; return VAR_1 ; } | public static TYPE_1 METHOD_1 ( TYPE_2 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 ( TYPE_1 listener , java.lang.Class < ? > VAR_1 , java.lang.Object [ ] VAR_2 ) { METHOD_1 ( listener , ( VAR_1 != null ? new java.lang.Class [ ] { VAR_1 } : null ) , VAR_2 ) ; } | public void METHOD_1 ( TYPE_1 listener , java.lang.Class < ? > VAR_1 ) { METHOD_1 ( listener , ( VAR_1 != null ? new java.lang.Class [ ] { VAR_1 } : null ) , null , null , null ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) throws java.lang.Exception { VAR_1 = java.io.File . METHOD_2 ( STRING_1 , STRING_2 ) ; return new TYPE_1 ( VAR_1 , STRING_3 ) ; } | public TYPE_1 METHOD_1 ( ) throws java.lang.Exception { if ( ( VAR_1 ) == null ) { VAR_1 = java.io.File . METHOD_2 ( STRING_1 , STRING_2 ) ; } return new TYPE_1 ( VAR_1 , STRING_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( java.lang.Double value , java.lang.String VAR_1 ) { if ( TYPE_2 . METHOD_2 ( value ) ) { return TYPE_2 . METHOD_3 ( value , VAR_1 ) ; } else { TYPE_3 . METHOD_4 ( STRING_1 , value ) ; return null ; } } | public static TYPE_1 METHOD_1 ( java.lang.Double value , java.lang.String VAR_1 ) { return TYPE_2 . METHOD_3 ( value , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { if ( TYPE_1 . equals ( this . VAR_2 , VAR_2 ) ) { return ; } if ( VAR_3 ) { throw new TYPE_2 ( ) ; } this . VAR_1 = VAR_1 ; } | public void METHOD_1 ( java.lang.String VAR_1 ) { if ( TYPE_1 . equals ( this . VAR_1 , VAR_1 ) ) { return ; } if ( VAR_3 ) { throw new TYPE_2 ( ) ; } this . VAR_1 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public long METHOD_1 ( int VAR_1 ) { TYPE_1 . METHOD_2 ( ( VAR_1 > 0 ) ) ; long size = this . VAR_2 . size ( ) ; return 1 + ( ( size - 1 ) / VAR_1 ) ; } | public int METHOD_1 ( int VAR_1 ) { TYPE_1 . METHOD_2 ( ( VAR_1 > 0 ) ) ; java.lang.Long size = this . VAR_2 . size ( ) ; return 1 + ( ( ( size . intValue ( ) ) - 1 ) / VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 VAR_1 ) { this . METHOD_2 ( VAR_2 ) ; VAR_3 . METHOD_3 ( this , VAR_2 ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_3 . METHOD_3 ( this , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final android.view.View VAR_1 ) { final java.lang.String key = VAR_2 . METHOD_2 ( position ) . METHOD_3 ( ) ; METHOD_4 ( key , item ) ; TYPE_1 . METHOD_5 ( getContext ( ) , STRING_1 , VAR_3 ) . show ( ) ; } | public void METHOD_1 ( final android.view.View VAR_1 ) { final java.lang.String key = VAR_2 . METHOD_2 ( position ) . METHOD_3 ( ) ; METHOD_4 ( key , item ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( java.lang.Void ... params ) { return METHOD_2 ( STRING_1 , STRING_1 ) ; } | protected TYPE_1 METHOD_1 ( java.lang.String [ ] ... params ) { return METHOD_2 ( params [ 0 ] [ 0 ] , params [ 0 ] [ 1 ] ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.Collection < java.lang.String > METHOD_1 ( TYPE_1 start , TYPE_1 end ) { return TYPE_2 . METHOD_1 ( start , end , VAR_1 . METHOD_2 ( ) . METHOD_3 ( ) , VAR_2 ) ; } | public java.util.Collection < java.lang.String > METHOD_1 ( TYPE_1 start , TYPE_1 end ) { return TYPE_2 . METHOD_1 ( start , end , VAR_1 , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 = null ; VAR_2 = null ; METHOD_2 ( ) ; } | public void METHOD_1 ( ) { VAR_1 = null ; VAR_2 = null ; METHOD_2 ( true , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.util.ArrayList < java.lang.Double > METHOD_1 ( int n ) { java.util.ArrayList < java.lang.Double > VAR_1 = new java.util.ArrayList < > ( ) ; while ( n > 0 ) { VAR_1 . add ( VAR_2 . METHOD_2 ( ) ) ; } return VAR_1 ; } | private java.util.ArrayList < java.lang.Double > METHOD_1 ( int n ) { java.util.ArrayList < java.lang.Double > VAR_1 = new java.util.ArrayList < > ( ) ; while ( n > 0 ) { VAR_1 . add ( VAR_2 . METHOD_2 ( ) ) ; n -- ; } return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) throws TYPE_2 { return new TYPE_1 ( ( ( METHOD_2 ( ) ) + STRING_1 ) ) ; } | private TYPE_1 METHOD_1 ( ) throws TYPE_2 { return new TYPE_1 ( ( ( METHOD_2 ( ) ) + STRING_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( double y , double VAR_1 , double min ) { return ( ( VAR_2 ) - ( INT_1 * ( VAR_3 ) ) ) - ( TYPE_1 . METHOD_2 ( y , VAR_1 , min ) ) ; } | public static int METHOD_1 ( double y , double VAR_1 , double min ) { return TYPE_1 . METHOD_1 ( y , VAR_1 , min ) ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 ) ; | void METHOD_1 ( ) ;
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( ) ; } catch ( TYPE_1 VAR_2 ) { throw new TYPE_2 ( STRING_1 , VAR_2 ) ; } return super . METHOD_1 ( ) ; } | public boolean METHOD_1 ( ) { return super . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { throw new TYPE_1 ( STRING_1 ) ; } | public void METHOD_1 ( int VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. synchronized void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_1 . METHOD_1 ( ) ; java.lang.System.out.println ( ( STRING_1 + ( VAR_1 . METHOD_2 ( ) . toString ( ) ) ) ) ; if ( ! ( VAR_1 . METHOD_3 ( ) ) ) ( VAR_2 ) ++ ; } | synchronized void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_1 . METHOD_1 ( ) ; if ( ! ( VAR_1 . METHOD_3 ( ) ) ) ( VAR_2 ) ++ ; }
|
The following code may contain bugs. Write a refined code without bugs. public final void METHOD_1 ( ) throws TYPE_1 { TYPE_2 . METHOD_2 ( 0 , INT_1 ) ; TYPE_2 . METHOD_3 ( ) ; TYPE_2 . METHOD_4 ( ) ; TYPE_3 . assertEquals ( "0" , TYPE_4 . METHOD_5 ( ) ) ; } | public final void METHOD_1 ( ) throws TYPE_1 { TYPE_2 . METHOD_2 ( 0 , INT_1 ) ; TYPE_2 . METHOD_3 ( ) ; TYPE_3 . assertEquals ( "0" , TYPE_4 . METHOD_5 ( ) ) ; }
|
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 = VAR_3 . METHOD_1 ( VAR_1 ) ; return new TYPE_1 < TYPE_2 > ( VAR_2 , VAR_4 ) ; } | public TYPE_1 < ? > METHOD_1 ( java.lang.String VAR_1 ) { TYPE_2 VAR_2 = VAR_3 . METHOD_1 ( VAR_1 ) ; return new TYPE_1 ( VAR_2 , VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { try { METHOD_2 ( false , view , VAR_1 ) ; TYPE_1 . METHOD_3 ( view , STRING_1 , VAR_2 ) . show ( ) ; } catch ( TYPE_2 VAR_3 ) { VAR_3 . METHOD_4 ( ) ; } } | public void METHOD_1 ( ) { try { METHOD_2 ( false , true , view , VAR_1 ) ; TYPE_1 . METHOD_3 ( view , STRING_1 , VAR_2 ) . show ( ) ; } catch ( TYPE_2 VAR_3 ) { VAR_3 . METHOD_4 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. TYPE_1 METHOD_1 ( java.lang.Long VAR_1 , java.lang.String [ ] VAR_2 , java.lang.String [ ] VAR_3 , boolean [ ] VAR_4 , boolean VAR_5 ) throws TYPE_2 , TYPE_3 { return METHOD_1 ( VAR_1 , VAR_2 , VAR_3 , VAR_4 , VAR_5 , false ) ; } | TYPE_1 METHOD_1 ( java.lang.Long VAR_1 , java.lang.String [ ] VAR_2 , java.lang.String [ ] VAR_3 , boolean [ ] VAR_4 , boolean VAR_5 ) throws TYPE_2 , TYPE_3 { return METHOD_1 ( VAR_1 , VAR_2 , VAR_3 , VAR_4 , VAR_5 , false , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String id ) { TYPE_1 VAR_1 = new TYPE_1 ( id , null ) ; this . VAR_2 . METHOD_2 ( VAR_1 ) ; } | public void METHOD_1 ( java.lang.String id ) { this . VAR_2 . METHOD_2 ( id ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { if ( ( VAR_1 . METHOD_2 ( ) ) == VAR_2 ) { return TYPE_3 . METHOD_1 ( VAR_1 . METHOD_3 ( ) ) ; } return - 1 ; } | public static double METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { if ( ( VAR_1 . METHOD_2 ( ) ) == VAR_2 ) { return TYPE_3 . METHOD_1 ( VAR_1 . METHOD_3 ( ) ) ; } return - 1.0 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void start ( TYPE_1 VAR_1 ) throws java.lang.Exception { METHOD_1 ( ) ; VAR_1 . METHOD_2 ( STRING_1 ) ; TYPE_2 VAR_2 = METHOD_3 ( ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; VAR_1 . show ( ) ; } | public void start ( TYPE_1 VAR_1 ) throws java.lang.Exception { VAR_1 . METHOD_2 ( STRING_1 ) ; TYPE_2 VAR_2 = METHOD_3 ( ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; VAR_1 . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int position ) { VAR_1 . METHOD_2 ( ) . METHOD_3 ( ( position - 1 ) , true ) ; VAR_1 . METHOD_2 ( ) . METHOD_4 ( ) ; } | public void METHOD_1 ( int position ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) . METHOD_3 ( ( position - 1 ) , true ) ; VAR_1 . METHOD_2 ( ) . METHOD_4 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { VAR_1 = VAR_2 . getString ( STRING_1 , VAR_3 ) . toUpperCase ( ) . replace ( STRING_2 , STRING_3 ) ; getActivity ( ) . METHOD_2 ( VAR_1 ) ; } | private void METHOD_1 ( ) { VAR_1 = VAR_2 . getString ( STRING_1 , VAR_3 ) ; getActivity ( ) . METHOD_2 ( VAR_1 . toUpperCase ( ) . replace ( STRING_2 , STRING_3 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String key ) { TYPE_1 data = new TYPE_2 ( ) . METHOD_2 ( getValue ( key ) ) . METHOD_3 ( ) ; return data ; } | public TYPE_1 METHOD_1 ( java.lang.String key ) { java.lang.String value = getValue ( key ) ; if ( value == null ) return null ; else { TYPE_1 data = new TYPE_2 ( ) . METHOD_2 ( value ) . METHOD_3 ( ) ; return data ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 = VAR_1 ; } | public void METHOD_1 ( android.view.View VAR_1 ) { METHOD_1 ( false , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 type ) { return type . equals ( type ) ; } | public boolean METHOD_1 ( TYPE_1 type ) { return this . type . equals ( type ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( null , VAR_2 ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( null , null , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { if ( ( VAR_1 ) > 0 ) return ( ( INT_1 - ( ( VAR_1 ) / INT_2 ) ) + STRING_1 ) + ( ( ( VAR_1 ) % INT_2 ) + 1 ) ; else return STRING_2 ; } | public java.lang.String METHOD_1 ( ) { if ( ( VAR_1 ) > 0 ) return ( ( ( ( VAR_1 ) % INT_2 ) + 1 ) + STRING_1 ) + ( INT_1 - ( ( VAR_1 ) / INT_2 ) ) ; else return STRING_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = ( ( float ) ( VAR_3 . METHOD_2 ( ) ) ) ; METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = ( ( float ) ( VAR_1 . METHOD_2 ( ) ) ) ; METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { switch ( VAR_1 . getId ( ) ) { case VAR_2 : TYPE_1 VAR_3 = new TYPE_1 ( this ) ; VAR_3 . METHOD_2 ( VAR_4 ) ; break ; default : break ; } } | public void METHOD_1 ( android.view.View VAR_1 ) { switch ( VAR_1 . getId ( ) ) { case VAR_2 : TYPE_1 VAR_3 = new TYPE_1 ( this ) ; VAR_3 . METHOD_2 ( VAR_4 ) ; default : break ; } }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; VAR_2 . METHOD_1 ( ) ; } | protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( java.lang.String VAR_1 ) { this . VAR_1 = VAR_1 ; this . VAR_2 = null ; } | 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. public TYPE_1 METHOD_1 ( java.lang.String name , java.lang.String VAR_1 ) { TYPE_1 VAR_2 = VAR_3 . METHOD_1 ( name , VAR_1 ) ; VAR_2 . METHOD_2 ( VAR_3 ) ; return VAR_2 ; } | public TYPE_1 METHOD_1 ( java.lang.String name , java.lang.String VAR_1 ) { TYPE_1 VAR_2 = VAR_3 . METHOD_1 ( name , VAR_1 ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 c ) { int VAR_1 = VAR_2 . METHOD_2 ( METHOD_3 ( ) ) ; this . VAR_3 [ VAR_1 ] . METHOD_1 ( c ) ; } | private void METHOD_1 ( TYPE_1 c ) { int VAR_1 = VAR_2 . METHOD_2 ( METHOD_3 ( ) ) ; this . VAR_3 . get ( VAR_1 ) . METHOD_1 ( c ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 , java.lang.String VAR_2 ) { if ( VAR_3 ) { try { METHOD_2 ( VAR_1 , VAR_2 ) ; VAR_3 = false ; } catch ( java.io.IOException VAR_4 ) { VAR_4 . METHOD_3 ( ) ; } } } | private void METHOD_1 ( TYPE_1 VAR_1 , java.lang.String VAR_2 ) { if ( VAR_3 ) { METHOD_2 ( VAR_1 , VAR_2 ) ; VAR_3 = false ; } }
|
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 ) ; METHOD_3 ( ) ; VAR_3 = new TYPE_2 ( METHOD_4 ( ) ) ; VAR_3 . METHOD_5 ( ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_2 ( VAR_2 ) ; METHOD_3 ( ) ; }
|
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_2 . METHOD_2 ( ) . compareTo ( VAR_1 . METHOD_2 ( ) ) ; } | public int METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { return VAR_1 . METHOD_2 ( ) . compareTo ( 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_2 = VAR_1 . METHOD_2 ( ) ; this . VAR_3 = VAR_1 . METHOD_3 ( ) ; this . VAR_4 = VAR_1 . METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_2 = VAR_1 . METHOD_2 ( ) ; this . VAR_3 = VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; VAR_1 . METHOD_1 ( new java.io.File ( STRING_1 ) ) ; } | public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { TYPE_1 VAR_1 = new TYPE_1 ( ) ; VAR_1 . METHOD_1 ( new java.io.File ( args [ 0 ] ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void init ( ) { super . init ( ) ; METHOD_1 ( ) ; METHOD_2 ( ) ; } | public void init ( ) { super . init ( ) ; METHOD_2 ( ) ; METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { return ( ( VAR_1 . METHOD_1 ( ) ) + ( VAR_2 . METHOD_1 ( ) ) ) + ( VAR_3 . METHOD_1 ( ) ) ; } | public int METHOD_1 ( ) { return ( VAR_1 . METHOD_1 ( ) ) + ( VAR_2 . METHOD_1 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { java.lang.String name = STRING_1 ; new TYPE_1 ( name ) ; } | public void METHOD_1 ( ) { new TYPE_1 ( STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . assertNotNull ( VAR_1 . METHOD_2 ( ) ) ; TYPE_1 . assertEquals ( VAR_1 . METHOD_2 ( ) . getName ( ) , VAR_2 ) ; } | public void METHOD_1 ( ) { TYPE_1 . assertNotNull ( VAR_1 . METHOD_2 ( ) ) ; TYPE_1 . assertEquals ( VAR_2 , VAR_1 . METHOD_2 ( ) . getName ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( ) { METHOD_2 ( TYPE_1 . min ( VAR_1 , VAR_2 ) , TYPE_1 . METHOD_3 ( VAR_3 , VAR_4 ) , this ) ; } | void METHOD_1 ( ) { METHOD_2 ( VAR_1 , VAR_3 , this ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.String message ) { METHOD_2 ( ( message + STRING_1 ) ) ; } | private void METHOD_1 ( java.lang.String message ) { METHOD_2 ( message , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( ( VAR_1 ) != null ) && ( ( VAR_2 ) != null ) ) { VAR_2 . METHOD_2 ( VAR_3 ) ; } else { super . METHOD_1 ( ) ; } } | public void METHOD_1 ( ) { if ( ( ( VAR_1 ) != null ) && ( ( VAR_2 ) != null ) ) { VAR_2 . METHOD_2 ( VAR_3 ) ; VAR_1 = null ; } else { super . METHOD_1 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 execute ( ) throws java.lang.Exception { TYPE_1 response = new TYPE_1 ( TYPE_2 . METHOD_1 ( ) ) ; TYPE_3 . METHOD_2 ( ) . METHOD_3 ( VAR_1 ) ; TYPE_4 . METHOD_2 ( ) . METHOD_4 ( VAR_1 ) ; return response ; } | protected TYPE_1 execute ( ) throws java.lang.Exception { TYPE_1 response = new TYPE_1 ( TYPE_2 . METHOD_1 ( ) ) ; TYPE_3 . METHOD_2 ( ) . METHOD_3 ( token ) ; TYPE_4 . METHOD_2 ( ) . METHOD_4 ( VAR_1 ) ; return response ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 VAR_1 = VAR_2 . METHOD_2 ( ) . METHOD_3 ( TYPE_2 . METHOD_4 ( STRING_1 , STRING_2 ) ) . METHOD_5 ( STRING_3 ) ; TYPE_3 VAR_3 = VAR_1 . METHOD_6 ( STRING_4 ) ; METHOD_7 ( VAR_3 ) ; } | public void METHOD_1 ( ) { TYPE_3 VAR_3 = VAR_2 . METHOD_2 ( ) . METHOD_3 ( TYPE_2 . METHOD_4 ( STRING_1 , STRING_2 ) ) . METHOD_5 ( STRING_3 ) . METHOD_6 ( STRING_4 ) ; METHOD_7 ( VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { METHOD_2 ( ) ; VAR_3 . METHOD_3 ( VAR_4 , VAR_5 , ( - 1 ) , null , VAR_1 , VAR_2 ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 ) { METHOD_2 ( ) ; VAR_3 . METHOD_3 ( VAR_4 , VAR_5 , ( - 1 ) , null , VAR_1 , VAR_2 ) ; METHOD_4 ( VAR_5 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String id , TYPE_1 VAR_1 ) { VAR_2 . put ( id , VAR_1 ) ; } | public void METHOD_1 ( java.lang.String id , TYPE_1 VAR_1 ) { if ( ( VAR_2 ) == null ) { VAR_2 = new java.util.HashMap < > ( ) ; } VAR_2 . put ( id , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. TYPE_1 METHOD_1 ( ) { this . VAR_1 = false ; return this ; } | TYPE_1 METHOD_1 ( ) { this . VAR_1 . set ( false ) ; return this ; }
|
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 ( ) ; } } | private void METHOD_1 ( ) { for ( java.lang.Object VAR_1 : VAR_2 ) { ( ( TYPE_1 ) ( VAR_1 ) ) . METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 , java.lang.String format , java.lang.Object ... VAR_2 ) { VAR_3 . METHOD_2 ( VAR_1 , TYPE_2 . METHOD_3 ( format , VAR_2 ) . METHOD_4 ( ) , null ) ; } | private void METHOD_1 ( TYPE_1 VAR_1 , java.lang.String format , java.lang.Object ... VAR_2 ) { VAR_3 . METHOD_2 ( VAR_1 , null , TYPE_2 . METHOD_3 ( format , VAR_2 ) . METHOD_4 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 n ) { VAR_1 = VAR_2 ; VAR_2 = n ; x = n . METHOD_2 ( ) ; y = n . METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 n ) { VAR_1 = VAR_2 ; VAR_2 = n ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Void VAR_1 ) { java.lang.String name = VAR_2 . METHOD_2 ( ) ; TYPE_1 . METHOD_3 ( VAR_3 . getContext ( ) , ( ( STRING_1 + name ) + STRING_2 ) , VAR_4 ) . show ( ) ; } | public void METHOD_1 ( java.lang.Void VAR_1 ) { java.lang.String name = VAR_2 . METHOD_2 ( ) ; TYPE_1 . METHOD_3 ( VAR_3 . getContext ( ) , ( name + STRING_2 ) , VAR_4 ) . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , int VAR_2 ) throws TYPE_3 { return METHOD_1 ( VAR_1 , VAR_2 , null ) ; } | public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , int VAR_2 ) { return METHOD_1 ( VAR_1 , VAR_2 , null ) ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.