File size: 4,490 Bytes
fdf294b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
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.