-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialization of Type Change Suggestions for Type Violations. #517
Changes from 7 commits
a55d27f
a3a45e2
a63fe2a
572725a
64c9daa
8dbc0d7
eeb94f3
b7e395a
ba20acd
d487942
d8d320b
53d3722
79dcea5
1a01457
047ebdf
c8875ab
dac44ae
b9343d2
61b6b13
0577229
956d3c5
337cf92
2a15052
53d4873
1e949b6
cf63081
4c354a1
f83e92d
d8a9c72
4136794
0443772
86e1780
0f891e2
2dc0618
891532d
fb63953
e10fa96
62455f0
970af1b
a0b23b2
512465b
155431a
757ccb3
6065b20
962b037
5eb78bf
9fc19b5
bc60d34
3273675
5e3c4c4
3620624
d72989e
eca5598
301f045
f42ef3c
4705617
dbaa2f6
06f0e8b
8234a2b
bd006b0
3772d54
406a85c
adc6165
4b4d455
79d443f
b39089a
e4914aa
6184f04
24f340d
36d1095
de0b338
f61c5c0
9e18f70
d9a957c
7dacef4
94334b9
952a9ea
8f2079f
97bee30
cde273c
99a22f0
f824f25
305daf3
efc3cb7
e89d1ee
2ca191b
3a957f4
78a30e9
15f743d
322d997
07be0be
501675e
27af317
96a2620
5bf6df1
cbd0c84
2c90b12
707b6ad
1913a0f
fe8a3c7
60955eb
b648799
51fe625
cd5bfcc
0cd2450
71b75c4
8a4e8f7
2664ff2
2db08ab
15d93b0
fadc5d8
ed79959
4d1fc0d
cafa0ed
70bd7aa
846255f
38853f9
e168bf2
0bb7581
e181f65
55f0a2d
56e3a9a
4bd6e1e
871af2a
cb44027
fcf8344
bd570e8
5b4c3c4
52ec612
c722852
19fa64a
37ef1b1
4eb83dd
c79c438
bf68c2d
0af0ac7
5207bf5
79c1f6c
49e3b2d
411718d
de094db
db12b59
b2411af
41833d9
f2c044f
3c22394
732f7ad
3751dcf
a8d32ab
7771f12
c587e70
7e9e267
523de30
fa36d6c
7bad2b3
d145541
d70c817
5e2b989
9960615
4ceb827
9111438
a9746be
213108e
c7b3d55
79d59c5
04a65bd
0865072
b68ac14
031bae1
0c3f775
ed8ee93
a05aa6a
8ec01ad
1330dc9
20f6218
458947f
bec0b95
288dfdd
e215939
fc0f692
1fb38f3
56e22d3
f9b2276
c7398ca
48b092d
6088d2c
14c1a4f
966d4fd
21f5ea8
cec2fa5
a8010cf
9b0bbef
8f602d0
e24a8f6
9906b53
8e93d0b
cff3428
7d223c8
f0c9470
e2ee6b3
7117c41
3c865bc
3a267d1
222f6e6
91f19cd
ca4987d
cc23c7f
77aecc2
b909c3e
cb06464
15dbd13
0c161cf
71d2fa8
98f09db
750ff31
255bc60
0c89e5e
f4f1a84
926e1b8
a68290d
cb7a92c
b60540c
c8b7d2d
cf3d6d9
63f31a3
f509702
c0c5c81
415a7df
76eb3ab
8ae1004
3c1e8dc
f7bf102
5997ae3
9dfa553
e398a94
275c31e
7271a3e
89b2f5d
99061e7
e86e2a3
3e8071c
e649145
f69c5cf
ccb5dfc
5ef177a
798b7aa
168b88a
b144824
9499ce3
0602a68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,20 +97,24 @@ private void compareFixes(FixDisplay[] outputFixDisplays) { | |
if (notFound.size() == 0 && output.size() == 0) { | ||
return; | ||
} | ||
StringBuilder errorMessage = new StringBuilder(); | ||
if (notFound.size() != 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMPORTANT: Ok, I actually think the code below is a regression. If both To this end, I'd probably build the string in two parts (first if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
fail( | ||
notFound.size() | ||
+ " expected fix suggestions were NOT found:" | ||
+ "\n" | ||
+ notFound.stream().map(FixDisplay::toString).collect(Collectors.toList()) | ||
+ "\n"); | ||
errorMessage | ||
.append(notFound.size()) | ||
.append(" expected fix suggestions were NOT found:") | ||
.append("\n") | ||
.append(notFound.stream().map(FixDisplay::toString).collect(Collectors.toList())) | ||
.append("\n"); | ||
} | ||
fail( | ||
output.size() | ||
+ " unexpected fix(s) suggestions were found:" | ||
+ "\n" | ||
+ output.stream().map(FixDisplay::toString).collect(Collectors.toList()) | ||
+ "\n"); | ||
if (output.size() != 0) { | ||
errorMessage | ||
.append(output.size()) | ||
.append(" unexpected fix(s) suggestions were found:") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't need the |
||
.append("\n") | ||
.append(output.stream().map(FixDisplay::toString).collect(Collectors.toList())) | ||
.append("\n"); | ||
} | ||
fail(errorMessage.toString()); | ||
} | ||
|
||
private FixDisplay[] readOutputFixes() { | ||
|
@@ -123,7 +127,7 @@ private FixDisplay[] readOutputFixes() { | |
fail( | ||
"Expected header of fixes.tsv to be: " | ||
+ SuggestedFixInfo.header() | ||
+ "\bBut found: " | ||
+ "\nBut found: " | ||
+ header); | ||
} | ||
String line = reader.readLine(); | ||
|
@@ -137,8 +141,7 @@ private FixDisplay[] readOutputFixes() { | |
} | ||
reader.close(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
throw new RuntimeException("Error happened in reading the fixDisplays."); | ||
throw new RuntimeException("Error happened in reading the fixDisplays.", e); | ||
} | ||
return fixDisplays.toArray(new FixDisplay[0]); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we merge these two ifs and nest the
nonNullTarget != null
check? Just to separate out the full logic about serialization. Probably also worth a brief comment about which config flag this whole process is guarded by.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
98f09db
Merged and some more refactoring, looks a lot more clear now.