The following issues were found

src/test/java/com/alibaba/json/test/IntArrayFieldTest_primitive.java
7 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class IntArrayFieldTest_primitive extends TestCase {

    public void test_array() throws Exception {
        Assert.assertEquals("[1]", JSON.toJSONString(new int[] { 1 }));

    }

    public void test_codec_null() throws Exception {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 17

              
    }

    public void test_codec_null() throws Exception {
        V0 v = new V0();

        SerializeConfig mapping = new SerializeConfig();
        mapping.setAsmEnable(false);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 28

              
        V0 v1 = JSON.parseObject(text, V0.class);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }

    public void test_codec_null_1() throws Exception {
        V0 v = new V0();


            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 31

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }

    public void test_codec_null_1() throws Exception {
        V0 v = new V0();

        SerializeConfig mapping = new SerializeConfig();
        mapping.setAsmEnable(false);
        Assert.assertTrue(!mapping.isAsmEnable());

            

Reported by PMD.

Returning 'value' may expose an internal array.
Design

Line: 47

                      private int[] value;

        public int[] getValue() {
            return value;
        }

        public void setValue(int[] value) {
            this.value = value;
        }

            

Reported by PMD.

The user-supplied array 'value' is stored directly.
Design

Line: 50

                          return value;
        }

        public void setValue(int[] value) {
            this.value = value;
        }

    }
}

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 50

                          return value;
        }

        public void setValue(int[] value) {
            this.value = value;
        }

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/test/jackson/JacksonTypeInfoTest.java
7 issues
System.out.println is used
Design

Line: 18

                      A a = new B();

        String str = mapper.writeValueAsString(a);
        System.out.println(str);

        Object x = mapper.readValue(str, A.class);
        System.out.println(x.getClass());
    }


            

Reported by PMD.

System.out.println is used
Design

Line: 21

                      System.out.println(str);

        Object x = mapper.readValue(str, A.class);
        System.out.println(x.getClass());
    }

    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
    public static class A {
        protected int a;

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 12

               * Created by wenshao on 02/04/2017.
 */
public class JacksonTypeInfoTest extends TestCase {
    public void test_typeinfo() throws Exception {
        ObjectMapper mapper = new ObjectMapper();

        A a = new B();

        String str = mapper.writeValueAsString(a);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

               * Created by wenshao on 02/04/2017.
 */
public class JacksonTypeInfoTest extends TestCase {
    public void test_typeinfo() throws Exception {
        ObjectMapper mapper = new ObjectMapper();

        A a = new B();

        String str = mapper.writeValueAsString(a);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 21

                      System.out.println(str);

        Object x = mapper.readValue(str, A.class);
        System.out.println(x.getClass());
    }

    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
    public static class A {
        protected int a;

            

Reported by PMD.

It is somewhat confusing to have a field name matching the declaring class name
Error

Line: 26

              
    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
    public static class A {
        protected int a;

        public A() {
        }

        public A(int a) {

            

Reported by PMD.

Avoid unused imports such as 'com.fasterxml.jackson.annotation.JsonSubTypes'
Design

Line: 3

              package com.alibaba.json.test.jackson;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
import junit.framework.TestCase;

/**
 * Created by wenshao on 02/04/2017.

            

Reported by PMD.

src/test/java/data/media/MediaContent.java
7 issues
Avoid unnecessary if..then..else statements when returning booleans
Design

Line: 27

              		MediaContent that = (MediaContent) o;

		if (images != null ? !images.equals(that.images) : that.images != null) return false;
		if (media != null ? !media.equals(that.media) : that.media != null) return false;

		return true;
	}

	@Override

            

Reported by PMD.

StringBuffer constructor is initialized with size 16, but has at least 31 characters appended.
Performance

Line: 41

              	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();

            

Reported by PMD.

StringBuffer (or StringBuilder).append is called 2 consecutive times with literals. Use a single append with a single combined String.
Performance

Line: 42

              
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();
	}

            

Reported by PMD.

StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable.
Performance

Line: 42

              
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();
	}

            

Reported by PMD.

StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable.
Performance

Line: 43

              	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();
	}


            

Reported by PMD.

StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable.
Performance

Line: 44

              		StringBuilder sb = new StringBuilder();
		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();
	}

    public void setMedia(Media media) {

            

Reported by PMD.

Avoid appending characters as strings in StringBuffer.append.
Performance

Line: 45

              		sb.append("[MediaContent: ");
		sb.append("media=").append(media);
		sb.append(", images=").append(images);
		sb.append("]");
		return sb.toString();
	}

    public void setMedia(Media media) {
        this.media = media;

            

Reported by PMD.

src/test/java/com/alibaba/json/test/a/WhiteSpaceTest.java
6 issues
System.out.println is used
Design

Line: 37

                      
        long endMillis = System.currentTimeMillis();
        long millis = endMillis - startMillis;
        System.out.println("millis : " + millis + ", count " + count);
    }
}

            

Reported by PMD.

All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 5

              
import com.alibaba.fastjson.util.IOUtils;

public class WhiteSpaceTest {
    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 3; ++i) {
            perf();
        }
        //ch < IOUtils.whitespaceFlags.length && IOUtils.whitespaceFlags[ch]

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 6

              import com.alibaba.fastjson.util.IOUtils;

public class WhiteSpaceTest {
    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 3; ++i) {
            perf();
        }
        //ch < IOUtils.whitespaceFlags.length && IOUtils.whitespaceFlags[ch]
    }

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.util.IOUtils'
Design

Line: 3

              package com.alibaba.json.test.a;

import com.alibaba.fastjson.util.IOUtils;

public class WhiteSpaceTest {
    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 3; ++i) {
            perf();
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'count' (lines '14'-'24').
Error

Line: 14

                  }

    protected static void perf() {
        int count = 0;

        long startMillis = System.currentTimeMillis();
        for (int i = 0; i < 1000 * 200; ++i) {
            for (char ch = 0; ch < 10000; ++ch) {
                

            

Reported by PMD.

Found 'DD'-anomaly for variable 'count' (lines '24'-'24').
Error

Line: 24

              //                boolean whitespace = c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == '\b';
                  boolean whitespace = ch <= ' ' && (ch == ' ' || ch == '\r' || ch == '\n' || ch == '\t' || ch == '\f' || ch == '\b');
                if (whitespace) {
                    count++;
                }
//                if (ch < IOUtils.whitespaceFlags.length && IOUtils.whitespaceFlags[ch]) {
//                    count++;
//                }
//                if (c <= ' ' && (c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == '\b')) {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/codec/FastjsonCodec.java
6 issues
System.out.println is used
Design

Line: 17

                  private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }

    public String getName() {
        return "fastjson";
    }

            

Reported by PMD.

Private field 'config' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 14

              
public class FastjsonCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 14

              
public class FastjsonCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 30

                      return parser.parseObject(clazz);
    }

    public <T> Collection<T> decodeArray(String text, Class<T> clazz) throws Exception {
        DefaultJSONParser parser = new DefaultJSONParser(text, config);
        parser.config(Feature.DisableCircularReferenceDetect, true);
        return parser.parseArray(clazz);
    }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 50

              
    // private JavaBeanSerializer serializer = new JavaBeanSerializer(Long_100_Entity.class);

    public String encode(Object object) throws Exception {
        return JSON.toJSONString(object, SerializerFeature.DisableCircularReferenceDetect);
    }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 55

                  }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {
        return (T) JSON.parseObject(input, clazz, Feature.DisableCircularReferenceDetect);
    }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/codec/FastjsonGenCodec.java
6 issues
Return an empty array rather than null.
Error

Line: 82

                  }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

    @Override

            

Reported by PMD.

Private field 'config' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 23

              
public class FastjsonGenCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();
    
    public FastjsonGenCodec() {
        config.putDeserializer(Image.class, new ImageGenDecoder(config, Image.class));
        config.putDeserializer(Media.class, new MediaGenDecoder(config, Media.class));
        config.putDeserializer(MediaContent.class, new MediaContentGenDecoder(config, MediaContent.class));

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 23

              
public class FastjsonGenCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();
    
    public FastjsonGenCodec() {
        config.putDeserializer(Image.class, new ImageGenDecoder(config, Image.class));
        config.putDeserializer(Media.class, new MediaGenDecoder(config, Media.class));
        config.putDeserializer(MediaContent.class, new MediaContentGenDecoder(config, MediaContent.class));

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 41

                      return parser.parseObject(clazz);
    }

    public <T> Collection<T> decodeArray(String text, Class<T> clazz) throws Exception {
        DefaultJSONParser parser = new DefaultJSONParser(text, config);
        parser.config(Feature.DisableCircularReferenceDetect, true);
        return parser.parseArray(clazz);
    }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 61

              
    // private JavaBeanSerializer serializer = new JavaBeanSerializer(Long_100_Entity.class);

    public String encode(Object object) throws Exception {
        SerializeWriter out = new SerializeWriter();
        out.config(SerializerFeature.DisableCircularReferenceDetect, true);
//        out.config(SerializerFeature.DisableCheckSpecialChar, true);

        JSONSerializer serializer = new JSONSerializer(out);

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 77

                  }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {
        return (T) JSON.parseObject(input, clazz, Feature.DisableCircularReferenceDetect);
    }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/basic/FloatBenchmark_arrayMapping.java
6 issues
System.out.println is used
Design

Line: 35

                          JSON.parseObject(json, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static void perf2() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000 * 1000; ++i) {

            

Reported by PMD.

System.out.println is used
Design

Line: 44

                          JSON.parseObject(json2, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static class Model {
        public float v1;
        public float v2;

            

Reported by PMD.

All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 9

              /**
 * Created by wenshao on 04/08/2017.
 */
public class FloatBenchmark_arrayMapping {
    static String json = "[0.012671709,0.6042485,0.13231707,0.80090785,0.6192943]";
    static String json2 = "[\"0.012671709\",\"0.6042485\",\"0.13231707\",\"0.80090785\",\"0.6192943\"]";

    public static void main(String[] args) throws Exception {
        Model model = new Model();

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 13

                  static String json = "[0.012671709,0.6042485,0.13231707,0.80090785,0.6192943]";
    static String json2 = "[\"0.012671709\",\"0.6042485\",\"0.13231707\",\"0.80090785\",\"0.6192943\"]";

    public static void main(String[] args) throws Exception {
        Model model = new Model();
//        model.v1 = new Random().nextFloat();
//        model.v2 = new Random().nextFloat();
//        model.v3 = new Random().nextFloat();
//        model.v4 = new Random().nextFloat();

            

Reported by PMD.

Avoid unused local variables such as 'model'.
Design

Line: 14

                  static String json2 = "[\"0.012671709\",\"0.6042485\",\"0.13231707\",\"0.80090785\",\"0.6192943\"]";

    public static void main(String[] args) throws Exception {
        Model model = new Model();
//        model.v1 = new Random().nextFloat();
//        model.v2 = new Random().nextFloat();
//        model.v3 = new Random().nextFloat();
//        model.v4 = new Random().nextFloat();
//        model.v5 = new Random().nextFloat();

            

Reported by PMD.

Found 'DU'-anomaly for variable 'model' (lines '14'-'27').
Error

Line: 14

                  static String json2 = "[\"0.012671709\",\"0.6042485\",\"0.13231707\",\"0.80090785\",\"0.6192943\"]";

    public static void main(String[] args) throws Exception {
        Model model = new Model();
//        model.v1 = new Random().nextFloat();
//        model.v2 = new Random().nextFloat();
//        model.v3 = new Random().nextFloat();
//        model.v4 = new Random().nextFloat();
//        model.v5 = new Random().nextFloat();

            

Reported by PMD.

src/test/java/com/alibaba/json/test/jackson/JacksonTest.java
6 issues
System.out.println is used
Design

Line: 24

                      model.id = 1001;
        ObjectMapper mapper = new ObjectMapper();
        String text = mapper.writeValueAsString(model);
        System.out.println(text);
    }
    
    public static class Model {
        public int id;
    }

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class JacksonTest extends TestCase {

    public void test_0() throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);

        mapper.readValue("{a:3}", Map.class);
    }

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 12

              
public class JacksonTest extends TestCase {

    public void test_0() throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);

        mapper.readValue("{a:3}", Map.class);
    }

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 19

                      mapper.readValue("{a:3}", Map.class);
    }
    
    public void test_1() throws Exception {
        Model model = new Model();
        model.id = 1001;
        ObjectMapper mapper = new ObjectMapper();
        String text = mapper.writeValueAsString(model);
        System.out.println(text);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 19

                      mapper.readValue("{a:3}", Map.class);
    }
    
    public void test_1() throws Exception {
        Model model = new Model();
        model.id = 1001;
        ObjectMapper mapper = new ObjectMapper();
        String text = mapper.writeValueAsString(model);
        System.out.println(text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 28

                  }
    
    public static class Model {
        public int id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/test/codec/FastjsonArrayMappingCodec.java
6 issues
System.out.println is used
Design

Line: 17

                  private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonArrayMappingCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }

    public String getName() {
        return "fastjson-BeanToArray";
    }

            

Reported by PMD.

Private field 'config' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 14

              
public class FastjsonArrayMappingCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonArrayMappingCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 14

              
public class FastjsonArrayMappingCodec implements Codec {

    private ParserConfig    config = ParserConfig.getGlobalInstance();

    public FastjsonArrayMappingCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 28

                      return JSON.parseObject(text, clazz, Feature.DisableCircularReferenceDetect, Feature.SupportArrayToBean);
    }

    public <T> Collection<T> decodeArray(String text, Class<T> clazz) throws Exception {
        DefaultJSONParser parser = new DefaultJSONParser(text, config);
        parser.config(Feature.DisableCircularReferenceDetect, true);
        return parser.parseArray(clazz);
    }


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 44

              
    // private JavaBeanSerializer serializer = new JavaBeanSerializer(Long_100_Entity.class);

    public String encode(Object object) throws Exception {
        return JSON.toJSONString(object, SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.BeanToArray);
    }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 49

                  }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {
        return (T) JSON.parseObject(input, clazz, Feature.DisableCircularReferenceDetect, Feature.SupportArrayToBean);
    }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/codec/FastjsonSCodec.java
6 issues
Return an empty array rather than null.
Error

Line: 78

                  }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

    @Override

            

Reported by PMD.

System.out.println is used
Design

Line: 19

              
public class FastjsonSCodec implements Codec {
    public FastjsonSCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
    }

    public String getName() {
        return "fastjsonS";
    }

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 33

                      return parser.parseObject(clazz);
    }

    public <T> Collection<T> decodeArray(String text, Class<T> clazz) throws Exception {
        ParserConfig    config = new ParserConfig();
        DefaultJSONParser parser = new DefaultJSONParser(text, config);
        parser.config(Feature.DisableCircularReferenceDetect, true);
        return parser.parseArray(clazz);
    }

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 56

              
    // private JavaBeanSerializer serializer = new JavaBeanSerializer(Long_100_Entity.class);

    public String encode(Object object) throws Exception {
        SerializeConfig config = new SerializeConfig();
        SerializeWriter out = new SerializeWriter();
        out.config(SerializerFeature.DisableCircularReferenceDetect, true);
//        out.config(SerializerFeature.DisableCheckSpecialChar, true);


            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 73

                  }

    @SuppressWarnings("unchecked")
    public <T> T decodeObject(byte[] input, Class<T> clazz) throws Exception {
        return (T) JSON.parseObject(input, clazz, Feature.DisableCircularReferenceDetect);
    }

    @Override
    public byte[] encodeToBytes(Object object) throws Exception {

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.serializer.PropertyFilter'
Design

Line: 12

              import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializeWriter;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class FastjsonSCodec implements Codec {

            

Reported by PMD.