| --- |
| language: |
| - code |
| license: apache-2.0 |
| task_categories: |
| - text-generation |
| tags: |
| - code |
| - refactoring |
| - java |
| - benchmark |
| --- |
| |
| # Java Refactoring Benchmark |
|
|
| ## Task |
| Given a Java source file before a refactoring and the refactoring type, produce the refactored file. |
|
|
| ## Schema |
| - `instance_id` — unique identifier |
| - `repo` — GitHub repo (owner/name) |
| - `language` — "java" |
| - `base_commit` — parent SHA (before state) |
| - `merge_commit` — commit where refactoring was applied |
| - `refactoring_types` — list of RefactoringMiner type names detected in this commit |
| - `refactoring_descriptions` — corresponding human-readable descriptions |
| - `file_path` — primary changed Java file (most lines changed) |
| - `source_code_before` — full file content before refactoring |
| - `source_code_after` — full file content after refactoring (ground truth) |
| - `diff` — full unified diff of the commit (all changed files) |
| - `is_pure_refactoring` — null = not yet checked; true = no extraneous changes |
| - `compile_before` / `compile_after` — null = not yet verified |
| - `PASS_TO_PASS` / `FAIL_TO_PASS` — null = not yet verified |
| - `created_at` — commit timestamp (ISO 8601) |
| - `repo_license` — SPDX license of the source repo |
| - `lines_changed` — total lines changed in the commit |
|
|
| ## Split |
| - `test`: 5857 instances from 23 repos |
|
|
| ## Refactoring types |
| { |
| "Change Variable Type": 2443, |
| "Add Method Annotation": 2338, |
| "Change Return Type": 1690, |
| "Change Parameter Type": 1595, |
| "Extract Method": 1398, |
| "Add Parameter": 1351, |
| "Rename Method": 1306, |
| "Extract Variable": 1283, |
| "Change Method Access Modifier": 1183, |
| "Rename Variable": 1089, |
| "Remove Method Annotation": 1018, |
| "Change Attribute Type": 957, |
| "Rename Parameter": 852, |
| "Remove Thrown Exception Type": 738, |
| "Add Attribute Modifier": 656, |
| "Remove Parameter": 611, |
| "Inline Variable": 595, |
| "Extract And Move Method": 586, |
| "Change Attribute Access Modifier": 572, |
| "Rename Attribute": 517, |
| "Move Method": 510, |
| "Add Class Annotation": 419, |
| "Pull Up Method": 392, |
| "Encapsulate Attribute": 310, |
| "Modify Method Annotation": 287, |
| "Move Class": 282, |
| "Add Attribute Annotation": 270, |
| "Add Method Modifier": 263, |
| "Add Thrown Exception Type": 238, |
| "Rename Class": 235, |
| "Change Class Access Modifier": 224, |
| "Modify Class Annotation": 213, |
| "Replace Variable With Attribute": 212, |
| "Remove Attribute Modifier": 211, |
| "Inline Method": 207, |
| "Move Code": 196, |
| "Remove Class Annotation": 192, |
| "Parameterize Variable": 186, |
| "Add Parameter Modifier": 185, |
| "Pull Up Attribute": 182, |
| "Invert Condition": 175, |
| "Remove Method Modifier": 174, |
| "Add Parameter Annotation": 168, |
| "Move Attribute": 155, |
| "Extract Attribute": 154, |
| "Add Variable Modifier": 148, |
| "Extract Class": 144, |
| "Remove Attribute Annotation": 142, |
| "Move And Rename Method": 133, |
| "Change Thrown Exception Type": 128, |
| "Move And Inline Method": 128, |
| "Push Down Method": 127, |
| "Remove Parameter Modifier": 109, |
| "Assert Throws": 105, |
| "Remove Parameter Annotation": 90, |
| "Replace Generic With Diamond": 90, |
| "Replace Attribute With Variable": 84, |
| "Move And Rename Class": 81, |
| "Move Source Folder": 81, |
| "Localize Parameter": 80, |
| "Merge Conditional": 80, |
| "Add Class Modifier": 71, |
| "Split Conditional": 70, |
| "Replace Anonymous With Lambda": 59, |
| "Remove Class Modifier": 57, |
| "Extract Superclass": 56, |
| "Remove Variable Modifier": 55, |
| "Extract Fixture": 52, |
| "Replace Conditional With Ternary": 48, |
| "Inline Attribute": 43, |
| "Modify Attribute Annotation": 41, |
| "Replace Anonymous With Class": 37, |
| "Try With Resources": 32, |
| "Change Type Declaration Kind": 31, |
| "Merge Parameter": 28, |
| "Push Down Attribute": 25, |
| "Extract Interface": 24, |
| "Parameterize Attribute": 23, |
| "Reorder Parameter": 23, |
| "Split Parameter": 20, |
| "Split Method": 16, |
| "Rename Package": 14, |
| "Merge Variable": 14, |
| "Move And Rename Attribute": 13, |
| "Extract Subclass": 12, |
| "Move Package": 11, |
| "Replace Loop With Pipeline": 10, |
| "Replace Pipeline With Loop": 10, |
| "Parameterize Test": 9, |
| "Remove Variable Annotation": 9, |
| "Merge Attribute": 9, |
| "Merge Catch": 9, |
| "Split Attribute": 8, |
| "Add Variable Annotation": 7, |
| "Modify Parameter Annotation": 6, |
| "Replace Conditional With Assumption": 6, |
| "Merge Class": 5, |
| "Replace Attribute": 5, |
| "Collapse Hierarchy": 4, |
| "Merge Method": 3, |
| "Split Class": 2, |
| "Split Variable": 1 |
| } |
|
|
| ## Detection |
| Mined using RefactoringMiner 3.1.3. |
|
|