The following issues were found

src/test/java/data/media/ImageGenDecoder.java
59 issues
The class 'ImageGenDecoder' has a Modified Cyclomatic Complexity of 12 (Highest = 33).
Design

Line: 13

              import com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();

            

Reported by PMD.

The class 'ImageGenDecoder' has a Standard Cyclomatic Complexity of 12 (Highest = 33).
Design

Line: 13

              import com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();

            

Reported by PMD.

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

Line: 14

              import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    

            

Reported by PMD.

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

Line: 14

              import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    

            

Reported by PMD.

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

Line: 15

              
public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;

            

Reported by PMD.

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

Line: 15

              
public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;

            

Reported by PMD.

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

Line: 16

              public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;
    private ObjectDeserializer title_gen_deser__;

            

Reported by PMD.

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

Line: 16

              public class ImageGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;
    private ObjectDeserializer title_gen_deser__;

            

Reported by PMD.

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

Line: 17

                  private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;
    private ObjectDeserializer title_gen_deser__;
    private ObjectDeserializer size_gen_deser__;

            

Reported by PMD.

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

Line: 17

                  private char[] size_gen_prefix__ = "\"size\":".toCharArray();
    private char[] uri_gen_prefix__ = "\"uri\":".toCharArray();
    private char[] title_gen_prefix__ = "\"title\":".toCharArray();
    private char[] width_gen_prefix__ = "\"width\":".toCharArray();
    private char[] height_gen_prefix__ = "\"height\":".toCharArray();
    
    private ObjectDeserializer uri_gen_deser__;
    private ObjectDeserializer title_gen_deser__;
    private ObjectDeserializer size_gen_deser__;

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/asm/Opcodes.java
59 issues
Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 42

               * @author Eugene Kuleshov
 */
public interface Opcodes {
    int T_INT = 10;

    // versions

    // int V1_1 = 3 << 16 | 45;
    // int V1_2 = 0 << 16 | 46;

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 50

                  // int V1_2 = 0 << 16 | 46;
    // int V1_3 = 0 << 16 | 47;
    // int V1_4 = 0 << 16 | 48;
    int    V1_5                = 0 << 16 | 49;
    // int V1_6 = 0 << 16 | 50;
    // int V1_7 = 0 << 16 | 51;

    // access flags


            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 56

              
    // access flags

    int    ACC_PUBLIC          = 0x0001;                 // class, field, method
    int    ACC_SUPER           = 0x0020;                 // class

    // opcodes // visit method (- = idem)

    int    ACONST_NULL         = 1;                      // -

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 57

                  // access flags

    int    ACC_PUBLIC          = 0x0001;                 // class, field, method
    int    ACC_SUPER           = 0x0020;                 // class

    // opcodes // visit method (- = idem)

    int    ACONST_NULL         = 1;                      // -
    int    ICONST_0            = 3;                      // -

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 61

              
    // opcodes // visit method (- = idem)

    int    ACONST_NULL         = 1;                      // -
    int    ICONST_0            = 3;                      // -
    int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 62

                  // opcodes // visit method (- = idem)

    int    ACONST_NULL         = 1;                      // -
    int    ICONST_0            = 3;                      // -
    int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -
    int    DCONST_0            = 14;                     // -

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 63

              
    int    ACONST_NULL         = 1;                      // -
    int    ICONST_0            = 3;                      // -
    int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -
    int    DCONST_0            = 14;                     // -
    int    BIPUSH              = 16;                     // visitIntInsn

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 64

                  int    ACONST_NULL         = 1;                      // -
    int    ICONST_0            = 3;                      // -
    int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -
    int    DCONST_0            = 14;                     // -
    int    BIPUSH              = 16;                     // visitIntInsn
                                                          // int SIPUSH = 17; // -

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 65

                  int    ICONST_0            = 3;                      // -
    int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -
    int    DCONST_0            = 14;                     // -
    int    BIPUSH              = 16;                     // visitIntInsn
                                                          // int SIPUSH = 17; // -
//    int    LDC                 = 18;                     // visitLdcInsn

            

Reported by PMD.

Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.
Design

Line: 66

                  int    ICONST_1            = 4;                      // -
    int    LCONST_0            = 9;                      // -
    int    LCONST_1            = 10;                     // -
    int    FCONST_0            = 11;                     // -
    int    DCONST_0            = 14;                     // -
    int    BIPUSH              = 16;                     // visitIntInsn
                                                          // int SIPUSH = 17; // -
//    int    LDC                 = 18;                     // visitLdcInsn
    // int LDC_W = 19; // -

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/parser/deserializer/ArrayListTypeFieldDeserializer.java
59 issues
Avoid using a branching statement as the last in a loop.
Error

Line: 176

                              if (lexer.isEnabled(Feature.AllowArbitraryCommas)) {
                    while (lexer.token() == JSONToken.COMMA) {
                        lexer.nextToken();
                        continue;
                    }
                }

                if (lexer.token() == JSONToken.RBRACKET) {
                    break;

            

Reported by PMD.

The class 'ArrayListTypeFieldDeserializer' has a Modified Cyclomatic Complexity of 10 (Highest = 28).
Design

Line: 21

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.ParameterizedTypeImpl;

public class ArrayListTypeFieldDeserializer extends FieldDeserializer {

    private final Type         itemType;
    private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;


            

Reported by PMD.

The class 'ArrayListTypeFieldDeserializer' has a Standard Cyclomatic Complexity of 10 (Highest = 28).
Design

Line: 21

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.ParameterizedTypeImpl;

public class ArrayListTypeFieldDeserializer extends FieldDeserializer {

    private final Type         itemType;
    private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;


            

Reported by PMD.

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

Line: 23

              
public class ArrayListTypeFieldDeserializer extends FieldDeserializer {

    private final Type         itemType;
    private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;

    public ArrayListTypeFieldDeserializer(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo){
        super(clazz, fieldInfo);

            

Reported by PMD.

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

Line: 24

              public class ArrayListTypeFieldDeserializer extends FieldDeserializer {

    private final Type         itemType;
    private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;

    public ArrayListTypeFieldDeserializer(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo){
        super(clazz, fieldInfo);


            

Reported by PMD.

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

Line: 25

              
    private final Type         itemType;
    private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;

    public ArrayListTypeFieldDeserializer(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo){
        super(clazz, fieldInfo);

        Type fieldType = fieldInfo.fieldType;

            

Reported by PMD.

Avoid unused constructor parameters such as 'mapping'.
Design

Line: 27

                  private int                itemFastMatchToken;
    private ObjectDeserializer deserializer;

    public ArrayListTypeFieldDeserializer(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo){
        super(clazz, fieldInfo);

        Type fieldType = fieldInfo.fieldType;
        if (fieldType instanceof ParameterizedType) {
            Type argType = ((ParameterizedType) fieldInfo.fieldType).getActualTypeArguments()[0];

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 36

                          if (argType instanceof WildcardType) {
                WildcardType wildcardType = (WildcardType) argType;
                Type[] upperBounds = wildcardType.getUpperBounds();
                if (upperBounds.length == 1) {
                    argType = upperBounds[0];
                }
            }
            this.itemType = argType;
        } else {

            

Reported by PMD.

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

Line: 54

                  @Override
    public void parseField(DefaultJSONParser parser, Object object, Type objectType, Map<String, Object> fieldValues) {
        JSONLexer lexer = parser.lexer;
        final int token = lexer.token();
        if (token == JSONToken.NULL
                || (token == JSONToken.LITERAL_STRING && lexer.stringVal().length() == 0)) {
            if (object == null) {
                fieldValues.put(fieldInfo.name, null);
            } else {

            

Reported by PMD.

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

Line: 56

                      JSONLexer lexer = parser.lexer;
        final int token = lexer.token();
        if (token == JSONToken.NULL
                || (token == JSONToken.LITERAL_STRING && lexer.stringVal().length() == 0)) {
            if (object == null) {
                fieldValues.put(fieldInfo.name, null);
            } else {
                setValue(object, null);
            }

            

Reported by PMD.

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

Line: 179

                  }

    @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: 29

                  private SerializeConfig serializeConfig = new SerializeConfig();

    public FastjsonManualCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
        
        serializeConfig.put(MediaContent.class, new MediaContentSerializer());
    }

    public String getName() {

            

Reported by PMD.

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

Line: 25

              
public class FastjsonManualCodec implements Codec {

    private ParserConfig    config = new ParserConfig();
    private SerializeConfig serializeConfig = new SerializeConfig();

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

            

Reported by PMD.

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

Line: 25

              
public class FastjsonManualCodec implements Codec {

    private ParserConfig    config = new ParserConfig();
    private SerializeConfig serializeConfig = new SerializeConfig();

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

            

Reported by PMD.

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

Line: 26

              public class FastjsonManualCodec implements Codec {

    private ParserConfig    config = new ParserConfig();
    private SerializeConfig serializeConfig = new SerializeConfig();

    public FastjsonManualCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
        
        serializeConfig.put(MediaContent.class, new MediaContentSerializer());

            

Reported by PMD.

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

Line: 26

              public class FastjsonManualCodec implements Codec {

    private ParserConfig    config = new ParserConfig();
    private SerializeConfig serializeConfig = new SerializeConfig();

    public FastjsonManualCodec(){
        System.out.println("fastjson-" + JSON.VERSION);    
        
        serializeConfig.put(MediaContent.class, new MediaContentSerializer());

            

Reported by PMD.

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

Line: 44

                      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: 64

              
    // 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);

        JSONSerializer serializer = new JSONSerializer(out, serializeConfig);
        serializer.write(object);

            

Reported by PMD.

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

Line: 79

                  }

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

    public static class ImageSerializer implements ObjectSerializer {


            

Reported by PMD.

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

Line: 92

                          
            SerializeWriter out = serializer.out;
            
            out.writeFieldValue('{', "height", image.getHeight());
            out.writeFieldValueStringWithDoubleQuote(',', "size", image.getSize().name());
            
            String tile = image.getTitle();
            out.writeFieldValueStringWithDoubleQuoteCheck(',', "title", tile);
            out.writeFieldValueStringWithDoubleQuoteCheck(',', "uri", image.getUri());

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/AEHuangliang2Test.java
58 issues
System.out.println is used
Design

Line: 391

                      NetResponse response = JSON.parseObject(mockResultJson, NetResponse.class);

        String bodyJson = JSON.toJSONString(response.body);
        System.out.println(bodyJson);
        FloorPageData pageData = JSON.parseObject(bodyJson, FloorPageData.class);
        assertNotNull(pageData.areas);
    }
}

            

Reported by PMD.

The String literal ' \'@type\': \'section\',\n' appears 4 times in this file; the first occurrence is on line 21
Error

Line: 21

                  static String jsonData = "{\n" +
            "    \"areas\": [\n" +
            "      {\n" +
            "        \"@type\": \"section\",\n" +
            "        \"templateId\": \"grid\",\n" +
            "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +

            

Reported by PMD.

The String literal ' \'templateId\': \'grid\',\n' appears 4 times in this file; the first occurrence is on line 22
Error

Line: 22

                          "    \"areas\": [\n" +
            "      {\n" +
            "        \"@type\": \"section\",\n" +
            "        \"templateId\": \"grid\",\n" +
            "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +

            

Reported by PMD.

The String literal ' \'style\': {\n' appears 4 times in this file; the first occurrence is on line 23
Error

Line: 23

                          "      {\n" +
            "        \"@type\": \"section\",\n" +
            "        \"templateId\": \"grid\",\n" +
            "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +

            

Reported by PMD.

The String literal ' \'card\' : \'true\',\n' appears 4 times in this file; the first occurrence is on line 24
Error

Line: 24

                          "        \"@type\": \"section\",\n" +
            "        \"templateId\": \"grid\",\n" +
            "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +

            

Reported by PMD.

The String literal ' \'column-count\':\'2\',\n' appears 4 times in this file; the first occurrence is on line 25
Error

Line: 25

                          "        \"templateId\": \"grid\",\n" +
            "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +
            "        },\n" +

            

Reported by PMD.

The String literal ' \'aspect-ratio\':\'2\',\n' appears 4 times in this file; the first occurrence is on line 26
Error

Line: 26

                          "        \"style\": {\n" +
            "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +
            "        },\n" +
            "        \"children\": [\n" +

            

Reported by PMD.

The String literal ' \'margins\':\'16 0 16 16\',\n' appears 4 times in this file; the first occurrence is on line 27
Error

Line: 27

                          "          \"card\" : \"true\",\n" +
            "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +
            "        },\n" +
            "        \"children\": [\n" +
            "        {\n" +

            

Reported by PMD.

The String literal ' \'background-color\': \'#ffffff\',\n' appears 4 times in this file; the first occurrence is on line 28
Error

Line: 28

                          "          \"column-count\":\"2\",\n" +
            "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +
            "        },\n" +
            "        \"children\": [\n" +
            "        {\n" +
            "        \"@type\": \"section\",\n" +

            

Reported by PMD.

The String literal ' \'column-gap\': \'10\'\n' appears 4 times in this file; the first occurrence is on line 29
Error

Line: 29

                          "          \"aspect-ratio\":\"2\",\n" +
            "          \"margins\":\"16 0 16 16\",\n" +
            "          \"background-color\": \"#ffffff\",\n" +
            "          \"column-gap\": \"10\"\n" +
            "        },\n" +
            "        \"children\": [\n" +
            "        {\n" +
            "        \"@type\": \"section\",\n" +
            "        \"templateId\": \"grid\",\n" +

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/parser/deserializer/ThrowableDeserializer.java
57 issues
Possible God Class (WMC=52, ATFD=45, TCC=0.000%)
Design

Line: 18

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class ThrowableDeserializer extends JavaBeanDeserializer {

    public ThrowableDeserializer(ParserConfig mapping, Class<?> clazz){
        super(mapping, clazz, clazz);
    }


            

Reported by PMD.

The class 'ThrowableDeserializer' has a Standard Cyclomatic Complexity of 11 (Highest = 33).
Design

Line: 18

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class ThrowableDeserializer extends JavaBeanDeserializer {

    public ThrowableDeserializer(ParserConfig mapping, Class<?> clazz){
        super(mapping, clazz, clazz);
    }


            

Reported by PMD.

The class 'ThrowableDeserializer' has a Modified Cyclomatic Complexity of 11 (Highest = 33).
Design

Line: 18

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class ThrowableDeserializer extends JavaBeanDeserializer {

    public ThrowableDeserializer(ParserConfig mapping, Class<?> clazz){
        super(mapping, clazz, clazz);
    }


            

Reported by PMD.

The method 'deserialze(DefaultJSONParser, Type, Object)' has a NCSS line count of 93.
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

The method 'deserialze' has a Standard Cyclomatic Complexity of 33.
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

The method 'deserialze' has a Modified Cyclomatic Complexity of 33.
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

Avoid really long methods.
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

The method 'deserialze(DefaultJSONParser, Type, Object)' has an NPath complexity of 896112, current threshold is 200
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

The method 'deserialze(DefaultJSONParser, Type, Object)' has a cyclomatic complexity of 39.
Design

Line: 25

                  }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;

            

Reported by PMD.

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

Line: 28

                  public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.lexer;
        
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            return null;
        }

        if (parser.getResolveStatus() == DefaultJSONParser.TypeNameRedirect) {

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/JSONSerializerTest.java
57 issues
This class has too many methods, consider refactoring it.
Design

Line: 19

              import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class JSONSerializerTest extends TestCase {

    public void test_0() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());


            

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: 21

              
public class JSONSerializerTest extends TestCase {

    public void test_0() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());

        Assert.assertEquals("[]", serializer.getWriter().toString());
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 25

                      JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());

        Assert.assertEquals("[]", serializer.getWriter().toString());
    }

    public void test_0_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());

            

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: 28

                      Assert.assertEquals("[]", serializer.getWriter().toString());
    }

    public void test_0_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());

        Assert.assertEquals("[]", serializer.getWriter().toString());
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 32

                      JSONSerializer serializer = new JSONSerializer();
        serializer.write(new C());

        Assert.assertEquals("[]", serializer.getWriter().toString());
    }

    public void test_1() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

            

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: 35

                      Assert.assertEquals("[]", serializer.getWriter().toString());
    }

    public void test_1() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

        Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 39

                      JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

        Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

    public void test_1_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

            

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: 42

                      Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

    public void test_1_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

        Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 46

                      JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.singletonList(1));

        Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

    public void test_2() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.EMPTY_MAP);

            

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: 49

                      Assert.assertEquals("[1]", serializer.getWriter().toString());
    }

    public void test_2() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(Collections.EMPTY_MAP);

        Assert.assertEquals("{}", serializer.getWriter().toString());
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/extract/JSONPath_extract_2_book.java
56 issues
This class has too many methods, consider refactoring it.
Design

Line: 10

              import java.io.InputStream;
import java.io.InputStreamReader;

public class JSONPath_extract_2_book extends TestCase {

    public void test_0() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book.author")
                    .toString());

            

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 JSONPath_extract_2_book extends TestCase {

    public void test_0() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book.author")
                    .toString());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

              public class JSONPath_extract_2_book extends TestCase {

    public void test_0() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book.author")
                    .toString());
    }

    public void test_1() throws Exception {

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 14

              
    public void test_0() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book.author")
                    .toString());
    }

    public void test_1() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"

            

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: 18

                                  .toString());
    }

    public void test_1() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book[*].author")
                        .toString());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 19

                  }

    public void test_1() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book[*].author")
                        .toString());
    }

    public void test_2() throws Exception {

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 20

              
    public void test_1() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$.store.book[*].author")
                        .toString());
    }

    public void test_2() throws Exception {
        assertNull(JSONPath.extract(json, "$.author"));

            

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: 24

                                      .toString());
    }

    public void test_2() throws Exception {
        assertNull(JSONPath.extract(json, "$.author"));
    }

    public void test_3() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 25

                  }

    public void test_2() throws Exception {
        assertNull(JSONPath.extract(json, "$.author"));
    }

    public void test_3() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$..author")

            

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: 28

                      assertNull(JSONPath.extract(json, "$.author"));
    }

    public void test_3() throws Exception {
        assertEquals("[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
                , JSONPath.extract(json, "$..author")
                        .toString());
    }


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_scanFieldBoolean.java
55 issues
This class has too many methods, consider refactoring it.
Design

Line: 8

              
import com.alibaba.fastjson.JSON;

public class JSONScannerTest_scanFieldBoolean extends TestCase {

    public void test_true() throws Exception {
        String text = "{\"value\":true}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());

            

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: 10

              
public class JSONScannerTest_scanFieldBoolean extends TestCase {

    public void test_true() throws Exception {
        String text = "{\"value\":true}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());
    }


            

Reported by PMD.

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

Line: 13

                  public void test_true() throws Exception {
        String text = "{\"value\":true}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());
    }

    public void test_false() throws Exception {
        String text = "{\"value\":false}";
        VO obj = JSON.parseObject(text, VO.class);

            

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: 16

                      Assert.assertEquals(true, obj.getValue());
    }

    public void test_false() throws Exception {
        String text = "{\"value\":false}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }


            

Reported by PMD.

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

Line: 19

                  public void test_false() throws Exception {
        String text = "{\"value\":false}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }

    public void test_1() throws Exception {
        String text = "{\"value\":\"true\"}";
        VO obj = JSON.parseObject(text, VO.class);

            

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: 22

                      Assert.assertEquals(false, obj.getValue());
    }

    public void test_1() throws Exception {
        String text = "{\"value\":\"true\"}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());
    }


            

Reported by PMD.

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

Line: 25

                  public void test_1() throws Exception {
        String text = "{\"value\":\"true\"}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());
    }

    public void test_2() throws Exception {
        String text = "{\"value\":\"false\"}";
        VO obj = JSON.parseObject(text, VO.class);

            

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: 28

                      Assert.assertEquals(true, obj.getValue());
    }

    public void test_2() throws Exception {
        String text = "{\"value\":\"false\"}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }


            

Reported by PMD.

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

Line: 31

                  public void test_2() throws Exception {
        String text = "{\"value\":\"false\"}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }

    public void test_3() throws Exception {
        String text = "{\"value\":\"1\"}";
        VO obj = JSON.parseObject(text, VO.class);

            

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: 34

                      Assert.assertEquals(false, obj.getValue());
    }

    public void test_3() throws Exception {
        String text = "{\"value\":\"1\"}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(true, obj.getValue());
    }
    

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2600/Issue2617.java
55 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 21

              public class Issue2617 extends TestCase {

	// 场景:通过@JSONField(deserializeUsing = MyDateDeserializer.class)来自定义解析
	public void test_for_issue() throws Exception {
		String str = "{ \"a\": { \"date\": 6, \"day\": 2, \"hours\": 18, \"minutes\": 37, \"month\": 7, \"seconds\": 1, \"time\": 1565087821607, \"timezoneOffset\": -480, \"year\": 119 } }";
		Date date = JSON.parseObject(str, A.class).getA();
		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());

            

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: 21

              public class Issue2617 extends TestCase {

	// 场景:通过@JSONField(deserializeUsing = MyDateDeserializer.class)来自定义解析
	public void test_for_issue() throws Exception {
		String str = "{ \"a\": { \"date\": 6, \"day\": 2, \"hours\": 18, \"minutes\": 37, \"month\": 7, \"seconds\": 1, \"time\": 1565087821607, \"timezoneOffset\": -480, \"year\": 119 } }";
		Date date = JSON.parseObject(str, A.class).getA();
		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 23

              	// 场景:通过@JSONField(deserializeUsing = MyDateDeserializer.class)来自定义解析
	public void test_for_issue() throws Exception {
		String str = "{ \"a\": { \"date\": 6, \"day\": 2, \"hours\": 18, \"minutes\": 37, \"month\": 7, \"seconds\": 1, \"time\": 1565087821607, \"timezoneOffset\": -480, \"year\": 119 } }";
		Date date = JSON.parseObject(str, A.class).getA();
		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 26

              		Date date = JSON.parseObject(str, A.class).getA();
		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());

            

Reported by PMD.

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

Line: 26

              		Date date = JSON.parseObject(str, A.class).getA();
		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());

            

Reported by PMD.

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

Line: 27

              		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());
		assertEquals(date2.getTime(), date.getTime());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 27

              		Date date2 = new Date(1565087821607L);

		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());
		assertEquals(date2.getTime(), date.getTime());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 28

              
		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());
		assertEquals(date2.getTime(), date.getTime());
		assertEquals(date2.getTimezoneOffset(), date.getTimezoneOffset());

            

Reported by PMD.

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

Line: 28

              
		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());
		assertEquals(date2.getTime(), date.getTime());
		assertEquals(date2.getTimezoneOffset(), date.getTimezoneOffset());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 29

              		assertEquals(date2.getDate(), date.getDate());
		assertEquals(date2.getDay(), date.getDay());
		assertEquals(date2.getHours(), date.getHours());
		assertEquals(date2.getMinutes(), date.getMinutes());
		assertEquals(date2.getMonth(), date.getMonth());
		assertEquals(date2.getSeconds(), date.getSeconds());
		assertEquals(date2.getTime(), date.getTime());
		assertEquals(date2.getTimezoneOffset(), date.getTimezoneOffset());
		assertEquals(date2.getYear(), date.getYear());

            

Reported by PMD.