Skip to content

Commit 3acdc6c

Browse files
committed
JApiCmp complains but shouldn't?
1 parent 6723ed4 commit 3acdc6c

5 files changed

Lines changed: 65 additions & 4 deletions

File tree

src/main/java/org/apache/commons/codec/net/BCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*
4747
* @since 1.3
4848
*/
49-
public class BCodec extends AbstractRFC1522Codec implements StringEncoder, StringDecoder {
49+
public class BCodec extends RFC1522Codec implements StringEncoder, StringDecoder {
5050

5151
/**
5252
* The default decoding policy.

src/main/java/org/apache/commons/codec/net/QCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*
5151
* @since 1.3
5252
*/
53-
public class QCodec extends AbstractRFC1522Codec implements StringEncoder, StringDecoder {
53+
public class QCodec extends RFC1522Codec implements StringEncoder, StringDecoder {
5454
/**
5555
* The default Charset used for string decoding and encoding.
5656
*/

src/main/java/org/apache/commons/codec/net/AbstractRFC1522Codec.java renamed to src/main/java/org/apache/commons/codec/net/RFC1522Codec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* @since 1.3
4242
*/
43-
abstract class AbstractRFC1522Codec {
43+
abstract class RFC1522Codec {
4444

4545
/** Separator. */
4646
protected static final char SEP = '?';
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.codec.net;
19+
20+
import java.io.UnsupportedEncodingException;
21+
import java.nio.charset.Charset;
22+
23+
import org.apache.commons.codec.DecoderException;
24+
import org.apache.commons.codec.EncoderException;
25+
26+
/**
27+
* Tests overriding the package private AbstractRFC1522Codec.
28+
*/
29+
public class CustomRFC1522Codec extends RFC1522Codec {
30+
31+
@Override
32+
protected String getEncoding() {
33+
return null;
34+
}
35+
36+
@Override
37+
protected byte[] doEncoding(byte[] bytes) throws EncoderException {
38+
return null;
39+
}
40+
41+
@Override
42+
protected byte[] doDecoding(byte[] bytes) throws DecoderException {
43+
return null;
44+
}
45+
46+
@Override
47+
protected String encodeText(String text, Charset charset) throws EncoderException {
48+
return super.encodeText(text, charset);
49+
}
50+
51+
@Override
52+
protected String encodeText(String text, String charsetName) throws EncoderException, UnsupportedEncodingException {
53+
return super.encodeText(text, charsetName);
54+
}
55+
56+
@Override
57+
protected String decodeText(String text) throws DecoderException, UnsupportedEncodingException {
58+
return super.decodeText(text);
59+
}
60+
61+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
public class RFC1522CodecTest {
3131

32-
static class RFC1522TestCodec extends AbstractRFC1522Codec {
32+
static class RFC1522TestCodec extends RFC1522Codec {
3333

3434
@Override
3535
protected byte[] doDecoding(final byte[] bytes) {

0 commit comments

Comments
 (0)