CoolFace
Apppublic

HaofanWen/causal_debugging_agent

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
debug_dataset.jsonl21 linesDownload Raw Back to bug_data
1{"task_id": "codefix-00001", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public java.util.List < TYPE_1 > METHOD_1 ( ) { java.util.ArrayList < TYPE_1 > VAR_1 = new java.util.ArrayList < TYPE_1 > ( ) ; for ( TYPE_2 VAR_2 : VAR_3 ) { VAR_1 . METHOD_2 ( VAR_2 . METHOD_1 ( ) ) ; } return VAR_1 ; }", "Final answer": "public java.util.List<TYPE_1> METHOD_1() { java.util.List<TYPE_1> VAR_1 = new java.util.ArrayList<>(); for (TYPE_2 VAR_2 : VAR_3) { VAR_1.add(VAR_2.METHOD_1()); } return VAR_1; }"}2{"task_id": "codefix-00002", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "protected TYPE_1 < TYPE_2 > METHOD_1 ( int VAR_1 ) { this . VAR_1 += VAR_1 ; return null ; }", "Final answer": "@SuppressWarnings(\"unchecked\")\nprotected TYPE_1<TYPE_2> METHOD_1(int VAR_1) {\n    this.VAR_1 += VAR_1;\n    return (TYPE_1<TYPE_2>) this;\n}"}3{"task_id": "codefix-00003", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( java.lang.String path , java.util.Map < ? , ? > type ) { getConfig ( ) . set ( path , type ) ; }", "Final answer": "public void METHOD_1(String path, java.util.Map<?, ?> type) { getConfig().set(path, type); }"}4{"task_id": "codefix-00004", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( TYPE_1 VAR_1 , TYPE_2 VAR_2 , java.lang.String VAR_3 , int VAR_4 ) { METHOD_2 ( VAR_2 , VAR_3 , VAR_4 ) ; }", "Final answer": "public void METHOD_1(TYPE_1 VAR_1, TYPE_2 VAR_2, java.lang.String VAR_3, int VAR_4) { METHOD_2(VAR_1, VAR_2, VAR_3, VAR_4); }"}5{"task_id": "codefix-00005", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "private static boolean isEmpty ( TYPE_1 < ? > VAR_1 ) { return VAR_1 instanceof java.util.Collection ? ( ( java.util.Collection < ? > ) ( VAR_1 ) ) . isEmpty ( ) : VAR_1 . iterator ( ) . METHOD_1 ( ) ; }", "Final answer": "private static boolean isEmpty(Iterable<?> VAR_1) { if (VAR_1 instanceof Collection) { return ((Collection<?>) VAR_1).isEmpty(); } else { return !VAR_1.iterator().hasNext(); } }"}6{"task_id": "codefix-00006", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "private int METHOD_1 ( ) { return java.lang.Integer . METHOD_2 ( VAR_1 . getText ( ) . toString ( ) ) ; }", "Final answer": "private int METHOD_1() { return Integer.parseInt(VAR_1.getText().toString()); }"}7{"task_id": "codefix-00007", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "private boolean METHOD_1 ( java.lang.Class < ? > VAR_1 ) { return ( VAR_1 != ( VAR_2 class ) ) && ( VAR_3 class . METHOD_2 ( VAR_1 ) ) ; }", "Final answer": "private boolean METHOD_1(Class<?> VAR_1) { return (VAR_1 != VAR_2.class) && VAR_3.class.isAssignableFrom(VAR_1); }"}8{"task_id": "codefix-00008", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "protected void METHOD_1 ( TYPE_1 result ) { if ( ( VAR_1 ) != null ) { VAR_1 . METHOD_2 ( ) ; } }", "Final answer": "protected void METHOD_1(TYPE_1 result) { if (result != null) { result.METHOD_2(); } }"}9{"task_id": "codefix-00009", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( ) throws TYPE_1 { java.lang.String type = STRING_1 ; java.lang.Object obj = TYPE_2 . METHOD_2 ( type ) ; }", "Final answer": "public void METHOD_1() throws TYPE_1 { String type = STRING_1; Object obj = TYPE_2.METHOD_2(type); }"}10{"task_id": "codefix-00010", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "private void METHOD_1 ( ) { TYPE_1 VAR_1 = VAR_2 . METHOD_2 ( ) ; VAR_1 . METHOD_3 ( TYPE_2 . METHOD_4 ( STRING_1 ) , VAR_3 ) ; }", "Final answer": "private void METHOD_1() { TYPE_1 VAR_1 = VAR_2.METHOD_2(); if (VAR_1 != null && VAR_3 != null) { VAR_1.METHOD_3(TYPE_2.METHOD_4(STRING_1), VAR_3); } }"}11{"task_id": "codefix-00011", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( java.lang.Throwable VAR_1 ) { TYPE_1 . error ( ( STRING_1 + name ) ) ; METHOD_2 ( ) ; }", "Final answer": "public void METHOD_1(Throwable VAR_1) { TYPE_1.error(STRING_1 + VAR_1.getMessage()); METHOD_2(); }"}12{"task_id": "codefix-00012", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public static void METHOD_1 ( TYPE_1 VAR_1 , int VAR_2 ) { android.content.Intent intent = new android.content.Intent ( VAR_1 . getContext ( ) , VAR_3 class ) ; VAR_1 . METHOD_2 ( intent , VAR_2 ) ; }", "Final answer": "public static void METHOD_1(TYPE_1 VAR_1, int VAR_2) { android.content.Intent intent = new android.content.Intent(VAR_1.getContext(), VAR_3.class); VAR_1.METHOD_2(intent, VAR_2); }"}13{"task_id": "codefix-00013", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( android.view.View VAR_1 ) { TYPE_1 VAR_2 = TYPE_1 . METHOD_2 ( ) ; if ( ! ( VAR_3 . METHOD_3 ( ) ) ) { VAR_3 . METHOD_4 ( ) ; } TYPE_2 . METHOD_5 ( ) ; }", "Final answer": "public void METHOD_1(android.view.View VAR_1) { TYPE_1 VAR_2 = TYPE_1.METHOD_2(); if (!VAR_3.METHOD_3()) { VAR_3.METHOD_4(); } TYPE_2.METHOD_5(); }"}14{"task_id": "codefix-00014", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public TYPE_1 METHOD_1 ( TYPE_2 src , TYPE_3 VAR_1 , TYPE_4 context ) { if ( src == null ) { return null ; } return new TYPE_5 ( TYPE_6 . METHOD_1 ( src ) ) ; }", "Final answer": "public TYPE_1 METHOD_1(TYPE_2 src, TYPE_3 VAR_1, TYPE_4 context) { if (src == null) { return null; } return new TYPE_5(TYPE_6.METHOD_1(src)); }"}15{"task_id": "codefix-00015", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public static void METHOD_1 ( ) { TYPE_1 . METHOD_2 ( ) . METHOD_3 ( VAR_1 , \"false\" ) ; }", "Final answer": "public static void METHOD_1(SomeType VAR_1) { TYPE_1.METHOD_2().METHOD_3(VAR_1, \"false\"); }"}16{"task_id": "codefix-00016", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( ) { TYPE_1 VAR_1 = ( ( TYPE_1 ) ( this . METHOD_2 ( ) ) ) ; VAR_1 . METHOD_3 ( this ) ; VAR_1 . METHOD_4 ( this , 0 ) ; }", "Final answer": "public void METHOD_1() { Object obj = this.METHOD_2(); if (obj instanceof TYPE_1) { TYPE_1 VAR_1 = (TYPE_1) obj; VAR_1.METHOD_3(this); VAR_1.METHOD_4(this, 0); } }"}17{"task_id": "codefix-00017", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "private void METHOD_1 ( ) { getView ( ) . METHOD_2 ( ) . setText ( VAR_1 . getText ( ) ) ; java.lang.System.err.println ( ( ( VAR_1 . getText ( ) ) + STRING_1 ) ) ; }", "Final answer": "private void METHOD_1() { CharSequence text = VAR_1.getText(); getView().METHOD_2().setText(text); System.err.println(text + STRING_1); }"}18{"task_id": "codefix-00018", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public TYPE_1 METHOD_1 ( ) { return this . VAR_1 = VAR_2 . METHOD_2 ( ) ; }", "Final answer": "public TYPE_1 METHOD_1() { this.VAR_1 = VAR_2.METHOD_2(); return this.VAR_1; }"}19{"task_id": "codefix-00019", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public boolean METHOD_1 ( ) { assert ( VAR_1 ) != false ; assert ( VAR_2 ) != null ; return VAR_3 . METHOD_2 ( VAR_4 ) . METHOD_3 ( VAR_2 ) ; }", "Final answer": "public boolean METHOD_1() { assert VAR_1; assert VAR_2 != null; return VAR_3.METHOD_2(VAR_4).METHOD_3(VAR_2); }"}20{"task_id": "codefix-00020", "type": "code_repair", "language": "java", "file_name": "", "Question": "Fix the following buggy Java function.", "code": "public void METHOD_1 ( TYPE_1 listener ) { synchronized ( VAR_1 ) { VAR_2 . remove ( listener ) ; } }", "Final answer": "public void METHOD_1(TYPE_1 listener) { synchronized (VAR_2) { VAR_2.remove(listener); } }"}21