input stringlengths 96 415 | output stringlengths 18 303 |
|---|---|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 listener ) { synchronized ( VAR_1 ) { VAR_2 . remove ( listener ) ; } } | public void METHOD_1 ( TYPE_1 listener ) { VAR_2 . remove ( listener ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { java.util.List < TYPE_1 > VAR_1 = METHOD_2 ( VAR_2 class ) . METHOD_3 ( VAR_3 ) . METHOD_4 ( "name" ) . METHOD_5 ( ) . execute ( ) ; VAR_4 . METHOD_6 ( STRING_1 , VAR_1 ) ; } | public void METHOD_1 ( ) { java.util.List < TYPE_1 > VAR_1 = select ( VAR_2 class ) . METHOD_3 ( VAR_3 ) . METHOD_4 ( "name" ) . METHOD_5 ( ) . execute ( ) ; VAR_4 . METHOD_6 ( STRING_1 , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected void METHOD_1 ( android.content.Context VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_1 . METHOD_2 ( VAR_1 ) ; TYPE_2 . METHOD_3 ( ) ; } | protected void METHOD_1 ( android.content.Context VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_1 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.String id ) { try { TYPE_1 VAR_1 = new TYPE_1 ( id ) ; return true ; } catch ( TYPE_2 VAR_2 ) { java.lang.System.out.println ( VAR_2 . METHOD_2 ( ) ) ; return false ; } } | public boolean METHOD_1 ( java.lang.String id ) { try { TYPE_1 VAR_1 = new TYPE_1 ( id ) ; return true ; } catch ( TYPE_2 VAR_2 ) { return false ; } }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( java.lang.String VAR_1 , java.lang.Object VAR_2 ) { TYPE_1 . assertEquals ( VAR_2 , TYPE_2 . METHOD_2 ( VAR_1 ) ) ; } | public static void METHOD_1 ( java.lang.String VAR_1 , java.lang.Object VAR_2 ) { TYPE_1 . assertEquals ( VAR_1 , VAR_2 , TYPE_2 . METHOD_2 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( java.lang.Object VAR_1 , java.lang.Object VAR_2 , TYPE_1 VAR_3 ) { if ( ( VAR_4 [ index ] ) == null ) { VAR_5 [ index ] . METHOD_2 ( METHOD_3 ( ( ( VAR_6 ) + index ) ) ) ; } return true ; } | public boolean METHOD_1 ( java.lang.Object VAR_1 , java.lang.Object VAR_2 , TYPE_1 VAR_3 ) { if ( ( VAR_4 [ index ] ) != null ) { VAR_5 [ index ] . METHOD_2 ( METHOD_3 ( ( ( VAR_6 ) + index ) ) ) ; } return true ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( ) ; java.lang.String VAR_2 = STRING_1 ; if ( VAR_1 != null ) { VAR_2 = VAR_1 . METHOD_3 ( ) ; } else { METHOD_4 ( ) ; } return VAR_2 ; } | protected java.lang.String METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( ) ; java.lang.String VAR_2 = STRING_1 ; if ( VAR_1 != null ) { VAR_2 = VAR_1 . METHOD_3 ( ) ; } else { METHOD_4 ( ) ; } return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( new TYPE_3 [ 0 ] ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = null ; synchronized ( VAR_2 ) { VAR_1 = VAR_3 . METHOD_2 ( ) ; } return VAR_1 ; } | public TYPE_1 METHOD_1 ( ) { return VAR_3 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) throws TYPE_1 { return new java.lang.String ( STRING_1 ) ; } | public java.lang.String METHOD_1 ( ) throws TYPE_1 { return STRING_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( TYPE_2 VAR_1 ) throws TYPE_3 { TYPE_1 VAR_2 = null ; return VAR_2 ; } | public void METHOD_1 ( TYPE_2 VAR_1 ) throws TYPE_3 { TYPE_1 VAR_2 = null ; }
|
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 ( ) ; VAR_2 . METHOD_2 ( ) . METHOD_4 ( VAR_3 , VAR_4 ) ; VAR_2 . METHOD_2 ( ) . METHOD_5 ( ) . setText ( STRING_1 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . METHOD_2 ( ) . METHOD_4 ( VAR_3 , VAR_4 ) ; VAR_2 . METHOD_2 ( ) . METHOD_5 ( ) . setText ( STRING_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( STRING_1 ) ; VAR_1 . METHOD_2 ( STRING_2 , VAR_2 . METHOD_3 ( ) ) ; return VAR_1 ; } | public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = new TYPE_1 ( STRING_1 ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 ) { if ( ( java.lang.Math.abs ( VAR_1 ) ) != 1 ) { java.lang.System.out.println ( STRING_1 ) ; return ; } VAR_2 = ( ( VAR_2 ) + VAR_1 ) % INT_1 ; } | public void METHOD_1 ( int VAR_1 ) { if ( ( java.lang.Math.abs ( VAR_1 ) ) != 1 ) { java.lang.System.out.println ( STRING_1 ) ; return ; } VAR_2 = ( ( ( VAR_2 ) + INT_1 ) + VAR_1 ) % INT_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. protected float METHOD_1 ( TYPE_1 VAR_1 , float VAR_2 ) { return this . METHOD_1 ( ( ( TYPE_2 ) ( VAR_1 ) ) , VAR_2 ) ; } | protected float METHOD_1 ( TYPE_1 VAR_1 , float VAR_2 ) { return METHOD_1 ( ( ( TYPE_2 ) ( VAR_1 ) ) , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( ) { return VAR_1 . METHOD_2 ( VAR_2 ) ; } | protected boolean METHOD_1 ( ) { return VAR_1 . METHOD_2 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Object METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 array , TYPE_3 VAR_2 , TYPE_4 VAR_3 ) { return METHOD_2 ( VAR_1 , TYPE_5 . METHOD_3 ( ( ( java.lang.Object [ ] ) ( TYPE_6 . METHOD_4 ( array ) ) ) ) , VAR_2 ) ; } | public java.lang.Object METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 array , TYPE_3 VAR_2 , TYPE_4 VAR_3 ) { return METHOD_2 ( VAR_1 , TYPE_5 . METHOD_3 ( ( ( java.lang.Object [ ] ) ( TYPE_6 . METHOD_4 ( array ) ) ) ) , array , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public android.view.View METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , TYPE_3 VAR_3 ) { TYPE_3 VAR_4 = METHOD_2 ( ) ; return VAR_1 . METHOD_3 ( VAR_5 , null ) ; } | public android.view.View METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , TYPE_3 VAR_3 ) { return VAR_1 . METHOD_3 ( VAR_5 , null ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private static int METHOD_1 ( TYPE_1 VAR_1 ) { int VAR_2 = VAR_1 . METHOD_2 ( ) ; int VAR_3 = VAR_1 . METHOD_3 ( ) ; int size = ( VAR_2 * VAR_3 ) / ( INT_1 * INT_1 ) ; return size ; } | private static long METHOD_1 ( TYPE_1 VAR_1 ) { int VAR_2 = VAR_1 . METHOD_2 ( ) ; int VAR_3 = VAR_1 . METHOD_3 ( ) ; return ( VAR_2 * VAR_3 ) / ( INT_1 * INT_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( ) { TYPE_1 . info ( ( STRING_1 + ( METHOD_2 ( ) ) ) ) ; return ( ( METHOD_2 ( ) ) != null ) && ( ! ( METHOD_2 ( ) . METHOD_3 ( ) ) ) ; } | public boolean METHOD_1 ( ) { return ( ( METHOD_2 ( ) ) != null ) && ( ! ( METHOD_2 ( ) . METHOD_3 ( ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 < java.lang.String > METHOD_1 ( ) { } | public TYPE_1 < java.lang.String > METHOD_1 ( ) { return null ; }
|
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 = this . VAR_3 . get ( VAR_1 ) ; this . VAR_3 . remove ( VAR_2 ) ; return VAR_2 ; } | public TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 VAR_2 = this . VAR_3 . get ( VAR_1 ) ; this . VAR_3 . remove ( VAR_1 ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( TYPE_1 VAR_1 , java.lang.Throwable error , TYPE_2 VAR_2 ) { TYPE_3 . error ( VAR_1 , error , VAR_2 ) ; if ( ! ( VAR_1 . METHOD_2 ( ) ) ) { VAR_1 . METHOD_3 ( ) ; } } | public static void METHOD_1 ( TYPE_1 VAR_1 , java.lang.Throwable error , TYPE_2 VAR_2 ) { TYPE_3 . error ( VAR_1 , error , VAR_2 ) ; VAR_1 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( int value ) { VAR_1 |= INT_1 ; VAR_2 = value ; METHOD_2 ( ) ; return this ; } | public TYPE_1 METHOD_1 ( java.lang.String value ) { if ( value == null ) { throw new java.lang.NullPointerException ( ) ; } VAR_1 |= INT_1 ; VAR_2 = value ; METHOD_2 ( ) ; return this ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 p , TYPE_2 [ ] [ ] VAR_1 ) { p . METHOD_2 ( true ) ; p . METHOD_3 ( new int [ ] { 0 , INT_1 } , VAR_1 ) ; } | public void METHOD_1 ( TYPE_1 p , TYPE_2 [ ] [ ] VAR_1 ) { p . METHOD_2 ( true ) ; p . METHOD_3 ( new int [ ] { INT_1 , 0 } , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { switch ( VAR_1 ) { case STRING_1 : VAR_3 . put ( STRING_2 , VAR_2 ) ; default : VAR_3 . put ( STRING_3 , VAR_2 ) ; } } | private void METHOD_1 ( java.lang.String VAR_1 , java.lang.String VAR_2 ) { switch ( VAR_1 ) { case STRING_1 : VAR_3 . put ( STRING_2 , VAR_2 ) ; break ; default : VAR_3 . put ( STRING_3 , VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 < ? > VAR_1 , android.view.View view , int i , long VAR_2 ) { TYPE_2 . METHOD_2 ( STRING_1 , java.lang.String . METHOD_3 ( i ) ) ; VAR_3 . METHOD_4 ( true ) ; } | public void METHOD_1 ( TYPE_1 < ? > VAR_1 , android.view.View view , int i , long VAR_2 ) { TYPE_2 . METHOD_2 ( STRING_1 , java.lang.String . METHOD_3 ( i ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void update ( final TYPE_1 VAR_1 , final java.lang.Object arg ) { VAR_2 = ( ( boolean ) ( arg ) ) ; TYPE_2 . METHOD_1 ( ) . METHOD_2 ( STRING_1 , new TYPE_3 ( ) ) ; } | public void update ( final TYPE_1 VAR_1 , final java.lang.Object arg ) { VAR_2 = ( ( boolean ) ( arg ) ) ; if ( VAR_2 ) { TYPE_2 . METHOD_1 ( ) . METHOD_2 ( STRING_1 , new TYPE_3 ( ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( int value ) { if ( ( value < 1 ) || ( value > INT_1 ) ) { throw new TYPE_1 ( STRING_1 ) ; } VAR_1 = value ; } | public void METHOD_1 ( int VAR_1 ) { this . VAR_1 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( int VAR_1 ) { METHOD_2 ( TYPE_2 . getColor ( this . context , VAR_1 ) ) ; return this ; } | public TYPE_1 METHOD_1 ( int VAR_1 ) { return METHOD_2 ( TYPE_2 . getColor ( this . context , VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. < String > METHOD_1 ( ) { } | java.util.Set < java.lang.String > METHOD_1 ( ) { }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.Throwable VAR_1 ) { METHOD_2 ( false ) ; METHOD_3 ( ) ; if ( ( VAR_1 . METHOD_4 ( ) ) == null ) { TYPE_1 . METHOD_5 ( STRING_1 , VAR_1 . METHOD_4 ( ) ) ; } } | public void METHOD_1 ( java.lang.Throwable VAR_1 ) { METHOD_2 ( false , false ) ; METHOD_3 ( ) ; if ( ( VAR_1 . METHOD_4 ( ) ) != null ) { TYPE_1 . METHOD_5 ( STRING_1 , VAR_1 . METHOD_4 ( ) ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 = 1 ; TYPE_2 . METHOD_2 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; VAR_2 = METHOD_2 ( ) . getString ( STRING_1 ) ; VAR_3 = TYPE_2 . METHOD_3 ( ) . METHOD_4 ( ) ; METHOD_5 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; METHOD_5 ( ) ; VAR_2 = METHOD_2 ( ) . getString ( STRING_1 ) ; VAR_3 = TYPE_2 . METHOD_3 ( ) . METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( false ) ; VAR_2 . METHOD_3 ( VAR_3 ) ; } | public void METHOD_1 ( ) { if ( null != ( VAR_1 ) ) VAR_1 . METHOD_2 ( false ) ; if ( null != ( VAR_2 ) ) VAR_2 . METHOD_3 ( VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( int i ) { return i < ( VAR_1 . length ) ? VAR_1 [ i ] : VAR_2 . METHOD_1 ( 0 ) ; } | public TYPE_1 METHOD_1 ( int i ) { return VAR_1 [ i ] ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( ( VAR_1 ) != null ) { VAR_1 = METHOD_2 ( ) ; VAR_1 . show ( ) ; } } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; if ( ( VAR_1 ) != null ) VAR_1 . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 , boolean VAR_3 ) { if ( VAR_3 && ( ( VAR_4 ) != null ) ) { VAR_4 . METHOD_2 ( ) ; VAR_4 = null ; } } | public void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 , boolean VAR_3 ) { }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.Integer METHOD_1 ( final java.lang.String source ) { return java.lang.Integer . METHOD_2 ( source ) ; } | public java.lang.Integer METHOD_1 ( final java.lang.String source ) { if ( null == source ) { return null ; } return java.lang.Integer . METHOD_2 ( source ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public final TYPE_1 METHOD_1 ( TYPE_2 op ) { TYPE_3 VAR_1 = METHOD_2 ( ) ; if ( this . METHOD_3 ( VAR_2 , this . METHOD_4 ( VAR_3 , this . VAR_4 ) , VAR_5 ) ) { return VAR_6 ; } return METHOD_5 ( ) ; } | public final TYPE_1 METHOD_1 ( TYPE_2 op ) { if ( this . METHOD_3 ( VAR_2 , VAR_5 ) ) { return VAR_6 ; } return METHOD_5 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 view , TYPE_2 event ) { if ( ! ( VAR_1 ) ) { return ; } if ( ! ( VAR_2 . METHOD_1 ( event ) ) ) { super . METHOD_1 ( view , event ) ; } } | public void METHOD_1 ( TYPE_1 view , TYPE_2 event ) { if ( ! ( VAR_1 ) ) { return ; } }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . METHOD_2 ( new TYPE_1 ( VAR_1 , VAR_2 , message ) ) ; this . VAR_3 . METHOD_3 ( ) ; } | public void METHOD_1 ( ) { this . VAR_3 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected native long METHOD_1 ( int VAR_1 ) ; | public native long METHOD_1 ( int 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.Object event ) { METHOD_2 ( new TYPE_1 ( VAR_1 , event ) ) ; } | public void METHOD_1 ( java.lang.String VAR_1 , java.lang.Object event ) { METHOD_2 ( new TYPE_1 ( VAR_1 , event , false ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String name ) { for ( TYPE_1 c : VAR_1 ) { if ( c . METHOD_2 ( ) . equals ( name ) ) { return c ; } } return null ; } | public TYPE_1 METHOD_1 ( java.lang.String name ) { for ( TYPE_1 c : VAR_1 ) { if ( c . METHOD_2 ( ) . toLowerCase ( ) . equals ( name . toLowerCase ( ) ) ) { return c ; } } return null ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( ) { VAR_1 . error ( STRING_1 , VAR_2 ) ; ( VAR_2 ) ++ ; } | public static void METHOD_1 ( ) { ( VAR_2 ) ++ ; }
|
The following code may contain bugs. Write a refined code without bugs. public static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { TYPE_2 VAR_2 = TYPE_2 . METHOD_2 ( VAR_1 ) ; if ( VAR_2 == null ) { throw new TYPE_1 ( ( STRING_1 + VAR_1 ) ) ; } return VAR_2 . METHOD_1 ( ) ; } | public static java.lang.String METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { TYPE_2 VAR_2 = TYPE_2 . METHOD_2 ( VAR_1 ) ; return VAR_2 . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { VAR_1 . setText ( VAR_1 . METHOD_2 ( ) ) ; VAR_2 . setEnabled ( true ) ; VAR_3 . setEnabled ( false ) ; VAR_4 . setEnabled ( true ) ; VAR_5 . setEnabled ( false ) ; } | public void METHOD_1 ( ) { VAR_2 . setEnabled ( true ) ; VAR_3 . setEnabled ( false ) ; VAR_4 . setEnabled ( true ) ; VAR_5 . setEnabled ( false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.util.List < java.lang.Object > METHOD_1 ( ) { VAR_1 . METHOD_2 ( STRING_1 ) ; return null ; } | private java.util.List < java.lang.Object > METHOD_1 ( ) { VAR_1 . METHOD_2 ( STRING_1 ) ; return new java.util.ArrayList < > ( ) ; }
|
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_1 . METHOD_2 ( VAR_1 . toLowerCase ( ) . trim ( ) ) ; } | public static TYPE_1 METHOD_1 ( java.lang.String VAR_1 ) { return TYPE_1 . METHOD_2 ( VAR_1 . toUpperCase ( ) . trim ( ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private static TYPE_1 get ( ) { if ( ( VAR_1 ) >= ( VAR_2 ) ) return VAR_3 ; else if ( ( VAR_1 ) >= ( VAR_4 ) ) return VAR_5 ; else return VAR_6 ; } | public static TYPE_1 get ( ) { if ( ( VAR_1 ) >= ( VAR_2 ) ) return VAR_3 ; else return VAR_5 ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 VAR_2 = VAR_3 . METHOD_2 ( VAR_1 ) ; return VAR_2 . METHOD_3 ( ) ; } | public TYPE_1 METHOD_2 ( java.lang.String VAR_1 ) { return VAR_3 . METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public abstract void METHOD_1 ( TYPE_1 VAR_1 , java.io.IOException VAR_2 ) ; | public abstract void METHOD_1 ( TYPE_1 VAR_1 ) ;
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 list ( java.lang.String VAR_1 ) throws java.io.IOException { VAR_1 = METHOD_1 ( VAR_1 ) ; return get ( VAR_2 , VAR_1 , METHOD_2 ( ) ) ; } | public TYPE_1 list ( java.lang.String VAR_1 ) throws java.io.IOException { VAR_1 = METHOD_1 ( VAR_1 ) ; return get ( VAR_2 , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 . METHOD_3 ( STRING_1 , VAR_2 . String class ) ) ; } | public void METHOD_1 ( ) { METHOD_2 ( VAR_1 . METHOD_3 ( STRING_1 , VAR_2 . String class ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( ) { VAR_1 . METHOD_2 ( ) ; return VAR_1 . METHOD_1 ( ) ; } | public boolean METHOD_1 ( ) { return VAR_1 . METHOD_1 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 name , TYPE_2 VAR_1 ) { assert TYPE_3 . METHOD_2 ( name ) ; VAR_2 . put ( name . toString ( ) , VAR_1 ) ; } | public void METHOD_1 ( java.lang.String name , TYPE_2 VAR_1 ) { VAR_2 . put ( name , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. TYPE_1 < TYPE_2 , TYPE_3 > METHOD_1 ( ) { TYPE_4 VAR_1 = new TYPE_4 ( ) ; VAR_1 . METHOD_2 ( ) ; TYPE_5 VAR_2 = new TYPE_5 ( ) ; return VAR_2 ; } | TYPE_1 < TYPE_2 , TYPE_3 > METHOD_1 ( ) { TYPE_4 VAR_1 = new TYPE_4 ( ) ; VAR_1 . METHOD_2 ( ) ; TYPE_5 VAR_2 = new TYPE_5 ( VAR_1 ) ; return VAR_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.lang.String METHOD_1 ( java.lang.String str ) { java.lang.String [ ] VAR_1 = str . split ( ( STRING_1 + ( VAR_2 ) ) ) ; return VAR_1 [ 0 ] ; } | private static java.lang.String METHOD_1 ( java.lang.String str ) { java.lang.String [ ] VAR_1 = str . split ( ( STRING_1 + ( VAR_2 ) ) ) ; return VAR_1 [ 0 ] ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_1 = VAR_1 ; METHOD_2 ( ) ; METHOD_2 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { this . VAR_1 = VAR_1 ; METHOD_2 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int position ) { VAR_1 . METHOD_2 ( this . VAR_2 . get ( ( position - INT_1 ) ) ) ; } | public void METHOD_1 ( int position ) { VAR_1 . METHOD_2 ( this . VAR_2 . get ( position ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void handle ( TYPE_1 event ) { METHOD_1 ( VAR_1 , VAR_2 , VAR_3 , VAR_4 , VAR_5 ) ; VAR_6 . METHOD_2 ( new TYPE_2 ( ) ) ; } | public void handle ( TYPE_1 event ) { METHOD_1 ( VAR_1 , VAR_2 , VAR_3 , VAR_4 , VAR_5 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static void METHOD_1 ( TYPE_1 startTime , TYPE_1 endTime ) { if ( ! ( startTime . METHOD_2 ( endTime ) ) ) throw TYPE_2 . METHOD_3 ( STRING_1 , startTime , endTime ) ; } | public static void METHOD_1 ( TYPE_1 startTime , TYPE_1 endTime ) { if ( ( endTime != null ) && ( ! ( startTime . METHOD_2 ( endTime ) ) ) ) throw TYPE_2 . METHOD_3 ( STRING_1 , startTime , endTime ) ; }
|
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_2 class ) ; if ( ( VAR_1 ) != null ) METHOD_3 ( ) ; else { METHOD_4 ( ) ; } } | protected void METHOD_1 ( ) { super . METHOD_1 ( ) ; VAR_1 = TYPE_1 . METHOD_2 ( VAR_2 class ) ; METHOD_4 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( java.lang.String data , TYPE_1 VAR_1 ) throws java.io.IOException { VAR_2 = TYPE_2 . get ( ) . METHOD_2 ( this . VAR_3 , data ) ; return VAR_4 . METHOD_3 ( null , VAR_2 ) ; } | public TYPE_1 METHOD_1 ( java.lang.String data , TYPE_1 VAR_1 ) throws java.io.IOException { VAR_2 = TYPE_2 . get ( ) . METHOD_2 ( this . VAR_3 , data , true ) ; return VAR_4 . METHOD_3 ( null , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_2 VAR_2 = new TYPE_2 ( this ) ; VAR_2 . METHOD_2 ( ) ; VAR_2 . METHOD_3 ( ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { super . METHOD_1 ( VAR_1 ) ; TYPE_2 VAR_2 = new TYPE_2 ( this ) ; VAR_2 . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 ) ; VAR_2 = TYPE_2 . METHOD_3 ( VAR_3 ) . METHOD_4 ( true ) . build ( ) ; } | public void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( VAR_1 ) ; VAR_2 = TYPE_2 . METHOD_3 ( VAR_3 ) . build ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( int id ) { return ( id < ( this . VAR_1 . size ( ) ) ) && ( id >= 0 ) ; } | private boolean METHOD_1 ( int id ) { if ( id >= 0 ) return true ; return false ; }
|
The following code may contain bugs. Write a refined code without bugs. private boolean METHOD_1 ( ) { if ( ( METHOD_2 ( ) ) && ( ( VAR_1 ) == ( VAR_2 ) ) ) { TYPE_1 . METHOD_3 ( VAR_3 , STRING_1 ) ; return true ; } return false ; } | private boolean METHOD_1 ( ) { if ( ( METHOD_2 ( ) ) && ( ( VAR_1 ) == ( VAR_2 ) ) ) { return true ; } return false ; }
|
The following code may contain bugs. Write a refined code without bugs. public double METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { return java.lang.Double . METHOD_2 ( ( ( java.lang.String ) ( VAR_2 [ VAR_3 . METHOD_3 ( VAR_1 ) ] ) ) ) ; } | public double METHOD_1 ( java.lang.String VAR_1 ) throws TYPE_1 { return ( ( java.lang.Double ) ( VAR_2 [ VAR_3 . METHOD_3 ( VAR_1 ) ] ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 . i ( VAR_2 , ( ( ( STRING_1 + VAR_1 ) + STRING_2 ) + ( this . VAR_1 ) ) ) ; if ( VAR_1 != null ) { this . VAR_1 = VAR_1 ; } } | public void METHOD_1 ( java.lang.String VAR_1 ) { TYPE_1 . i ( VAR_2 , ( ( ( STRING_1 + VAR_1 ) + STRING_2 ) + ( this . VAR_1 ) ) ) ; this . VAR_1 = VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. private java.lang.String METHOD_1 ( java.lang.String url ) { java.lang.String VAR_1 = METHOD_2 ( url ) ; return url . replace ( VAR_1 , STRING_1 ) ; } | private java.lang.String METHOD_1 ( java.lang.String url ) { java.lang.String VAR_1 = METHOD_2 ( url ) ; if ( VAR_1 == null ) { url = STRING_1 ; } else { url = url . replace ( VAR_1 , STRING_1 ) ; } return url ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( int VAR_1 , TYPE_1 VAR_2 ) { if ( ( VAR_3 ) != null ) { VAR_3 . METHOD_1 ( VAR_1 , VAR_2 ) ; } } | public void METHOD_1 ( int VAR_1 , TYPE_1 VAR_2 ) { super . METHOD_1 ( VAR_1 , VAR_2 ) ; if ( ( VAR_3 ) != null ) { VAR_3 . METHOD_1 ( VAR_1 , VAR_2 ) ; } }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 < TYPE_2 > METHOD_1 ( TYPE_3 < ? super TYPE_2 > VAR_1 ) { METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( VAR_1 ) ; } | public boolean METHOD_1 ( TYPE_3 < ? super TYPE_2 > VAR_1 ) { return METHOD_2 ( ) . METHOD_3 ( ) . METHOD_4 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. protected boolean METHOD_1 ( java.lang.String query ) { if ( query == null ) { return true ; } return ! ( TYPE_1 . METHOD_2 ( query ) . METHOD_3 ( ) ) ; } | protected boolean METHOD_1 ( java.lang.String query ) { if ( query == null ) { return true ; } return TYPE_1 . METHOD_2 ( query ) . METHOD_3 ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void error ( long VAR_1 , java.lang.String VAR_2 , java.lang.Object ... VAR_3 ) { this . METHOD_1 ( VAR_4 , VAR_2 , VAR_1 , VAR_3 ) ; } | public boolean error ( long VAR_1 , java.lang.String VAR_2 , java.lang.Object ... VAR_3 ) { return this . METHOD_1 ( VAR_4 , VAR_2 , VAR_1 , VAR_3 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) throws java.io.IOException { TYPE_1 . METHOD_2 ( TYPE_1 . METHOD_3 ( ) , TYPE_2 . get ( STRING_1 ) ) ; METHOD_1 ( TYPE_1 . METHOD_3 ( ) , TYPE_1 : : METHOD_2 , TYPE_1 : : METHOD_4 , VAR_1 ) ; } | public void METHOD_1 ( ) throws java.io.IOException { METHOD_1 ( TYPE_1 . METHOD_3 ( ) , TYPE_1 : : METHOD_2 , TYPE_1 : : METHOD_4 , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { time = 0 ; VAR_1 = 0 ; VAR_2 = 0 ; } | public void METHOD_1 ( ) { time = 0 ; VAR_1 = 0 ; VAR_2 = new java.util.Date ( ) . getTime ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( final int VAR_1 ) { return ( ( int ) ( ( TYPE_1 . METHOD_2 ( ( VAR_1 / FLOAT_1 ) ) ) * FLOAT_1 ) ) ; } | public static int METHOD_1 ( final int VAR_1 ) { return ( ( int ) ( java.lang.Math.round ( ( ( TYPE_1 . METHOD_2 ( ( VAR_1 / FLOAT_1 ) ) ) * FLOAT_1 ) ) ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { METHOD_2 ( ) ; TYPE_1 c = VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_2 = c ; return ( STRING_1 + ( id ) ) + STRING_2 ; } | public java.lang.String METHOD_1 ( ) { METHOD_2 ( ) ; TYPE_1 c = VAR_1 . METHOD_3 ( VAR_2 ) ; VAR_2 = c ; return ( STRING_1 + ( VAR_2 . getId ( ) ) ) + STRING_2 ; }
|
The following code may contain bugs. Write a refined code without bugs. public boolean METHOD_1 ( ) { return ! ( VAR_1 . METHOD_2 ( STRING_1 ) . contains ( "unchecked" ) ) ; } | public boolean METHOD_1 ( ) { java.lang.System.out.println ( VAR_1 . METHOD_2 ( STRING_1 ) ) ; return ! ( VAR_1 . METHOD_2 ( STRING_1 ) . contains ( "unchecked" ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void delete ( java.lang.String VAR_1 , TYPE_1 VAR_2 , TYPE_2 response ) { delete ( VAR_1 , VAR_2 , null , response ) ; } | public void delete ( java.lang.String VAR_1 , java.lang.String VAR_2 , TYPE_2 response ) { delete ( VAR_1 , new TYPE_1 ( VAR_2 ) , null , response ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { TYPE_2 . METHOD_2 ( ( ) - > { TYPE_3 VAR_2 = ( ( TYPE_3 ) ( VAR_3 . METHOD_3 ( ) . METHOD_4 ( ) ) ) ; VAR_2 . METHOD_5 ( ) ; } ) ; } | public void METHOD_1 ( TYPE_1 event ) { TYPE_2 . METHOD_2 ( ( ) - > { TYPE_3 VAR_2 = ( ( TYPE_3 ) ( VAR_3 . METHOD_3 ( ) . METHOD_4 ( ) ) ) ; VAR_2 . METHOD_5 ( ) ; } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( long VAR_1 ) { TYPE_1 VAR_2 = METHOD_2 ( STRING_1 , VAR_3 ) ; TYPE_2 VAR_4 = VAR_2 . METHOD_3 ( ) ; VAR_4 . METHOD_4 ( STRING_2 , VAR_1 ) ; VAR_4 . commit ( ) ; } | private void METHOD_1 ( long VAR_1 ) { TYPE_2 VAR_4 = VAR_2 . METHOD_3 ( ) ; VAR_4 . METHOD_4 ( STRING_2 , VAR_1 ) ; VAR_4 . commit ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 [ ] METHOD_1 ( java.lang.Object ... args ) { return null ; } | public TYPE_1 [ ] METHOD_1 ( java.lang.Object ... args ) { if ( args instanceof TYPE_1 [ ] ) { return ( ( TYPE_1 [ ] ) ( args ) ) ; } return null ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { switch ( VAR_2 ) { case VAR_3 : java.lang.System.out.println ( STRING_1 ) ; break ; default : break ; } VAR_4 . METHOD_2 ( VAR_2 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_4 . METHOD_2 ( VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . add ( VAR_3 ) ; VAR_4 = VAR_2 . get ( 0 ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_4 = VAR_2 . get ( 0 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public static int METHOD_1 ( int VAR_1 , int VAR_2 ) { return ( ( VAR_1 / VAR_2 ) * INT_1 ) - 1 ; } | public static double METHOD_1 ( double VAR_1 , int VAR_2 ) { return ( ( VAR_1 / ( VAR_2 - 1 ) ) * INT_1 ) - 1 ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( ) { METHOD_2 ( new TYPE_1 ( ) { public void METHOD_3 ( ) { VAR_1 . METHOD_4 ( ) ; } } ) ; } | private void METHOD_1 ( ) { if ( ( VAR_1 ) == null ) { return ; } METHOD_2 ( new TYPE_1 ( ) { public void METHOD_3 ( ) { VAR_1 . METHOD_4 ( ) ; } } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( java.lang.String name , java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 ) { return METHOD_1 ( name , VAR_1 , VAR_2 , VAR_3 , true ) ; } | public java.lang.String METHOD_1 ( java.lang.String name , java.lang.String VAR_1 , java.lang.String VAR_2 , java.lang.String VAR_3 ) { return METHOD_1 ( name , VAR_1 , VAR_2 , VAR_3 , true , false ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . add ( VAR_1 ) ; METHOD_2 ( VAR_1 . METHOD_3 ( ) ) ; } | public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . add ( VAR_1 ) ; METHOD_2 ( VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String VAR_1 , final java.util.Set < java.lang.String > VAR_2 ) { final TYPE_1 VAR_3 = METHOD_2 ( ) ; VAR_3 . METHOD_1 ( VAR_1 , VAR_2 ) ; VAR_3 . METHOD_3 ( ) . METHOD_4 ( ) ; } | public void METHOD_1 ( java.lang.String VAR_1 , final java.util.Set < java.lang.String > VAR_2 ) { final TYPE_1 VAR_3 = METHOD_2 ( ) ; VAR_3 . METHOD_1 ( VAR_1 , VAR_2 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( java.lang.String name ) { TYPE_1 VAR_1 = new TYPE_1 ( name ) ; VAR_2 . add ( VAR_1 ) ; VAR_3 . add ( VAR_1 ) ; } | public void METHOD_1 ( java.lang.String name ) { TYPE_1 VAR_1 = new TYPE_1 ( name ) ; VAR_2 . add ( VAR_1 ) ; VAR_3 . add ( ( ( VAR_3 . size ( ) ) - 1 ) , VAR_1 ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( TYPE_1 VAR_1 ) { VAR_2 . remove ( METHOD_2 ( VAR_1 ) ) ; } | public void METHOD_1 ( int VAR_1 ) { VAR_2 . remove ( METHOD_2 ( VAR_1 ) ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.lang.String METHOD_1 ( ) { if ( ( b ) == null ) { return "0" ; } return b ; } | public java.lang.String METHOD_1 ( ) { return b ; }
|
The following code may contain bugs. Write a refined code without bugs. public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( ) ; VAR_1 . METHOD_3 ( true ) ; VAR_1 . METHOD_4 ( false ) ; return VAR_1 ; } | public TYPE_1 METHOD_1 ( ) { TYPE_1 VAR_1 = METHOD_2 ( ) ; VAR_1 . METHOD_3 ( true ) ; VAR_1 . METHOD_4 ( true ) ; return VAR_1 ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { super . METHOD_1 ( ) ; TYPE_1 . METHOD_2 ( STRING_1 , STRING_2 ) ; VAR_1 . METHOD_3 ( STRING_3 ) ; VAR_1 . METHOD_4 ( false ) ; VAR_1 . show ( ) ; } | public void METHOD_1 ( ) { super . METHOD_1 ( ) ; VAR_1 . METHOD_3 ( STRING_3 ) ; VAR_1 . METHOD_4 ( false ) ; VAR_1 . show ( ) ; }
|
The following code may contain bugs. Write a refined code without bugs. private void METHOD_1 ( int VAR_1 , final TYPE_1 listener ) { METHOD_2 ( ) ; METHOD_3 ( VAR_1 , new TYPE_1 ( ) { public void METHOD_4 ( ) { METHOD_5 ( VAR_2 , listener ) ; } } ) ; } | public void METHOD_1 ( int VAR_1 , final TYPE_1 listener ) { METHOD_2 ( ) ; METHOD_3 ( VAR_1 , new TYPE_1 ( ) { public void METHOD_4 ( ) { METHOD_5 ( VAR_2 , listener ) ; } } ) ; }
|
The following code may contain bugs. Write a refined code without bugs. public java.util.Collection METHOD_1 ( TYPE_1 VAR_1 ) throws TYPE_2 { java.lang.String VAR_2 = ( STRING_1 + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_2 ; return TYPE_3 . METHOD_1 ( VAR_2 , VAR_3 . METHOD_3 ( ) ) ; } | public java.util.Collection METHOD_1 ( TYPE_1 VAR_1 ) throws TYPE_2 { java.lang.String VAR_2 = ( STRING_1 + ( VAR_1 . METHOD_2 ( ) ) ) + STRING_2 ; return null ; }
|
The following code may contain bugs. Write a refined code without bugs. public void METHOD_1 ( ) { METHOD_2 ( false , view , VAR_1 ) ; } | public void METHOD_1 ( ) { METHOD_2 ( false , false , view , VAR_1 ) ; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.