input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. private int METHOD_1 ( TYPE_1 VAR_1 , int a , int b ) { if ( VAR_1 == ( VAR_2 ) ) { return TYPE_2 . METHOD_2 ( a , b ) ; } else { return TYPE_2 . min ( a , b ) ; } } | private double METHOD_1 ( TYPE_1 VAR_1 , double a , double b ) { if ( VAR_1 == ( VAR_2 ) ) { return TYPE_2 . METHOD_2 ( a , b ) ; } else { return TYPE_2 . min ( a , b ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ! ( VAR_1 ) ) return ; VAR_1 = false ; TYPE_1 . METHOD_2 ( VAR_2 , STRING_1 ) ; VAR_3 . METHOD_3 ( VAR_4 ) ; VAR_5 . METHOD_4 ( ) ; } | public void METHOD_1 ( ) { if ( ! ( VAR_1 ) ) return ; VAR_1 = false ; TYPE_1 . i ( VAR_2 , STRING_1 ) ; VAR_3 . METHOD_3 ( VAR_4 ) ; VAR_5 . METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { TYPE_3 VAR_2 = VAR_1 . target ( VAR_3 ) ; return VAR_2 . METHOD_2 ( VAR_4 ) ; } | protected TYPE_1 METHOD_1 ( ) { TYPE_3 VAR_2 = VAR_1 . target ( VAR_3 ) ; return VAR_2 . METHOD_2 ( VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.Set < TYPE_1 > METHOD_1 ( java.lang.String VAR_1 ) { return this . METHOD_2 ( VAR_1 ) . METHOD_1 ( ) ; } | public java.util.Set < TYPE_1 > METHOD_1 ( java.lang.String VAR_1 ) { return null ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String url , java.lang.String parameters ) throws java.io.IOException { this . VAR_1 = url ; this . method = VAR_2 ; return new TYPE_1 ( VAR_3 , url ) ; } | public TYPE_1 METHOD_1 ( java.lang.String url , java.lang.String parameters ) throws java.io.IOException { this . VAR_1 = url ; this . method = VAR_2 ; this . parameters = parameters ; return new TYPE_1 ( VAR_3 , url ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return TYPE_2 . METHOD_1 ( TYPE_3 . METHOD_2 ( VAR_1 ) , true , true ) ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return METHOD_1 ( TYPE_3 . METHOD_2 ( VAR_1 ) , true , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String path , long value ) { this . VAR_1 . set ( path , java.lang.String . METHOD_2 ( value ) ) ; if ( TYPE_1 . getBoolean ( STRING_1 ) ) { METHOD_3 ( ) ; } } | public void METHOD_1 ( java.lang.String path , long value ) { this . VAR_1 . set ( path , value ) ; if ( TYPE_1 . getBoolean ( STRING_1 ) ) { METHOD_3 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 VAR_2 = new TYPE_1 ( VAR_3 , id , VAR_4 ) ; return VAR_2 ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 VAR_2 = new TYPE_1 ( VAR_3 , id , VAR_1 ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( android.content.Intent intent , int VAR_1 , int VAR_2 ) { if ( intent == null ) { TYPE_1 . i ( VAR_3 , STRING_1 ) ; METHOD_2 ( true ) ; } return VAR_4 ; } | public int METHOD_1 ( android.content.Intent intent , int VAR_1 , int VAR_2 ) { if ( intent == null ) { TYPE_1 . i ( VAR_3 , STRING_1 ) ; METHOD_2 ( ) ; } return VAR_4 ; }
|
The following code may contain bugs. Write a refined code without bugs. public int getId ( ) { return - INT_1 ; } | public int getId ( ) { return id ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( VAR_1 . length ( ) ) > 0 ) { VAR_1 = VAR_1 . substring ( 0 , ( ( VAR_1 . length ( ) ) - 1 ) ) ; } } | public void METHOD_1 ( ) { if ( ( text . length ( ) ) > 0 ) { text = text . substring ( 0 , ( ( text . length ( ) ) - 1 ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static void main ( java.lang.String [ ] args ) { TYPE_1 c = new TYPE_1 ( ) ; while ( true ) { c . METHOD_1 ( ) ; c . METHOD_2 ( ) ; } } | public static void main ( java.lang.String [ ] args ) { while ( true ) { TYPE_1 c = new TYPE_1 ( ) ; c . METHOD_1 ( ) ; c . METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Class target , TYPE_1 < android.view.View , java.lang.String > [ ] VAR_1 , java.util.Map < java.lang.String , java.lang.Object > data , boolean VAR_2 ) { METHOD_1 ( VAR_3 , target , null , null , VAR_2 ) ; } | public void METHOD_1 ( java.lang.Class target , TYPE_1 < android.view.View , java.lang.String > [ ] VAR_1 , java.util.Map < java.lang.String , java.lang.Object > data , boolean VAR_2 ) { METHOD_1 ( VAR_3 , target , VAR_1 , data , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( ( METHOD_2 ( ) ) != null ) { METHOD_2 ( ) . METHOD_3 ( ) ; } super . METHOD_1 ( ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( ( METHOD_2 ( ) ) != null ) { METHOD_2 ( ) . METHOD_3 ( ) ; } METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( TYPE_1 VAR_1 ) throws TYPE_2 { return TYPE_3 . METHOD_2 ( VAR_1 , VAR_2 . METHOD_3 ( ) ) ; } | public int METHOD_1 ( TYPE_1 VAR_1 ) throws TYPE_2 { return 0 ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 , boolean VAR_3 ) { if ( METHOD_2 ( ) ) { VAR_1 . METHOD_3 ( VAR_4 , VAR_3 ) ; VAR_2 . METHOD_3 ( VAR_5 , VAR_3 ) ; } } | private void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 , boolean VAR_3 ) { if ( METHOD_2 ( ) ) { if ( VAR_1 != null ) { VAR_1 . METHOD_3 ( VAR_4 , VAR_3 ) ; } VAR_2 . METHOD_3 ( VAR_5 , VAR_3 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View view ) { if ( ( VAR_1 ) == ( VAR_2 ) ) { VAR_1 = VAR_3 ; VAR_4 . METHOD_2 ( VAR_5 , VAR_6 , this ) ; METHOD_3 ( ) ; } } | public void METHOD_1 ( android.view.View view ) { if ( ( VAR_1 ) == ( VAR_2 ) ) { VAR_1 = VAR_3 ; METHOD_3 ( ) ; VAR_4 . METHOD_2 ( VAR_5 , VAR_6 , this ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_1 ( VAR_2 , VAR_3 . METHOD_2 ( ) ) ; } | public boolean METHOD_1 ( ) { return VAR_1 . METHOD_1 ( VAR_2 , VAR_3 . METHOD_2 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String METHOD_1 ( ) { if ( ( ( VAR_1 ) != null ) && ( ( VAR_1 . METHOD_2 ( VAR_2 ) ) != null ) ) { return VAR_1 . METHOD_2 ( VAR_2 ) ; } else { return STRING_1 ; } } | public static java.lang.String METHOD_1 ( ) { return ( ( VAR_1 ) != null ) && ( ( VAR_1 . METHOD_2 ( VAR_2 ) ) != null ) ? VAR_1 . METHOD_2 ( VAR_2 ) : STRING_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) throws java.lang.Exception { return VAR_1 ; } | public java.lang.String execute ( ) throws java.lang.Exception { return VAR_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 , boolean VAR_3 ) { VAR_4 = VAR_1 ; VAR_5 = VAR_2 ; this . VAR_6 . METHOD_2 ( VAR_7 ) ; METHOD_3 ( VAR_3 ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , boolean VAR_3 ) { VAR_4 = VAR_1 ; VAR_5 = VAR_2 ; VAR_6 . METHOD_2 ( VAR_7 ) ; METHOD_3 ( VAR_3 ) ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 = TYPE_1 . METHOD_2 ( new TYPE_2 ( TYPE_1 . METHOD_3 ( VAR_2 class ) ) ) ; TYPE_1 . METHOD_4 ( VAR_3 ) . METHOD_5 ( VAR_1 ) . METHOD_6 ( ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { VAR_1 = METHOD_2 ( new TYPE_2 ( METHOD_3 ( VAR_2 class ) ) ) ; METHOD_4 ( VAR_3 ) . METHOD_5 ( VAR_1 ) . METHOD_6 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) throws TYPE_2 , TYPE_3 , TYPE_4 { return TYPE_5 . METHOD_2 ( METHOD_3 ( ) , this . VAR_1 , this . VAR_2 , this . VAR_3 , this . VAR_4 ) ; } | private TYPE_1 METHOD_1 ( ) throws TYPE_2 , TYPE_3 , TYPE_4 { return TYPE_5 . METHOD_2 ( METHOD_3 ( false ) , this . VAR_1 , this . VAR_2 , this . VAR_3 , this . VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; for ( TYPE_2 VAR_1 : VAR_2 ) { VAR_1 . METHOD_1 ( ) ; } for ( TYPE_2 VAR_1 : VAR_3 ) { VAR_1 . METHOD_1 ( ) ; } } | private void METHOD_1 ( ) { for ( TYPE_2 VAR_1 : VAR_2 ) { VAR_1 . METHOD_1 ( ) ; } for ( TYPE_2 VAR_1 : VAR_3 ) { VAR_1 . METHOD_1 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) throws TYPE_1 { java.lang.System.out.println ( STRING_1 ) ; METHOD_2 ( ) ; VAR_1 = new TYPE_2 ( ) ; VAR_2 = new TYPE_3 ( ) ; VAR_2 . METHOD_3 ( VAR_3 ) ; java.lang.System.out.println ( VAR_1 ) ; } | private void METHOD_1 ( ) throws TYPE_1 { java.lang.System.out.println ( STRING_1 ) ; METHOD_2 ( ) ; VAR_1 = new TYPE_2 ( ) ; java.lang.System.out.println ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( double VAR_1 , double VAR_2 ) { VAR_1 *= INT_1 ; VAR_2 *= VAR_1 ; VAR_3 . METHOD_2 ( VAR_1 , VAR_2 ) ; } | public void METHOD_1 ( double VAR_1 , double VAR_2 ) { VAR_3 . METHOD_2 ( ( VAR_1 * INT_1 ) , ( VAR_2 * ( java.lang.Math.abs ( VAR_1 ) ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; VAR_1 = TYPE_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( new TYPE_2 ( ) { public void METHOD_4 ( ) { METHOD_5 ( ) ; } } ) ; } | protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; VAR_1 = TYPE_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( this , new TYPE_2 ( ) { public void METHOD_4 ( ) { METHOD_5 ( ) ; } } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { this . VAR_1 . METHOD_2 ( STRING_1 ) ; } | private void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { java.lang.String VAR_2 = TYPE_3 . METHOD_2 ( VAR_1 . getName ( ) ) ; return VAR_3 . METHOD_3 ( VAR_2 ) ? VAR_3 . get ( VAR_2 ) : VAR_4 ; } | private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) { java.lang.String VAR_2 = TYPE_3 . METHOD_2 ( VAR_1 . getName ( ) . toLowerCase ( ) ) ; return VAR_3 . METHOD_3 ( VAR_2 ) ? VAR_3 . get ( VAR_2 ) : VAR_4 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( long VAR_1 , java.lang.String name ) { return VAR_2 . METHOD_1 ( VAR_1 , name ) ; } | public TYPE_1 METHOD_1 ( java.lang.Integer VAR_1 , java.lang.String name ) { return VAR_2 . METHOD_1 ( VAR_1 , name ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 [ ( ( VAR_3 ) ++ ) ] = VAR_1 ; return true ; } | public static boolean METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 [ VAR_3 ] = VAR_1 ; ( VAR_3 ) ++ ; return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( false ) ; TYPE_1 . METHOD_3 ( this ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_3 ( this ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.Void VAR_1 ) { try { new TYPE_1 ( ) . execute ( TYPE_2 . METHOD_2 ( VAR_2 ) ) ; } catch ( TYPE_3 VAR_3 ) { VAR_3 . METHOD_3 ( ) ; } } | protected void METHOD_1 ( java.lang.Void VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) { java.lang.System.out.println ( STRING_1 ) ; VAR_1 . remove ( ) ; } | public static void METHOD_1 ( ) { VAR_1 . remove ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { TYPE_2 VAR_2 = VAR_3 . METHOD_2 ( VAR_1 ) ; VAR_4 . METHOD_3 ( VAR_2 ) ; } | public void METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { TYPE_2 message = VAR_3 . METHOD_2 ( VAR_1 ) ; VAR_4 . METHOD_3 ( message ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String path , java.lang.String VAR_1 ) throws java.io.IOException { METHOD_2 ( path , STRING_1 , null , null , VAR_1 ) ; } | public void METHOD_1 ( java.lang.String path , java.lang.String VAR_1 ) throws java.io.IOException { METHOD_2 ( path , STRING_1 , null , null , VAR_1 , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public synchronized boolean METHOD_1 ( ) { return ( VAR_1 ) && ( ( VAR_2 . METHOD_2 ( ) ) == 0 ) ; } | public synchronized boolean METHOD_1 ( ) { return ( VAR_1 ) && ( ( VAR_2 . size ( ) ) == 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , int id ) { VAR_1 . METHOD_2 ( ) ; VAR_2 . METHOD_3 ( VAR_3 , false ) . commit ( ) ; VAR_2 . METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , int id ) { VAR_1 . METHOD_2 ( ) ; VAR_2 . METHOD_3 ( VAR_3 , false ) . commit ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { try { TYPE_2 . METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; } catch ( java.lang.Exception VAR_2 ) { } } | public void METHOD_1 ( TYPE_1 VAR_1 ) { try { TYPE_2 . METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; java.lang.System.exit ( 0 ) ; } catch ( java.lang.Exception VAR_2 ) { } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws TYPE_1 , TYPE_2 , TYPE_3 { this . METHOD_2 ( ) ; this . METHOD_3 ( ) ; this . METHOD_4 ( ) ; this . METHOD_5 ( ) ; this . METHOD_6 ( ) ; } | public void METHOD_1 ( ) throws TYPE_1 , TYPE_2 , TYPE_3 { this . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public synchronized < TYPE_1 > void METHOD_1 ( java.lang.Class < TYPE_1 > VAR_1 , TYPE_1 VAR_2 ) { VAR_3 . put ( VAR_1 . METHOD_2 ( ) , VAR_2 ) ; } | public synchronized < TYPE_1 > void METHOD_1 ( TYPE_1 VAR_2 ) { VAR_3 . put ( VAR_2 . getClass ( ) , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( TYPE_1 date ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; return ( ( ( TYPE_1 . METHOD_3 ( VAR_1 ) ) + ( TYPE_1 . METHOD_4 ( VAR_1 , VAR_2 ) ) ) + ( VAR_3 ) ) + INT_1 ; } | public static int METHOD_1 ( TYPE_1 date ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; return ( ( TYPE_1 . METHOD_3 ( VAR_1 ) ) + ( TYPE_1 . METHOD_4 ( VAR_2 , VAR_1 ) ) ) + ( VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. boolean getBoolean ( java.lang.String key , boolean VAR_1 ) { return VAR_2 . METHOD_1 ( key ) ? java.lang.Boolean . METHOD_2 ( VAR_2 . get ( key ) ) : VAR_1 ; } | java.lang.String getString ( java.lang.String key , java.lang.String VAR_1 ) { return VAR_2 . METHOD_1 ( key ) ? VAR_2 . get ( key ) : VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 , STRING_1 ) ; try { TYPE_1 . METHOD_2 ( VAR_1 , STRING_2 ) ; VAR_2 = TYPE_2 . METHOD_3 ( ) ; } catch ( java.lang.Exception VAR_3 ) { } } | public void METHOD_1 ( ) { try { VAR_2 = TYPE_2 . METHOD_3 ( ) ; } catch ( java.lang.Exception VAR_3 ) { } }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.System.out.println ( STRING_1 ) ; TYPE_2 . METHOD_2 ( TYPE_1 ) ; TYPE_2 . METHOD_3 ( TYPE_1 ) ; TYPE_2 . METHOD_4 ( TYPE_1 ) ; TYPE_2 . METHOD_5 ( TYPE_1 ) ; } | public static void METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.System.out.println ( STRING_1 ) ; TYPE_2 . METHOD_2 ( VAR_1 ) ; TYPE_2 . METHOD_3 ( VAR_1 ) ; TYPE_2 . METHOD_4 ( VAR_1 ) ; TYPE_2 . METHOD_5 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void end ( ) { VAR_1 . set ( 0 ) ; } | protected void end ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 result ) { VAR_2 . METHOD_2 ( VAR_1 , result ) ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 result ) { return VAR_2 . METHOD_2 ( VAR_1 , result ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public native int METHOD_1 ( ) ; | private static native int METHOD_1 ( ) ;
|
The following code may contain bugs. Write a refined code without bugs. public static < TYPE_1 > TYPE_2 METHOD_1 ( TYPE_1 VAR_1 ) { return new TYPE_2 ( VAR_1 ) ; } | public static < TYPE_1 > TYPE_2 < TYPE_1 > METHOD_1 ( TYPE_1 VAR_1 ) { return new TYPE_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { TYPE_1 . setValue ( true ) ; TYPE_2 . setValue ( true ) ; } | protected void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { METHOD_2 ( STRING_1 ) ; } | protected void METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.Class < ? extends TYPE_1 > VAR_1 ) { try { return TYPE_2 . METHOD_2 ( this . METHOD_3 ( ) , VAR_1 ) ; } catch ( java.lang.Exception VAR_2 ) { throw new TYPE_3 ( VAR_2 ) ; } } | public < TYPE_1 > TYPE_1 METHOD_1 ( java.lang.Class < ? extends TYPE_1 > VAR_1 ) { try { return TYPE_2 . METHOD_2 ( this . METHOD_3 ( ) , VAR_1 ) ; } catch ( java.lang.Exception VAR_2 ) { throw new TYPE_3 ( VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Integer ... VAR_1 ) { VAR_2 . METHOD_2 ( java.util.Arrays.asList ( VAR_1 ) ) ; } | public void METHOD_1 ( java.lang.Integer ... VAR_1 ) { METHOD_1 ( java.util.Arrays.asList ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String msg ) { TYPE_1 . i ( VAR_1 , ( ( STRING_1 + msg ) + STRING_2 ) ) ; VAR_2 . setText ( ( ( ( VAR_2 . getText ( ) ) + "\n" ) + msg ) ) ; } | public void METHOD_1 ( java.lang.String msg ) { VAR_2 . append ( ( "\n" + msg ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( int position ) { int VAR_1 = ( position - 1 ) % ( count ) ; if ( VAR_1 < 0 ) VAR_1 += count ; return VAR_1 ; } | public int METHOD_1 ( int position ) { if ( ( count ) == 0 ) return - 1 ; int VAR_1 = ( position - 1 ) % ( count ) ; if ( VAR_1 < 0 ) VAR_1 += count ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . setText ( STRING_1 ) ; METHOD_2 ( VAR_1 ) ; METHOD_3 ( VAR_2 ) ; } | public void METHOD_1 ( ) { TYPE_1 . setText ( STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( final java.util.Collection < ? > VAR_1 ) { TYPE_1 . METHOD_2 ( VAR_1 ) ; for ( final java.lang.Object t : VAR_1 ) { if ( ! ( contains ( t ) ) ) { return false ; } } return true ; } | public boolean METHOD_1 ( final java.util.Collection < ? > VAR_1 ) { for ( final java.lang.Object t : VAR_1 ) { if ( ! ( contains ( t ) ) ) { return false ; } } return true ; }
|
The following code may contain bugs. Write a refined code without bugs. private static final java.lang.String METHOD_1 ( final TYPE_1 VAR_1 , final java.lang.String VAR_2 ) { TYPE_2 value = VAR_1 . METHOD_2 ( VAR_2 ) ; return value != null ? value . getValue ( ) . toString ( ) : null ; } | protected java.lang.String METHOD_1 ( final TYPE_1 VAR_1 , final java.lang.String VAR_2 ) { TYPE_2 value = VAR_1 . METHOD_2 ( VAR_2 ) ; return value != null ? value . getValue ( ) . toString ( ) : null ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = VAR_1 ; METHOD_2 ( true ) ; if ( ( VAR_3 ) >= ( VAR_4 ) ) super . METHOD_1 ( VAR_2 ) ; else super . METHOD_3 ( VAR_2 ) ; } | public void METHOD_3 ( TYPE_1 VAR_1 ) { VAR_2 = VAR_1 ; METHOD_2 ( true ) ; if ( ( VAR_3 ) >= ( VAR_4 ) ) super . METHOD_1 ( VAR_2 ) ; else super . METHOD_3 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { VAR_2 &= INT_1 ^ ( INT_2 < < INT_3 ) ; VAR_2 |= ( VAR_1 & INT_2 ) < < INT_3 ; VAR_3 = VAR_1 & INT_2 ; METHOD_2 ( VAR_4 , VAR_2 ) ; target . METHOD_3 ( ) ; } | public void METHOD_1 ( int VAR_1 ) { VAR_3 = VAR_1 & INT_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { TYPE_3 . METHOD_2 ( STRING_1 ) ; VAR_3 . METHOD_3 ( VAR_4 . get ( VAR_2 . getId ( ) ) ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 ) { VAR_3 . METHOD_3 ( VAR_4 . get ( VAR_2 . getId ( ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { while ( ( VAR_1 ) < ( VAR_2 ) ) { ( VAR_1 ) ++ ; VAR_3 = METHOD_2 ( ) ; } return VAR_3 ; } | public TYPE_1 METHOD_1 ( ) { VAR_1 = 0 ; while ( ( VAR_1 ) < ( VAR_2 ) ) { ( VAR_1 ) ++ ; VAR_3 = METHOD_2 ( ) ; } return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( int i ) { if ( i < ( VAR_1 . length ) ) { return VAR_1 [ i ] ; } return null ; } | public TYPE_1 METHOD_1 ( int i ) { if ( i < ( VAR_1 . length ) ) { return VAR_1 [ ( i - 1 ) ] ; } return null ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) throws java.lang.Exception { VAR_1 . METHOD_2 ( ) ; } | public static void METHOD_1 ( ) throws java.lang.Exception { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. protected void execute ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_1 ( VAR_1 ) ; VAR_1 . METHOD_2 ( VAR_2 , VAR_3 , new TYPE_3 ( ) ) ; } | protected void execute ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { if ( ( VAR_1 . METHOD_2 ( ) ) > 0 ) { METHOD_3 ( ) ; } } | public void METHOD_1 ( TYPE_1 event ) { METHOD_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 ( this , STRING_1 , VAR_2 ) . show ( ) ; METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( this , STRING_1 , VAR_2 ) . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( TYPE_1 VAR_1 ) { this . METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; super . METHOD_1 ( VAR_1 ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( ) ; super . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( int i ) { return METHOD_1 ( i , this . VAR_1 ) ; } | public TYPE_1 METHOD_1 ( int i ) { return METHOD_1 ( i , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.List < TYPE_1 > VAR_1 ) { this . VAR_1 . METHOD_2 ( VAR_1 ) ; METHOD_3 ( ) ; } | public void METHOD_1 ( java.util.List < TYPE_1 > 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 id ) { METHOD_2 ( id ) ; return VAR_1 . METHOD_3 ( id ) ; } | public TYPE_1 METHOD_1 ( java.lang.String id ) { METHOD_2 ( id ) ; return VAR_1 . METHOD_3 ( id ) . get ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 = new TYPE_1 ( 1 , STRING_1 ) ; assertEquals ( STRING_1 , VAR_1 . METHOD_2 ( ) ) ; } | public void METHOD_1 ( ) { assertEquals ( STRING_1 , VAR_1 . METHOD_2 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( ) { android.content.Intent intent = new android.content.Intent ( VAR_1 , VAR_2 class ) ; intent . METHOD_2 ( VAR_3 ) ; TYPE_1 VAR_4 = TYPE_1 . METHOD_3 ( VAR_1 , 0 , intent , VAR_5 ) ; return VAR_4 ; } | private TYPE_1 METHOD_1 ( ) { android.content.Intent intent = new android.content.Intent ( VAR_1 , VAR_2 class ) ; intent . METHOD_2 ( VAR_3 ) ; return TYPE_1 . METHOD_3 ( VAR_1 , 0 , intent , VAR_5 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.util.ArrayList < TYPE_1 > result ) { VAR_1 = result ; VAR_2 = false ; VAR_3 . METHOD_2 ( false ) ; if ( ( VAR_1 ) != null ) { VAR_4 . METHOD_3 ( VAR_1 ) ; VAR_4 . METHOD_4 ( ) ; } } | protected void METHOD_1 ( java.util.ArrayList < TYPE_1 > result ) { VAR_2 = false ; VAR_3 . METHOD_2 ( false ) ; if ( result != null ) { VAR_1 = result ; VAR_4 . METHOD_3 ( VAR_1 ) ; VAR_4 . METHOD_4 ( ) ; } }
|
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 ( VAR_1 ) ; } | public void METHOD_1 ( java.util.List < java.lang.String > list ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( list ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; METHOD_2 ( ) ; if ( VAR_1 ) { METHOD_3 ( ) ; } } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.util.List < TYPE_1 > METHOD_1 ( ) { int size = METHOD_2 ( ) . size ( ) ; if ( size > INT_1 ) { return METHOD_3 ( ) . METHOD_4 ( 0 , INT_1 ) ; } else { return METHOD_3 ( ) ; } } | private java.util.List < TYPE_1 > METHOD_1 ( ) { int size = METHOD_2 ( ) . size ( ) ; if ( size > INT_1 ) { return METHOD_2 ( ) . METHOD_4 ( 0 , INT_1 ) ; } else { return METHOD_2 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static byte METHOD_1 ( byte b , int VAR_1 ) { b &= ( ( byte ) ( ~ ( 1 < < VAR_1 ) ) ) ; return b ; } | private static byte METHOD_1 ( byte b , int VAR_1 ) { b &= ( ( byte ) ( ~ ( 1 < < VAR_1 ) ) ) ; return b ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.util.List < TYPE_1 > METHOD_1 ( ) { return TYPE_2 . select ( ) . METHOD_2 ( VAR_1 class ) . METHOD_3 ( ) ; } | public java.util.List < TYPE_1 > METHOD_1 ( ) { return TYPE_2 . select ( ) . METHOD_2 ( VAR_1 class ) . METHOD_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 . get ( VAR_1 ) ; } | public java.util.List < java.lang.Integer > METHOD_1 ( int VAR_1 ) { return VAR_2 . get ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( boolean VAR_1 ) { if ( ! ( VAR_2 ) ) { VAR_3 . METHOD_1 ( VAR_1 ) ; TYPE_1 . METHOD_2 ( VAR_4 , STRING_1 ) ; VAR_2 = true ; } } | public void METHOD_1 ( boolean VAR_1 ) { if ( ! ( VAR_2 ) ) { VAR_3 . METHOD_1 ( true , VAR_1 ) ; TYPE_1 . METHOD_2 ( VAR_4 , STRING_1 ) ; VAR_2 = true ; } }
|
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_1 , STRING_1 ) ; this . VAR_1 = VAR_1 ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_1 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final double [ ] VAR_1 , final double [ ] VAR_2 , double VAR_3 , double VAR_4 ) { METHOD_2 ( VAR_3 , VAR_4 , VAR_5 ) ; METHOD_3 ( VAR_1 ) ; METHOD_4 ( VAR_2 ) ; } | public void METHOD_1 ( final double [ ] VAR_1 , final double [ ] VAR_2 , double VAR_3 , double VAR_4 ) { METHOD_2 ( VAR_3 , VAR_4 , VAR_5 ) ; METHOD_3 ( VAR_1 ) ; METHOD_4 ( VAR_2 ) ; METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 event ) { VAR_1 . METHOD_2 ( TYPE_2 . METHOD_3 ( ) ) ; METHOD_4 ( event ) ; } | public void METHOD_1 ( TYPE_1 event ) { VAR_1 . METHOD_2 ( event ) ; METHOD_4 ( event ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; ( ( TYPE_1 ) ( getActivity ( ) ) ) . METHOD_2 ( false ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public synchronized void METHOD_1 ( int VAR_1 ) { this . VAR_2 = VAR_1 ; } | public synchronized void METHOD_1 ( int VAR_1 ) { this . VAR_1 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 TYPE_2 , TYPE_3 VAR_1 ) { TYPE_4 VAR_2 = VAR_1 . METHOD_2 ( ) ; METHOD_3 ( VAR_2 ) ; this . state = null ; this . VAR_3 . METHOD_4 ( this . VAR_4 ) ; } | public void METHOD_1 ( TYPE_1 TYPE_2 , TYPE_3 VAR_1 ) { TYPE_4 VAR_2 = VAR_1 . METHOD_2 ( ) ; METHOD_3 ( VAR_2 ) ; this . VAR_3 . METHOD_4 ( this . VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private static void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) ; if ( ( VAR_1 . get ( ) ) == 0 ) { VAR_2 . METHOD_3 ( ) ; VAR_2 = null ; } } | private static void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) == 0 ) { VAR_2 . METHOD_3 ( ) ; VAR_2 = null ; } }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 ) { if ( ! ( VAR_2 . contains ( VAR_1 ) ) ) { VAR_2 . add ( VAR_1 ) ; return true ; } else return false ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 ) { if ( ! ( VAR_2 . contains ( VAR_1 ) ) ) { VAR_2 . add ( VAR_1 ) ; return true ; } return false ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Integer METHOD_1 ( ) { return VAR_1 . size ( ) ; } | public java.lang.Integer METHOD_1 ( ) { if ( ( VAR_1 ) == null ) { return 0 ; } return VAR_1 . size ( ) ; }
|
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 ) ; VAR_2 . METHOD_3 ( true ) ; VAR_3 . METHOD_4 ( VAR_4 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . METHOD_2 ( VAR_1 ) ; VAR_2 . METHOD_3 ( true ) ; VAR_3 . METHOD_4 ( VAR_4 ) ; VAR_1 . METHOD_4 ( VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 = new TYPE_1 ( new TYPE_2 ( ) , new TYPE_3 ( ) , new TYPE_4 ( ) , new TYPE_5 ( ) , new TYPE_6 ( ) ) ; } | public void METHOD_1 ( ) { VAR_1 = new TYPE_1 ( new TYPE_2 ( ) , new TYPE_3 ( ) , new TYPE_5 ( ) , new TYPE_6 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.List < TYPE_1 > data ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( data ) ; } else { VAR_1 = data ; } METHOD_4 ( ) ; } | public void METHOD_1 ( java.util.List < TYPE_1 > data ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( data ) ; } METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( final java.lang.String filePath , final int value ) { return TYPE_1 . METHOD_2 ( filePath , ( STRING_1 + value ) ) ; } | public static boolean METHOD_1 ( final java.lang.String filePath , final int value ) { return TYPE_1 . METHOD_2 ( filePath , new java.lang.StringBuilder ( ) . append ( value ) . toString ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public final void METHOD_1 ( final int c ) throws java.io.IOException { try { this . VAR_1 . METHOD_1 ( c ) ; } finally { this . VAR_2 . append ( c ) ; } } | public final void METHOD_1 ( final int c ) throws java.io.IOException { try { this . VAR_1 . METHOD_1 ( c ) ; } finally { this . VAR_2 . append ( ( ( char ) ( c ) ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void put ( long key , int VAR_1 ) { long VAR_2 = put ( VAR_3 , key , VAR_1 ) ; METHOD_1 ( VAR_2 ) ; VAR_4 = true ; VAR_5 . put ( VAR_3 , 1 ) ; } | public void put ( long key , int VAR_1 ) { VAR_3 = put ( VAR_3 , key , VAR_1 ) ; VAR_4 = true ; VAR_5 . put ( VAR_3 , 1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { if ( ( VAR_1 ) == null ) { VAR_1 = TYPE_2 . function ( this ) ; } return VAR_1 ; } | public TYPE_1 METHOD_1 ( ) { TYPE_1 result = VAR_1 ; if ( result == null ) { result = TYPE_2 . function ( this ) ; VAR_1 = result ; } return result ; }
|
The following code may contain bugs. Write a refined code without bugs. public static boolean METHOD_1 ( TYPE_1 VAR_1 ) { boolean VAR_2 = false ; try { VAR_2 = TYPE_2 . METHOD_2 ( ) . METHOD_3 ( VAR_3 ) ; } catch ( final TYPE_3 VAR_4 ) { TYPE_2 . METHOD_4 ( VAR_4 ) ; } return VAR_2 ; } | public static boolean METHOD_1 ( TYPE_1 VAR_1 ) { return false ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.String VAR_1 , int VAR_2 ) { VAR_3 = VAR_1 ; VAR_4 = VAR_2 ; VAR_5 = 0 ; if ( ( VAR_4 ) >= INT_1 ) VAR_6 = INT_1 ; else VAR_6 = VAR_4 ; VAR_7 = false ; VAR_8 = false ; } | private void METHOD_1 ( java.lang.String VAR_1 , int VAR_2 ) { VAR_3 = VAR_1 ; VAR_4 = VAR_2 ; VAR_5 = 0 ; VAR_7 = false ; VAR_8 = false ; if ( ( VAR_4 ) >= INT_1 ) VAR_6 = INT_1 ; else VAR_6 = VAR_4 ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , TYPE_1 data ) { if ( ! ( VAR_1 . equals ( STRING_1 ) ) ) return false ; return METHOD_2 ( VAR_2 . split ( "\n" ) , INT_1 , data ) ; } | public boolean METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 , TYPE_1 data ) { return METHOD_2 ( VAR_2 . split ( "\n" ) , INT_1 , data ) ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.