input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( ) ; } finally { this . state = VAR_2 ; this . VAR_1 = null ; this . VAR_3 = null ; } } | public void METHOD_1 ( ) { if ( ( VAR_1 ) != null ) { try { VAR_1 . METHOD_2 ( ) ; } finally { this . state = VAR_2 ; this . VAR_1 = null ; this . VAR_3 = null ; } } }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Void METHOD_1 ( TYPE_1 node , java.lang.Void p ) { METHOD_2 ( node . METHOD_3 ( ) , node . METHOD_4 ( ) , STRING_1 ) ; return super . METHOD_1 ( node , p ) ; } | public java.lang.Void METHOD_1 ( TYPE_1 node , java.lang.Void p ) { METHOD_2 ( node . METHOD_3 ( ) , node , STRING_1 ) ; return super . METHOD_1 ( node , p ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.lang.String METHOD_1 ( java.lang.String name ) { return name . replaceAll ( STRING_1 , STRING_2 ) ; } | private java.lang.String METHOD_1 ( java.lang.String name ) { name = name . replaceAll ( STRING_1 , STRING_2 ) ; return name ; }
|
The following code may contain bugs. Write a refined code without bugs. private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , TYPE_3 ... VAR_2 ) { if ( ( VAR_3 ) == null ) { METHOD_2 ( VAR_1 , VAR_2 ) ; } return VAR_3 ; } | private TYPE_1 METHOD_1 ( TYPE_2 VAR_1 , TYPE_3 ... VAR_2 ) { METHOD_2 ( VAR_1 , VAR_2 ) ; return VAR_3 ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( java.lang.Object VAR_1 , java.lang.Object VAR_2 ) { return ( ( ( TYPE_1 ) ( VAR_1 ) ) . METHOD_2 ( ) ) < ( ( ( TYPE_1 ) ( VAR_2 ) ) . METHOD_2 ( ) ) ; } | protected boolean METHOD_1 ( java.lang.Object VAR_1 , java.lang.Object VAR_2 ) { return ( ( ( TYPE_1 ) ( VAR_1 ) ) . METHOD_2 ( ) ) < ( ( ( TYPE_1 ) ( VAR_2 ) ) . METHOD_2 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public synchronized void METHOD_1 ( ) { this . VAR_1 = false ; try { this . VAR_2 . METHOD_2 ( ) ; } catch ( java.io.IOException VAR_3 ) { throw new TYPE_1 ( STRING_1 , VAR_3 ) ; } } | public synchronized void METHOD_1 ( ) { if ( this . VAR_1 ) { try { this . VAR_2 . METHOD_2 ( ) ; } catch ( java.io.IOException VAR_3 ) { throw new TYPE_1 ( STRING_1 , VAR_3 ) ; } } this . VAR_1 = false ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { METHOD_2 ( ) ; METHOD_3 ( ) ; METHOD_4 ( ) ; if ( VAR_1 ) { METHOD_5 ( ) ; } else { METHOD_6 ( ) ; } } | public void METHOD_1 ( ) { METHOD_2 ( ) ; METHOD_3 ( ) ; while ( true ) { METHOD_4 ( ) ; if ( VAR_1 ) { METHOD_5 ( ) ; } else { METHOD_6 ( ) ; } } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 , TYPE_2 context ) { TYPE_3 VAR_3 = new TYPE_3 ( ) ; VAR_3 . METHOD_1 ( VAR_1 , VAR_2 , context ) ; } | protected void METHOD_1 ( TYPE_1 VAR_1 , TYPE_1 VAR_2 , TYPE_2 context ) { TYPE_3 VAR_3 = new TYPE_3 ( ) ; VAR_3 . METHOD_1 ( VAR_1 , VAR_2 , context ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { return VAR_1 . get ( ) ; } | public java.lang.String METHOD_1 ( ) { java.lang.System.out.println ( VAR_1 . get ( ) ) ; return VAR_1 . get ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 < java.util.List < TYPE_2 > > execute ( ) { return VAR_1 . METHOD_1 ( VAR_2 ) . METHOD_2 ( VAR_3 ) . METHOD_3 ( VAR_4 ) ; } | public TYPE_1 < java.util.List < TYPE_2 > > execute ( ) { return VAR_1 . METHOD_1 ( VAR_2 ) . METHOD_2 ( VAR_4 ) . METHOD_3 ( VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) throws TYPE_1 { VAR_1 = TYPE_2 . METHOD_2 ( ) ; TYPE_3 VAR_2 = new TYPE_3 ( VAR_1 ) ; VAR_2 . update ( STRING_1 ) ; } | public static void METHOD_1 ( ) throws TYPE_1 { VAR_1 = TYPE_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.Exception error ) { VAR_1 . METHOD_2 ( new TYPE_1 ( error ) ) ; METHOD_3 ( ) ; } | private void METHOD_1 ( java.lang.Exception error ) { VAR_1 . METHOD_2 ( new TYPE_1 ( error ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void init ( byte VAR_1 , byte VAR_2 , long VAR_3 , java.lang.String VAR_4 , int startTime , int endTime , java.lang.Object value ) { super . init ( VAR_5 , VAR_1 , VAR_2 , VAR_3 , VAR_4 , startTime , endTime , value ) ; } | public void init ( int VAR_1 , byte VAR_2 , long VAR_3 , java.lang.String VAR_4 , int startTime , int endTime , java.lang.Object value ) { super . init ( VAR_5 , VAR_1 , VAR_2 , VAR_3 , VAR_4 , startTime , endTime , value ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( java.lang.Object VAR_1 , java.lang.String message ) { if ( ( VAR_2 ) != null ) { VAR_2 . METHOD_2 ( null ) ; VAR_2 . METHOD_3 ( VAR_1 , message ) ; } } | public void METHOD_1 ( java.lang.Object VAR_1 , java.lang.String message ) { if ( ( VAR_2 ) != null ) { VAR_2 . METHOD_2 ( null ) ; VAR_2 . METHOD_3 ( VAR_1 , message ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { return METHOD_2 ( METHOD_3 ( this . VAR_1 , this . VAR_2 , this . VAR_3 ) ) ; } | public java.lang.String METHOD_1 ( ) { return METHOD_2 ( METHOD_3 ( VAR_1 , VAR_2 , VAR_3 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { try { VAR_2 . METHOD_2 ( VAR_1 . METHOD_3 ( 1.0 ) ) ; } catch ( java.io.IOException VAR_3 ) { VAR_3 . METHOD_4 ( ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 ) { try { VAR_2 . METHOD_2 ( VAR_1 . METHOD_3 ( 1.0 ) ) ; } catch ( java.io.IOException VAR_3 ) { } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { VAR_2 = new java.io.File ( VAR_1 ) ; VAR_3 = new java.util.Scanner ( VAR_2 ) ; VAR_3 . METHOD_2 ( STRING_1 ) ; } | public void METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { VAR_2 = new java.io.File ( VAR_1 ) ; VAR_3 = new java.util.Scanner ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_2 . METHOD_2 ( TYPE_3 . METHOD_3 ( INT_1 , INT_2 ) ) ; } | public void METHOD_1 ( final TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. void remove ( TYPE_1 < TYPE_2 > VAR_1 ) { VAR_2 . METHOD_1 ( ) ; try { this . VAR_3 . remove ( VAR_1 ) ; this . VAR_4 . METHOD_2 ( ) ; } finally { VAR_2 . METHOD_3 ( ) ; } } | void remove ( TYPE_1 < TYPE_2 > VAR_1 ) { VAR_2 . METHOD_1 ( ) ; try { VAR_3 . remove ( VAR_1 ) ; VAR_4 . METHOD_2 ( ) ; } finally { VAR_2 . METHOD_3 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String toString ( ) { return ( VAR_1 ) + STRING_1 ; } | public java.lang.String toString ( ) { return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 p ) { return new TYPE_1 ( VAR_1 . METHOD_2 ( p ) , VAR_2 , VAR_3 , VAR_4 , VAR_5 ) ; } | public TYPE_1 METHOD_1 ( TYPE_2 p ) { return new TYPE_1 ( VAR_1 . METHOD_2 ( p ) , VAR_2 , VAR_3 , VAR_4 , VAR_5 , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = STRING_1 ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { if ( ( VAR_1 . METHOD_2 ( ) ) == null ) { java.lang.String VAR_2 = TYPE_1 . METHOD_3 ( ) . toString ( ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; } } | private void METHOD_1 ( ) { java.lang.String VAR_2 = TYPE_1 . METHOD_3 ( ) . toString ( ) ; VAR_1 . METHOD_4 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final java.lang.String VAR_1 ) { VAR_2 = null ; VAR_3 = null ; VAR_4 = 0 ; this . VAR_1 = null ; if ( VAR_1 != null ) { this . VAR_1 = VAR_1 . METHOD_2 ( VAR_5 ) ; } } | public void METHOD_1 ( final java.lang.String VAR_1 ) { VAR_2 = null ; VAR_3 = null ; VAR_4 = 0 ; this . VAR_1 = null ; if ( VAR_1 != null ) { this . VAR_1 = VAR_1 ; } }
|
The following code may contain bugs. Write a refined code without bugs. public boolean contains ( java.lang.String name ) { return TYPE_1 . isEmpty ( name ) ? false : VAR_1 . METHOD_1 ( name ) ; } | public boolean contains ( java.lang.String name ) { return ( ! ( TYPE_1 . isEmpty ( name ) ) ) && ( VAR_1 . METHOD_1 ( name ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 . METHOD_2 ( ) ; java.lang.System.out.println ( ( ( VAR_3 ) + STRING_1 ) ) ; METHOD_3 ( VAR_4 , VAR_5 ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { java.lang.System.out.println ( ( ( VAR_3 ) + STRING_1 ) ) ; METHOD_3 ( VAR_4 , VAR_5 ) ; VAR_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String [ ] METHOD_1 ( java.lang.String name , int ... VAR_1 ) throws java.io.IOException { return METHOD_1 ( name , false , VAR_1 ) ; } | public java.lang.String [ ] METHOD_1 ( java.lang.String name , int ... VAR_1 ) throws java.io.IOException { return METHOD_1 ( name , 0 , new java.util.ArrayList < java.lang.String > ( ) , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected java.util.Date METHOD_1 ( ) { return date ; } | public java.util.Date METHOD_1 ( ) { return date ; }
|
The following code may contain bugs. Write a refined code without bugs. private long METHOD_1 ( ) { if ( VAR_1 . METHOD_2 ( ) ) { return VAR_1 . METHOD_3 ( ) ; } else if ( VAR_2 . METHOD_4 ( ) ) { return VAR_3 ; } else { return 0 ; } } | private long METHOD_1 ( ) { if ( VAR_1 . METHOD_2 ( ) ) { return VAR_1 . METHOD_3 ( ) ; } else { return VAR_3 ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 , int height ) { VAR_2 . update ( VAR_1 , height ) ; VAR_3 . update ( VAR_1 , height ) ; super . METHOD_1 ( VAR_1 , height ) ; } | public void METHOD_1 ( int VAR_1 , int height ) { VAR_2 . update ( VAR_1 , height ) ; VAR_3 . update ( VAR_1 , height ) ; }
|
The following code may contain bugs. Write a refined code without bugs. java.util.List < ? > METHOD_1 ( java.io.File file ) throws TYPE_1 ; | java.util.List < ? > METHOD_1 ( java.io.File content ) throws TYPE_1 ;
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { return TYPE_1 . METHOD_2 ( false , ( STRING_1 + VAR_1 ) ) ; } | public static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { return TYPE_1 . METHOD_1 ( VAR_1 , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( int VAR_1 , int VAR_2 ) { return this . VAR_3 [ VAR_1 ] [ VAR_2 ] . VAR_4 ; } | public boolean METHOD_1 ( int x , int y ) { return this . VAR_3 [ y ] [ x ] . VAR_4 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { if ( VAR_1 ) return ; VAR_2 . METHOD_2 ( ) ; super . METHOD_1 ( ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( VAR_1 ) return ; VAR_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { java.lang.System.out.println ( ( ( ( STRING_1 + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_2 ) + ( VAR_1 . METHOD_3 ( ) ) ) ) ; VAR_2 = VAR_1 ; METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = VAR_1 ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( float x , float y , float VAR_1 ) { METHOD_1 ( x , y , VAR_1 , 1 ) ; } | public void METHOD_1 ( float x , float y , float VAR_1 ) { METHOD_1 ( x , y , VAR_1 , 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( VAR_2 == 0 ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; VAR_3 . METHOD_3 ( VAR_4 ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( VAR_2 == 0 ) VAR_3 . METHOD_3 ( VAR_4 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( java.lang.String VAR_1 , java.lang.String label ) { java.util.Set < java.lang.String > VAR_2 = METHOD_2 ( VAR_1 ) ; return VAR_2 == null ? false : VAR_2 . contains ( label ) ; } | private boolean METHOD_1 ( java.lang.String VAR_1 , java.lang.String label ) { java.util.Set < java.lang.String > VAR_2 = METHOD_2 ( VAR_1 ) ; return ( VAR_2 != null ) && ( VAR_2 . contains ( label ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { if ( ( VAR_1 != null ) && ( ! ( VAR_1 . METHOD_2 ( ) ) ) ) { VAR_2 . remove ( VAR_1 ) ; VAR_1 . METHOD_3 ( ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . remove ( VAR_1 ) ; if ( ( VAR_1 != null ) && ( ! ( VAR_1 . METHOD_2 ( ) ) ) ) { VAR_1 . METHOD_3 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( boolean select , java.lang.String VAR_1 ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( VAR_2 , VAR_1 , select ) ; } | public void METHOD_1 ( boolean select , java.lang.String VAR_1 ) { this . VAR_1 = VAR_1 ; TYPE_1 . METHOD_2 ( ) . METHOD_3 ( VAR_2 , VAR_1 , select ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 . METHOD_2 ( ) ; getActivity ( ) . METHOD_3 ( TYPE_1 . METHOD_4 ( VAR_3 ) ) ; } | public void METHOD_1 ( android.view.View VAR_1 ) { VAR_2 . METHOD_2 ( ) ; METHOD_3 ( TYPE_1 . METHOD_4 ( VAR_3 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { return ( ( VAR_2 ) + ( VAR_3 ) ) + ( TYPE_1 . METHOD_2 ( VAR_1 ) ) ; } | private static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { return ( VAR_2 ) + ( TYPE_1 . METHOD_2 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { if ( VAR_1 ) { return VAR_2 . METHOD_1 ( ) ; } else { return null ; } } | public TYPE_1 METHOD_1 ( ) { if ( ( VAR_1 ) && ( ( VAR_2 ) != null ) ) { return VAR_2 . METHOD_1 ( ) ; } else { return null ; } }
|
The following code may contain bugs. Write a refined code without bugs. public long METHOD_1 ( long VAR_1 , TYPE_1 VAR_2 , TYPE_2 content ) { return TYPE_3 . METHOD_2 ( ) ; } | public long METHOD_1 ( long VAR_1 , TYPE_1 VAR_2 , TYPE_2 content ) { return TYPE_3 . METHOD_2 ( long . class ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( double VAR_1 , int VAR_2 ) { int VAR_3 = METHOD_2 ( VAR_2 ) ; double x = ( VAR_3 * ( VAR_1 + INT_1 ) ) / INT_2 ; return TYPE_1 . min ( x , ( VAR_3 - 1 ) ) ; } | public double METHOD_1 ( double VAR_1 , int VAR_2 ) { int VAR_3 = METHOD_2 ( VAR_2 ) ; double x = ( VAR_3 * ( VAR_1 + INT_1 ) ) / INT_2 ; return TYPE_1 . min ( x , VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private double METHOD_1 ( double VAR_1 , double VAR_2 ) { return VAR_1 / ( ( VAR_1 * ( VAR_1 + 1 ) ) / INT_1 ) ; } | private double METHOD_1 ( double VAR_1 , double VAR_2 ) { return VAR_1 / ( ( VAR_2 * ( VAR_2 + 1 ) ) / INT_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( final TYPE_1 context , final java.util.Collection < TYPE_2 < TYPE_1 , TYPE_3 > > VAR_1 , final TYPE_4 < TYPE_3 > result ) { if ( null != VAR_1 ) { METHOD_2 ( context , VAR_1 , result ) ; } } | public void METHOD_1 ( final TYPE_1 context , final java.util.Collection < TYPE_2 < TYPE_1 , TYPE_3 > > VAR_1 , final TYPE_4 < TYPE_3 > result ) { METHOD_2 ( context , VAR_1 , result ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public int compareTo ( TYPE_1 VAR_1 ) { return ( ( int ) ( ( this . count ) - ( VAR_1 . count ) ) ) ; } | public int compareTo ( TYPE_1 VAR_1 ) { return ( ( int ) ( ( VAR_1 . count ) - ( this . count ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { return text ; } | public java.lang.String METHOD_1 ( ) { return text . toLowerCase ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public final void init ( ) { java.lang.System.out.println ( STRING_1 ) ; METHOD_1 ( ) ; } | public final void init ( ) { java.lang.System.out.println ( STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { if ( ( VAR_1 . size ( ) ) > 1 ) { VAR_2 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; METHOD_4 ( VAR_1 . METHOD_5 ( ) , false ) ; } } | private void METHOD_1 ( ) { if ( ( VAR_1 . size ( ) ) > 0 ) { VAR_2 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; METHOD_4 ( VAR_1 . METHOD_3 ( ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { METHOD_2 ( ( - INT_1 ) , true ) ; } | protected void METHOD_1 ( ) { METHOD_2 ( INT_1 , true ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.Class < ? > type ) { return ( ( super . METHOD_1 ( type ) ) || ( a . METHOD_1 ( type ) ) ) || ( b . METHOD_1 ( type ) ) ; } | public boolean METHOD_1 ( java.lang.Class < ? > type ) { return ( super . METHOD_1 ( type ) ) || ( a . METHOD_1 ( type ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( int VAR_1 ) { return ( this . VAR_2 ) > VAR_1 ; } | public boolean METHOD_1 ( int VAR_1 ) { return ( this . VAR_2 ) >= VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String msg ) { VAR_1 . METHOD_2 ( ( STRING_1 + msg ) ) ; } | public static void METHOD_1 ( java.lang.String msg ) { if ( ( VAR_1 ) != null ) VAR_1 . METHOD_2 ( ( STRING_1 + msg ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public abstract boolean METHOD_1 ( TYPE_1 VAR_1 ) ; | public abstract void execute ( TYPE_1 VAR_1 ) ;
|
The following code may contain bugs. Write a refined code without bugs. public static java.util.List < TYPE_1 > METHOD_1 ( java.util.List < TYPE_1 > VAR_1 ) { java.util.Collections.sort ( VAR_1 ) ; return VAR_1 ; } | public static java.util.List < TYPE_1 > METHOD_1 ( java.util.List < TYPE_1 > VAR_1 ) { java.lang.System.out.println ( VAR_1 ) ; java.util.Collections.sort ( VAR_1 ) ; java.lang.System.out.println ( VAR_1 ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. private int METHOD_1 ( TYPE_1 VAR_1 ) { return this . VAR_2 . get ( VAR_1 ) . size ( ) ; } | public int METHOD_1 ( TYPE_1 VAR_1 ) { return this . VAR_2 . get ( VAR_1 ) . size ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { if ( ( VAR_2 ) != null ) return VAR_2 ; VAR_2 = new TYPE_1 ( VAR_1 ) ; return VAR_2 ; } | public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { VAR_2 = new TYPE_1 ( VAR_1 ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object get ( int index ) { if ( index > ( size ) ) return null ; return VAR_1 [ index ] ; } | public java.lang.Object get ( int index ) { if ( ( index < 0 ) || ( index > ( ( size ) - 1 ) ) ) return null ; return VAR_1 [ index ] ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 error ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; METHOD_3 ( ) ; TYPE_3 . METHOD_4 ( METHOD_5 ( ) , STRING_3 , VAR_1 ) . show ( ) ; } | public void METHOD_1 ( TYPE_1 error ) { TYPE_2 . METHOD_2 ( STRING_1 , STRING_2 ) ; TYPE_3 . METHOD_4 ( METHOD_5 ( ) , STRING_3 , VAR_1 ) . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; VAR_1 = this ; TYPE_1 . METHOD_2 ( ( VAR_2 ? new TYPE_2 ( ) : new TYPE_3 ( ) ) ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( ( VAR_2 ? new TYPE_2 ( ) : new TYPE_3 ( ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , boolean b ) { return VAR_3 . METHOD_1 ( VAR_1 , VAR_2 , b ) ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , boolean b ) { if ( ( VAR_3 ) != null ) return VAR_3 . METHOD_1 ( VAR_1 , VAR_2 , b ) ; else return false ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( int VAR_1 , int VAR_2 , TYPE_1 to , int VAR_3 ) { this . METHOD_2 ( to ) ; this . METHOD_3 ( ) ; return true ; } | public boolean METHOD_1 ( int VAR_1 , int VAR_2 , TYPE_1 to , int VAR_3 ) { this . METHOD_2 ( to ) ; this . x = VAR_1 ; this . y = VAR_2 ; this . METHOD_3 ( ) ; return true ; }
|
The following code may contain bugs. Write a refined code without bugs. void METHOD_1 ( ) { while ( ! ( VAR_1 . METHOD_2 ( ) ) ) { if ( ! ( VAR_1 . METHOD_3 ( ) . METHOD_4 ( ) ) ) { VAR_1 . METHOD_5 ( ) ; } else { return ; } } } | public boolean METHOD_4 ( ) { METHOD_1 ( ) ; return ! ( VAR_1 . isEmpty ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { VAR_1 = VAR_2 ; VAR_3 . METHOD_2 ( VAR_4 ) ; VAR_3 . METHOD_3 ( new TYPE_1 ( ) { public void METHOD_4 ( android.view.View VAR_5 ) { METHOD_5 ( ) ; } } ) ; } | private void METHOD_1 ( ) { VAR_3 . METHOD_2 ( VAR_4 ) ; VAR_3 . METHOD_3 ( new TYPE_1 ( ) { public void METHOD_4 ( android.view.View VAR_5 ) { METHOD_5 ( ) ; } } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( final TYPE_1 VAR_1 ) throws java.lang.Exception { VAR_1 . METHOD_2 ( VAR_2 ) . METHOD_3 ( new TYPE_2 ( ) ) ; } | protected void METHOD_1 ( final TYPE_1 VAR_1 ) throws java.lang.Exception { VAR_1 . METHOD_2 ( VAR_2 ) . METHOD_3 ( METHOD_3 ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( android.content.Context context ) { return ( TYPE_1 . getInt ( context . METHOD_2 ( ) , VAR_1 , 0 ) ) != 0 ; } | public boolean METHOD_1 ( android.content.Context context ) { if ( context == null ) { return true ; } return ( TYPE_1 . getInt ( context . METHOD_2 ( ) , VAR_1 , 0 ) ) != 0 ; }
|
The following code may contain bugs. Write a refined code without bugs. private void list ( ) { java.lang.System.out.println ( STRING_1 ) ; java.lang.System.out.println ( STRING_2 ) ; java.lang.System.out.println ( "id" ) ; java.lang.System.out.println ( STRING_3 ) ; java.lang.System.out.println ( STRING_4 ) ; java.lang.System.out.println ( STRING_5 ) ; java.lang.System.out.println ( STRING_6 ) ; } | private void list ( ) { java.lang.System.out.println ( STRING_1 ) ; java.lang.System.out.println ( STRING_2 ) ; java.lang.System.out.println ( "id" ) ; java.lang.System.out.println ( STRING_3 ) ; java.lang.System.out.println ( STRING_5 ) ; java.lang.System.out.println ( STRING_6 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; TYPE_2 . METHOD_3 ( ) . METHOD_1 ( ) ; } | public void METHOD_1 ( ) { TYPE_2 . METHOD_3 ( ) . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.lang.Exception { TYPE_1 . METHOD_2 ( VAR_1 . METHOD_3 ( VAR_2 ) ) . METHOD_4 ( VAR_3 class ) ; TYPE_2 < java.lang.Object > VAR_4 = VAR_5 . METHOD_3 ( VAR_2 ) ; } | public void METHOD_1 ( ) throws java.lang.Exception { METHOD_2 ( VAR_1 . METHOD_3 ( VAR_2 ) ) . METHOD_4 ( VAR_3 class ) ; TYPE_2 < java.lang.Object > VAR_4 = VAR_5 . METHOD_3 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( int VAR_1 ) { return TYPE_1 . METHOD_2 ( ( ( ( ( this . VAR_2 [ VAR_1 ] . VAR_3 ) - ( ( VAR_4 ) / INT_1 ) ) - FLOAT_1 ) / ( VAR_5 ) ) ) ; } | public double METHOD_1 ( int VAR_1 ) { return TYPE_1 . METHOD_2 ( ( ( ( this . VAR_2 [ VAR_1 ] . VAR_3 ) - ( ( ( VAR_4 ) / INT_1 ) - FLOAT_1 ) ) / ( VAR_5 ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object METHOD_1 ( java.lang.Integer VAR_1 ) { java.lang.Integer VAR_2 = TYPE_1 . METHOD_2 ( ) ; return VAR_3 . select ( VAR_2 , VAR_1 ) ; } | public java.lang.Object METHOD_1 ( ) { java.lang.Integer VAR_2 = TYPE_1 . METHOD_2 ( ) ; return VAR_3 . select ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.Set < TYPE_1 > names ) { this . names = new TYPE_2 < TYPE_1 > ( names ) ; } | public void METHOD_1 ( java.util.Set < TYPE_1 > names ) { this . names = names ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int add ( int a , int b ) { return a + b ; VAR_1 = VAR_2 ; } | public static int add ( int a , int b ) { return a + b ; }
|
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 ) ; intent . METHOD_2 ( VAR_2 ) ; intent . METHOD_3 ( getIntent ( ) ) ; 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 ( getIntent ( ) ) ; METHOD_4 ( intent ) ; }
|
The following code may contain bugs. Write a refined code without bugs. boolean METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; TYPE_3 VAR_2 = METHOD_4 ( ) ; TYPE_2 . METHOD_5 ( ( ! ( VAR_2 . METHOD_6 ( ) ) ) ) ; return VAR_2 . METHOD_1 ( VAR_1 ) ; } | boolean METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; TYPE_3 VAR_2 = METHOD_4 ( ) ; return VAR_2 . METHOD_6 ( ) ? false : VAR_2 . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { METHOD_2 ( ) ; if ( VAR_1 == ( - 1 ) ) { VAR_2 . METHOD_3 ( ) ; } this . VAR_1 = VAR_1 ; } | public void METHOD_1 ( int VAR_1 ) { METHOD_2 ( ) ; if ( VAR_1 == ( - 1 ) ) { VAR_2 . METHOD_3 ( ) ; return ; } VAR_2 . METHOD_1 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( STRING_1 ) ; if ( VAR_2 ) { METHOD_3 ( VAR_1 ) ; } else { TYPE_3 . METHOD_4 ( VAR_1 ) ; METHOD_5 ( STRING_2 ) ; } } | public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( STRING_1 ) ; if ( VAR_2 ) { METHOD_3 ( VAR_1 ) ; } else { TYPE_3 . METHOD_4 ( VAR_1 ) ; } METHOD_5 ( STRING_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { VAR_2 = ( VAR_1 == null ) ? STRING_1 : VAR_1 ; } | public void METHOD_1 ( java.lang.String VAR_1 ) { VAR_2 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { TYPE_1 VAR_3 = new TYPE_1 ( ) ; VAR_3 . METHOD_2 ( VAR_1 ) ; VAR_3 . METHOD_3 ( VAR_2 ) ; VAR_4 . index ( VAR_3 , null , true ) ; } | public void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { TYPE_1 VAR_3 = new TYPE_1 ( ) ; VAR_3 . METHOD_2 ( VAR_1 ) ; VAR_3 . METHOD_3 ( VAR_2 ) ; VAR_4 . index ( VAR_3 , null , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_1 ) ; METHOD_4 ( ) ; } | public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) . METHOD_3 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void start ( ) throws java.io.IOException { VAR_1 . set ( true ) ; VAR_2 . start ( ) ; if ( ( VAR_3 ) != null ) { VAR_3 . METHOD_1 ( ) ; } } | public void start ( ) throws java.io.IOException { VAR_1 . set ( true ) ; VAR_2 . start ( ) ; if ( ( VAR_3 ) != null ) { VAR_3 . start ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { if ( VAR_1 <= 0 ) VAR_2 = 1 ; else VAR_2 = VAR_1 ; } | public void METHOD_1 ( int VAR_1 ) { VAR_2 = ( VAR_1 <= 0 ) ? 1 : VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) ; super . METHOD_1 ( ) ; } | protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( int VAR_1 ) throws TYPE_1 { this . VAR_2 . METHOD_2 ( VAR_1 ) ; this . VAR_2 . METHOD_3 ( ) ; this . VAR_2 . METHOD_2 ( CHAR_1 ) ; this . VAR_2 . METHOD_3 ( ) ; } | protected void METHOD_1 ( int VAR_1 ) throws TYPE_1 { this . VAR_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 ( ) ; VAR_1 . METHOD_2 ( TYPE_2 . get ( VAR_2 , VAR_3 ) ) ; } | public void METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( ) ; VAR_1 . METHOD_2 ( TYPE_2 . get ( VAR_2 , VAR_3 ) , true ) ; }
|
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 = false ; METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , int id ) { VAR_1 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.String VAR_1 ) { node = null ; VAR_2 . METHOD_2 ( VAR_1 ) ; java.lang.System.out.println ( STRING_1 ) ; } | private void METHOD_1 ( java.lang.String VAR_1 ) { node = null ; VAR_2 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( double VAR_1 ) { METHOD_1 ( new java.lang.Double ( TYPE_1 . METHOD_2 ( VAR_1 ) ) . intValue ( ) ) ; } | protected void METHOD_1 ( double VAR_1 ) { METHOD_1 ( ( ( int ) ( TYPE_1 . METHOD_2 ( VAR_1 ) ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean contains ( int x , int y ) { return ( VAR_1 . contains ( x , y ) ) != ( VAR_2 . contains ( x , y ) ) ; } | public boolean contains ( int x , int y ) { return ( VAR_1 . contains ( x , y ) ) && ( ! ( VAR_2 . contains ( x , y ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 ) { if ( ( VAR_3 ) > 0 ) { METHOD_2 ( VAR_3 ) ; VAR_4 . METHOD_3 ( VAR_5 ) ; } VAR_1 . METHOD_4 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 ) { if ( ( VAR_3 ) >= 0 ) { METHOD_2 ( VAR_3 ) ; VAR_4 . METHOD_3 ( VAR_5 ) ; } VAR_1 . METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.util.List < TYPE_1 > VAR_1 , TYPE_2 VAR_2 ) { if ( VAR_2 != null ) VAR_3 . METHOD_1 ( null , VAR_2 ) ; else { VAR_3 . METHOD_1 ( VAR_1 . get ( 0 ) , null ) ; } } | public void METHOD_1 ( java.util.List < TYPE_1 > VAR_1 , TYPE_2 VAR_2 ) { if ( VAR_1 == null ) { VAR_3 . METHOD_1 ( null , VAR_2 ) ; } else { VAR_3 . METHOD_1 ( VAR_1 . get ( 0 ) , VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void start ( TYPE_1 context ) throws java.lang.Exception { java.lang.System.out.println ( STRING_1 ) ; } | public void start ( TYPE_1 context ) throws java.lang.Exception { }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_2 ( ) ; TYPE_2 = METHOD_3 ( ) ; VAR_2 . setText ( TYPE_2 . getName ( ) ) ; } | private void METHOD_1 ( TYPE_1 VAR_1 ) { METHOD_2 ( ) ; TYPE_2 = METHOD_3 ( ) ; if ( ( TYPE_2 ) != null ) { VAR_2 . setText ( TYPE_2 . getName ( ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public int METHOD_1 ( ) { VAR_1 = 0 ; return VAR_1 ; } | public int METHOD_1 ( ) { VAR_1 = 1 ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( TYPE_1 VAR_1 ) { return ( VAR_2 . compareTo ( VAR_1 . METHOD_2 ( ) ) ) < 0 ; } | public boolean METHOD_1 ( TYPE_1 VAR_1 ) { return ( VAR_2 . compareTo ( VAR_1 . METHOD_2 ( ) ) ) <= 0 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String time ) { VAR_1 . setText ( time ) ; VAR_2 . setText ( time ) ; } | public void METHOD_1 ( java.lang.String time ) { if ( ( VAR_1 ) != null ) { VAR_1 . setText ( time ) ; } VAR_2 . setText ( time ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( STRING_1 ) ; } catch ( TYPE_1 VAR_2 ) { VAR_2 . METHOD_3 ( ) ; new TYPE_2 ( VAR_2 ) . METHOD_4 ( ) ; } } | public void METHOD_1 ( ) { try { VAR_1 . METHOD_2 ( STRING_1 ) ; } catch ( java.lang.Exception VAR_2 ) { VAR_2 . METHOD_3 ( ) ; new TYPE_2 ( VAR_2 ) . METHOD_4 ( ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object METHOD_1 ( int position ) { return null ; } | public java.lang.Object METHOD_1 ( int position ) { return position ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.