Skip to content

Commit fdc79f7

Browse files
committed
Apply consistent format for catch clauses.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@797664 13f79535-47bb-0310-9956-ffa450edef68
1 parent 372c15e commit fdc79f7

7 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/java/org/apache/commons/codec/net/URLCodec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static final byte[] decodeUrl(byte[] bytes)
177177
throw new DecoderException("Invalid URL encoding");
178178
}
179179
buffer.write((char)((u << 4) + l));
180-
} catch(ArrayIndexOutOfBoundsException e) {
180+
} catch (ArrayIndexOutOfBoundsException e) {
181181
throw new DecoderException("Invalid URL encoding");
182182
}
183183
} else {
@@ -247,7 +247,7 @@ public String encode(String pString) throws EncoderException {
247247
}
248248
try {
249249
return encode(pString, getDefaultCharset());
250-
} catch(UnsupportedEncodingException e) {
250+
} catch (UnsupportedEncodingException e) {
251251
throw new EncoderException(e.getMessage());
252252
}
253253
}
@@ -289,7 +289,7 @@ public String decode(String pString) throws DecoderException {
289289
}
290290
try {
291291
return decode(pString, getDefaultCharset());
292-
} catch(UnsupportedEncodingException e) {
292+
} catch (UnsupportedEncodingException e) {
293293
throw new DecoderException(e.getMessage());
294294
}
295295
}

src/test/org/apache/commons/codec/BinaryEncoderAbstractTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void testEncodeNull() throws Exception {
4242
BinaryEncoder encoder = makeEncoder();
4343
try {
4444
encoder.encode(null);
45-
} catch( EncoderException ee ) {
45+
} catch (EncoderException ee) {
4646
// An exception should be thrown
4747
}
4848
}

src/test/org/apache/commons/codec/StringEncoderAbstractTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void testEncodeNull() throws Exception {
4747

4848
try {
4949
encoder.encode(null);
50-
} catch( EncoderException ee ) {
50+
} catch (EncoderException ee) {
5151
// An exception should be thrown
5252
}
5353
}
@@ -58,7 +58,7 @@ public void testEncodeWithInvalidObject() throws Exception {
5858
try {
5959
StringEncoder encoder = makeEncoder();
6060
encoder.encode( new Float( 3.4 ) );
61-
} catch( Exception e ) {
61+
} catch (Exception e) {
6262
exceptionThrown = true;
6363
}
6464

src/test/org/apache/commons/codec/net/QCodecTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void testEncodeObjects() throws Exception {
136136
Object dObj = new Double(3.0);
137137
qcodec.encode( dObj );
138138
fail( "Trying to url encode a Double object should cause an exception.");
139-
} catch( EncoderException ee ) {
139+
} catch (EncoderException ee) {
140140
// Exception expected, test segment passes.
141141
}
142142
}
@@ -147,13 +147,13 @@ public void testInvalidEncoding() {
147147
try {
148148
qcodec.encode("Hello there!");
149149
fail( "We set the encoding to a bogus NONSENSE vlaue, this shouldn't have worked.");
150-
} catch( EncoderException ee ) {
150+
} catch (EncoderException ee) {
151151
// Exception expected, test segment passes.
152152
}
153153
try {
154154
qcodec.decode("=?NONSENSE?Q?Hello there!?=");
155155
fail( "We set the encoding to a bogus NONSENSE vlaue, this shouldn't have worked.");
156-
} catch( DecoderException ee ) {
156+
} catch (DecoderException ee) {
157157
// Exception expected, test segment passes.
158158
}
159159
}
@@ -172,7 +172,7 @@ public void testDecodeObjects() throws Exception {
172172
Object dObj = new Double(3.0);
173173
qcodec.decode( dObj );
174174
fail( "Trying to url encode a Double object should cause an exception.");
175-
} catch( DecoderException ee ) {
175+
} catch (DecoderException ee) {
176176
// Exception expected, test segment passes.
177177
}
178178
}

src/test/org/apache/commons/codec/net/QuotedPrintableCodecTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ public void testDecodeInvalid() throws Exception {
116116
try {
117117
qpcodec.decode("=");
118118
fail("DecoderException should have been thrown");
119-
} catch(DecoderException e) {
119+
} catch (DecoderException e) {
120120
// Expected. Move on
121121
}
122122
try {
123123
qpcodec.decode("=A");
124124
fail("DecoderException should have been thrown");
125-
} catch(DecoderException e) {
125+
} catch (DecoderException e) {
126126
// Expected. Move on
127127
}
128128
try {
129129
qpcodec.decode("=WW");
130130
fail("DecoderException should have been thrown");
131-
} catch(DecoderException e) {
131+
} catch (DecoderException e) {
132132
// Expected. Move on
133133
}
134134
}
@@ -193,7 +193,7 @@ public void testEncodeObjects() throws Exception {
193193
Object dObj = new Double(3.0);
194194
qpcodec.encode( dObj );
195195
fail( "Trying to url encode a Double object should cause an exception.");
196-
} catch( EncoderException ee ) {
196+
} catch (EncoderException ee) {
197197
// Exception expected, test segment passes.
198198
}
199199
}
@@ -204,13 +204,13 @@ public void testInvalidEncoding() {
204204
try {
205205
qpcodec.encode(plain);
206206
fail( "We set the encoding to a bogus NONSENSE vlaue, this shouldn't have worked.");
207-
} catch( EncoderException ee ) {
207+
} catch (EncoderException ee) {
208208
// Exception expected, test segment passes.
209209
}
210210
try {
211211
qpcodec.decode(plain);
212212
fail( "We set the encoding to a bogus NONSENSE vlaue, this shouldn't have worked.");
213-
} catch( DecoderException ee ) {
213+
} catch (DecoderException ee) {
214214
// Exception expected, test segment passes.
215215
}
216216
}
@@ -235,7 +235,7 @@ public void testDecodeObjects() throws Exception {
235235
Object dObj = new Double(3.0);
236236
qpcodec.decode( dObj );
237237
fail( "Trying to url encode a Double object should cause an exception.");
238-
} catch( DecoderException ee ) {
238+
} catch (DecoderException ee) {
239239
// Exception expected, test segment passes.
240240
}
241241
}

src/test/org/apache/commons/codec/net/RFC1522CodecTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,43 +61,43 @@ public void testDecodeInvalid() throws Exception {
6161
try {
6262
testcodec.decodeText("whatever");
6363
fail("DecoderException should have been thrown");
64-
} catch(DecoderException e) {
64+
} catch (DecoderException e) {
6565
// Expected. Move on
6666
}
6767
try {
6868
testcodec.decodeText("=?stuff?=");
6969
fail("DecoderException should have been thrown");
70-
} catch(DecoderException e) {
70+
} catch (DecoderException e) {
7171
// Expected. Move on
7272
}
7373
try {
7474
testcodec.decodeText("=?UTF-8?stuff?=");
7575
fail("DecoderException should have been thrown");
76-
} catch(DecoderException e) {
76+
} catch (DecoderException e) {
7777
// Expected. Move on
7878
}
7979
try {
8080
testcodec.decodeText("=?UTF-8?T?stuff");
8181
fail("DecoderException should have been thrown");
82-
} catch(DecoderException e) {
82+
} catch (DecoderException e) {
8383
// Expected. Move on
8484
}
8585
try {
8686
testcodec.decodeText("=??T?stuff?=");
8787
fail("DecoderException should have been thrown");
88-
} catch(DecoderException e) {
88+
} catch (DecoderException e) {
8989
// Expected. Move on
9090
}
9191
try {
9292
testcodec.decodeText("=?UTF-8??stuff?=");
9393
fail("DecoderException should have been thrown");
94-
} catch(DecoderException e) {
94+
} catch (DecoderException e) {
9595
// Expected. Move on
9696
}
9797
try {
9898
testcodec.decodeText("=?UTF-8?W?stuff?=");
9999
fail("DecoderException should have been thrown");
100-
} catch(DecoderException e) {
100+
} catch (DecoderException e) {
101101
// Expected. Move on
102102
}
103103
}

src/test/org/apache/commons/codec/net/URLCodecTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,19 @@ public void testDecodeInvalid() throws Exception {
130130
try {
131131
urlCodec.decode("%");
132132
fail("DecoderException should have been thrown");
133-
} catch(DecoderException e) {
133+
} catch (DecoderException e) {
134134
// Expected. Move on
135135
}
136136
try {
137137
urlCodec.decode("%A");
138138
fail("DecoderException should have been thrown");
139-
} catch(DecoderException e) {
139+
} catch (DecoderException e) {
140140
// Expected. Move on
141141
}
142142
try {
143143
urlCodec.decode("%WW");
144144
fail("DecoderException should have been thrown");
145-
} catch(DecoderException e) {
145+
} catch (DecoderException e) {
146146
// Expected. Move on
147147
}
148148
this.validateState(urlCodec);
@@ -220,7 +220,7 @@ public void testEncodeObjects() throws Exception {
220220
Object dObj = new Double(3.0);
221221
urlCodec.encode( dObj );
222222
fail( "Trying to url encode a Double object should cause an exception.");
223-
} catch( EncoderException ee ) {
223+
} catch (EncoderException ee) {
224224
// Exception expected, test segment passes.
225225
}
226226
this.validateState(urlCodec);
@@ -264,7 +264,7 @@ public void testDecodeObjects() throws Exception {
264264
Object dObj = new Double(3.0);
265265
urlCodec.decode( dObj );
266266
fail( "Trying to url encode a Double object should cause an exception.");
267-
} catch( DecoderException ee ) {
267+
} catch (DecoderException ee) {
268268
// Exception expected, test segment passes.
269269
}
270270
this.validateState(urlCodec);

0 commit comments

Comments
 (0)