Skip to content

Commit 6bc57a2

Browse files
Praveen7294romani
authored andcommitted
Issue #933: Rename CatchParameterName in patch-diff-report-tool
1 parent b7d07d8 commit 6bc57a2

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

patch-diff-report-tool/src/main/java/com/github/checkstyle/parser/CheckstyleConfigurationsParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ private static ConfigurationModule parseConfiguration(Path xml, String rootName)
125125
final XMLEventReader reader = StaxUtils.createReader(xml);
126126
parseModule(reader, root);
127127
}
128-
catch (XMLStreamException ex) {
129-
throw new XMLStreamException("Exception was thrown while processing: " + xml, ex);
128+
catch (XMLStreamException exc) {
129+
throw new XMLStreamException("Exception was thrown while processing: " + xml, exc);
130130
}
131131
return root;
132132
}

patch-diff-report-tool/src/main/java/com/github/checkstyle/site/TextTransform.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ public void transform(String sourceFile, String destFile, Locale outputLocale,
130130
try {
131131
reader.close();
132132
}
133-
catch (IOException ex) {
134-
ex.printStackTrace();
133+
catch (IOException exc) {
134+
exc.printStackTrace();
135135
}
136136
}
137137
if (writer != null) {
138138
try {
139139
writer.close();
140140
}
141-
catch (IOException ex) {
142-
ex.printStackTrace();
141+
catch (IOException exc) {
142+
exc.printStackTrace();
143143
}
144144
}
145145
}

patch-diff-report-tool/src/main/java/com/github/checkstyle/site/XrefGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public final String generateXref(String name, boolean shortFilePaths) {
144144
ENCODING, ENCODING, null, "", "");
145145
}
146146
// -@cs[IllegalCatch] We need to catch all exceptions from JXR
147-
catch (Exception ex) {
147+
catch (Exception exc) {
148148
try {
149149
textTransform.transform(sourceFile.getAbsolutePath(),
150150
dest.toString(), Locale.ENGLISH,

patch-diff-report-tool/src/test/java/com/github/checkstyle/CliArgsValidatorTest.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public void testNoPatchReportPath() throws Exception {
3535
try {
3636
Main.main();
3737
}
38-
catch (IllegalArgumentException ex) {
38+
catch (IllegalArgumentException exc) {
3939
Assert.assertEquals("obligatory argument --patchReportPath not present, -h for help",
40-
ex.getMessage());
40+
exc.getMessage());
4141
}
4242
}
4343

@@ -46,8 +46,8 @@ public void testInvalidBaseReportPath() throws Exception {
4646
try {
4747
Main.main("-baseReport", "test", "-patchReport", VALID_BASE_REPORT_EMPTY);
4848
}
49-
catch (IllegalArgumentException ex) {
50-
Assert.assertEquals("Base XML Report file doesn't exist: test", ex.getMessage());
49+
catch (IllegalArgumentException exc) {
50+
Assert.assertEquals("Base XML Report file doesn't exist: test", exc.getMessage());
5151
}
5252
}
5353

@@ -56,8 +56,8 @@ public void testInvalidPatchReportPath() throws Exception {
5656
try {
5757
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport", "test");
5858
}
59-
catch (IllegalArgumentException ex) {
60-
Assert.assertEquals("Patch XML Report file doesn't exist: test", ex.getMessage());
59+
catch (IllegalArgumentException exc) {
60+
Assert.assertEquals("Patch XML Report file doesn't exist: test", exc.getMessage());
6161
}
6262
}
6363

@@ -67,9 +67,9 @@ public void testBatchPatchReportSamePath() throws Exception {
6767
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport",
6868
VALID_BASE_REPORT_EMPTY);
6969
}
70-
catch (IllegalArgumentException ex) {
70+
catch (IllegalArgumentException exc) {
7171
Assert.assertEquals("Both Base and Patch XML report files have the same path.",
72-
ex.getMessage());
72+
exc.getMessage());
7373
}
7474
}
7575

@@ -79,8 +79,8 @@ public void testInvalidOutputPath() throws Exception {
7979
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport",
8080
VALID_PATCH_REPORT_EMPTY, "-output", "pom.xml");
8181
}
82-
catch (IllegalArgumentException ex) {
83-
Assert.assertEquals("Output path is not a directory: pom.xml", ex.getMessage());
82+
catch (IllegalArgumentException exc) {
83+
Assert.assertEquals("Output path is not a directory: pom.xml", exc.getMessage());
8484
}
8585
}
8686

@@ -90,8 +90,8 @@ public void testInvalidRefFilesPath() throws Exception {
9090
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport",
9191
VALID_PATCH_REPORT_EMPTY, "-refFiles", "pom.xml");
9292
}
93-
catch (IllegalArgumentException ex) {
94-
Assert.assertEquals("Ref Files path is not a directory: pom.xml", ex.getMessage());
93+
catch (IllegalArgumentException exc) {
94+
Assert.assertEquals("Ref Files path is not a directory: pom.xml", exc.getMessage());
9595
}
9696
}
9797

@@ -101,10 +101,10 @@ public void testBaseConfigAlone() throws Exception {
101101
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport",
102102
VALID_PATCH_REPORT_EMPTY, "-baseConfig", "test");
103103
}
104-
catch (IllegalArgumentException ex) {
104+
catch (IllegalArgumentException exc) {
105105
Assert.assertEquals(
106106
"Patch checkstyle configuration xml path is missing while base configuration"
107-
+ " path is present", ex.getMessage());
107+
+ " path is present", exc.getMessage());
108108
}
109109
}
110110

@@ -114,10 +114,10 @@ public void testPatchConfigAlone() throws Exception {
114114
Main.main("-baseReport", VALID_BASE_REPORT_EMPTY, "-patchReport",
115115
VALID_PATCH_REPORT_EMPTY, "-patchConfig", VALID_BASE_CONFIG);
116116
}
117-
catch (IllegalArgumentException ex) {
117+
catch (IllegalArgumentException exc) {
118118
Assert.assertEquals(
119119
"Base checkstyle configuration xml path is missing while patch configuration"
120-
+ " path is present", ex.getMessage());
120+
+ " path is present", exc.getMessage());
121121
}
122122
}
123123

@@ -128,9 +128,9 @@ public void testInvalidBaseConfig() throws Exception {
128128
VALID_PATCH_REPORT_EMPTY, "-baseConfig", "test", "-patchConfig",
129129
VALID_BASE_CONFIG);
130130
}
131-
catch (IllegalArgumentException ex) {
131+
catch (IllegalArgumentException exc) {
132132
Assert.assertEquals("Base checkstyle configuration xml file is missing: test",
133-
ex.getMessage());
133+
exc.getMessage());
134134
}
135135
}
136136

@@ -141,9 +141,9 @@ public void testInvalidPatchConfig() throws Exception {
141141
VALID_PATCH_REPORT_EMPTY, "-baseConfig", VALID_BASE_CONFIG, "-patchConfig",
142142
"test");
143143
}
144-
catch (IllegalArgumentException ex) {
144+
catch (IllegalArgumentException exc) {
145145
Assert.assertEquals("Patch checkstyle configuration xml file is missing: test",
146-
ex.getMessage());
146+
exc.getMessage());
147147
}
148148
}
149149

@@ -153,11 +153,11 @@ public void testBaseConfigWithoutBaseReport() throws Exception {
153153
Main.main("-patchReport", VALID_PATCH_REPORT_EMPTY, "-baseConfig", VALID_BASE_CONFIG,
154154
"-patchConfig", VALID_BASE_CONFIG);
155155
}
156-
catch (IllegalArgumentException ex) {
156+
catch (IllegalArgumentException exc) {
157157
Assert.assertEquals(
158158
"Base checkstyle configuration xml path is missing while base configuration "
159159
+ "path is present.",
160-
ex.getMessage());
160+
exc.getMessage());
161161
}
162162
}
163163

@@ -167,9 +167,9 @@ public void testTextBaseConfigGiven() throws Exception {
167167
Main.main("-compareMode", "text", "-patchReport", VALID_PATCH_REPORT_EMPTY,
168168
"-baseConfig", "test");
169169
}
170-
catch (IllegalArgumentException ex) {
170+
catch (IllegalArgumentException exc) {
171171
Assert.assertEquals("Checkstyle configuration xml paths do not need to be present for "
172-
+ "text mode.", ex.getMessage());
172+
+ "text mode.", exc.getMessage());
173173
}
174174
}
175175

@@ -179,9 +179,9 @@ public void testTextPatchConfigGiven() throws Exception {
179179
Main.main("-compareMode", "text", "-patchReport", VALID_PATCH_REPORT_EMPTY,
180180
"-patchConfig", "test");
181181
}
182-
catch (IllegalArgumentException ex) {
182+
catch (IllegalArgumentException exc) {
183183
Assert.assertEquals("Checkstyle configuration xml paths do not need to be present for "
184-
+ "text mode.", ex.getMessage());
184+
+ "text mode.", exc.getMessage());
185185
}
186186
}
187187

@@ -190,8 +190,8 @@ public void testTextInvalidPatchReportPath() throws Exception {
190190
try {
191191
Main.main("-compareMode", "text", "-patchReport", "test");
192192
}
193-
catch (IllegalArgumentException ex) {
194-
Assert.assertEquals("Patch Report directory doesn't exist: test", ex.getMessage());
193+
catch (IllegalArgumentException exc) {
194+
Assert.assertEquals("Patch Report directory doesn't exist: test", exc.getMessage());
195195
}
196196
}
197197

@@ -201,8 +201,8 @@ public void testTextInvalidBaseReportPath() throws Exception {
201201
Main.main("-compareMode", "text", "-baseReport", "test", "-patchReport",
202202
VALID_PATCH_DIR);
203203
}
204-
catch (IllegalArgumentException ex) {
205-
Assert.assertEquals("Base Report directory doesn't exist: test", ex.getMessage());
204+
catch (IllegalArgumentException exc) {
205+
Assert.assertEquals("Base Report directory doesn't exist: test", exc.getMessage());
206206
}
207207
}
208208
}

0 commit comments

Comments
 (0)