The following issues were found

litemall-core/src/main/java/org/linlinjava/litemall/core/util/RegexUtil.java
7 issues
A class which only has private constructors should be final
Design

Line: 15

               * https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/constant
 * /RegexConstants.java
 */
public class RegexUtil {

    /**
     * Regex of simple mobile.
     */
    public static final String REGEX_MOBILE_SIMPLE = "^[1]\\d{10}$";

            

Reported by PMD.

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

Line: 268

                          return Collections.emptyList();
        List<String> matches = new ArrayList<>();
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        while (matcher.find()) {
            matches.add(matcher.group());
        }
        return matches;
    }

            

Reported by PMD.

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

Line: 269

                      List<String> matches = new ArrayList<>();
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        while (matcher.find()) {
            matches.add(matcher.group());
        }
        return matches;
    }


            

Reported by PMD.

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

Line: 304

                                                       final String replacement) {
        if (input == null)
            return "";
        return Pattern.compile(regex).matcher(input).replaceFirst(replacement);
    }

    /**
     * Replace every subsequence of the input sequence that matches the
     * pattern with the given replacement string.

            

Reported by PMD.

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

Line: 304

                                                       final String replacement) {
        if (input == null)
            return "";
        return Pattern.compile(regex).matcher(input).replaceFirst(replacement);
    }

    /**
     * Replace every subsequence of the input sequence that matches the
     * pattern with the given replacement string.

            

Reported by PMD.

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

Line: 323

                                                     final String replacement) {
        if (input == null)
            return "";
        return Pattern.compile(regex).matcher(input).replaceAll(replacement);
    }
}

            

Reported by PMD.

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

Line: 323

                                                     final String replacement) {
        if (input == null)
            return "";
        return Pattern.compile(regex).matcher(input).replaceAll(replacement);
    }
}

            

Reported by PMD.

litemall-core/src/main/java/org/linlinjava/litemall/core/util/bcrypt/BCryptPasswordEncoder.java
7 issues
Logger should be defined private static final and have the correct class
Error

Line: 33

               * @author Dave Syer
 */
public class BCryptPasswordEncoder {
    private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");


            

Reported by PMD.

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

Line: 33

               * @author Dave Syer
 */
public class BCryptPasswordEncoder {
    private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");


            

Reported by PMD.

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

Line: 34

               */
public class BCryptPasswordEncoder {
    private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");

    public BCryptPasswordEncoder() {

            

Reported by PMD.

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

Line: 35

              public class BCryptPasswordEncoder {
    private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");

    public BCryptPasswordEncoder() {
        this(-1);

            

Reported by PMD.

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

Line: 36

                  private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");

    public BCryptPasswordEncoder() {
        this(-1);
    }

            

Reported by PMD.

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

Line: 36

                  private final Log logger = LogFactory.getLog(getClass());
    private final int strength;
    private final SecureRandom random;
    private Pattern BCRYPT_PATTERN = Pattern
            .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");

    public BCryptPasswordEncoder() {
        this(-1);
    }

            

Reported by PMD.

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

Line: 82

                          return false;
        }

        if (!BCRYPT_PATTERN.matcher(encodedPassword).matches()) {
            logger.warn("Encoded password does not look like BCrypt");
            return false;
        }

        return BCrypt.checkpw(rawPassword.toString(), encodedPassword);

            

Reported by PMD.

litemall-core/src/test/java/org/linlinjava/litemall/core/ExpressTest.java
7 issues
Logger should be defined private static final and have the correct class
Error

Line: 20

              @SpringBootTest(classes = Application.class)
public class ExpressTest {

    private final Log logger = LogFactory.getLog(ExpressTest.class);
    @Autowired
    private ExpressService expressService;

    @Test
    public void test() {

            

Reported by PMD.

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

Line: 20

              @SpringBootTest(classes = Application.class)
public class ExpressTest {

    private final Log logger = LogFactory.getLog(ExpressTest.class);
    @Autowired
    private ExpressService expressService;

    @Test
    public void test() {

            

Reported by PMD.

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

Line: 22

              
    private final Log logger = LogFactory.getLog(ExpressTest.class);
    @Autowired
    private ExpressService expressService;

    @Test
    public void test() {
        ExpressInfo ei = null;
        try {

            

Reported by PMD.

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

Line: 25

                  private ExpressService expressService;

    @Test
    public void test() {
        ExpressInfo ei = null;
        try {
            ei = expressService.getExpressInfo("YTO", "800669400640887922");
        } catch (Exception e) {
            logger.error(e.getMessage(), e);

            

Reported by PMD.

Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Design

Line: 29

                      ExpressInfo ei = null;
        try {
            ei = expressService.getExpressInfo("YTO", "800669400640887922");
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
        logger.info(ei);
    }
}

            

Reported by PMD.

Avoid unused imports such as 'org.springframework.test.context.junit4.SpringJUnit4ClassRunner'
Design

Line: 11

              import org.linlinjava.litemall.core.express.dao.ExpressInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

@WebAppConfiguration
@RunWith(SpringRunner.class)

            

Reported by PMD.

Found 'DD'-anomaly for variable 'ei' (lines '26'-'28').
Error

Line: 26

              
    @Test
    public void test() {
        ExpressInfo ei = null;
        try {
            ei = expressService.getExpressInfo("YTO", "800669400640887922");
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/mybatis/JsonNodeTypeHandler.java
7 issues
The initializer for variable 'str' is never used (overwritten on lines 26 and 29)
Design

Line: 24

              
    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, JsonNode parameter, JdbcType jdbcType) throws SQLException {
        String str = null;
        try {
            str = mapper.writeValueAsString(parameter);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            str = "{}";

            

Reported by PMD.

Avoid printStackTrace(); use a logger call instead.
Design

Line: 28

                      try {
            str = mapper.writeValueAsString(parameter);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            str = "{}";
        }
        ps.setString(i, str);
    }


            

Reported by PMD.

Avoid printStackTrace(); use a logger call instead.
Design

Line: 44

                          JsonNode jsonNode = mapper.readTree(jsonSource);
            return jsonNode;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override

            

Reported by PMD.

Avoid printStackTrace(); use a logger call instead.
Design

Line: 59

                          JsonNode jsonNode = mapper.readTree(jsonSource);
            return jsonNode;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;

    }


            

Reported by PMD.

Avoid printStackTrace(); use a logger call instead.
Design

Line: 75

                          JsonNode jsonNode = mapper.readTree(jsonSource);
            return jsonNode;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

}
            

Reported by PMD.

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

Line: 24

              
    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, JsonNode parameter, JdbcType jdbcType) throws SQLException {
        String str = null;
        try {
            str = mapper.writeValueAsString(parameter);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            str = "{}";

            

Reported by PMD.

Found 'DD'-anomaly for variable 'str' (lines '26'-'29').
Error

Line: 26

                  public void setNonNullParameter(PreparedStatement ps, int i, JsonNode parameter, JdbcType jdbcType) throws SQLException {
        String str = null;
        try {
            str = mapper.writeValueAsString(parameter);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            str = "{}";
        }
        ps.setString(i, str);

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallBrandService.java
7 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 18

              @Service
public class LitemallBrandService {
    @Resource
    private LitemallBrandMapper brandMapper;
    private Column[] columns = new Column[]{Column.id, Column.name, Column.desc, Column.picUrl, Column.floorPrice};

    public List<LitemallBrand> query(Integer page, Integer limit, String sort, String order) {
        LitemallBrandExample example = new LitemallBrandExample();
        example.or().andDeletedEqualTo(false);

            

Reported by PMD.

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

Line: 19

              public class LitemallBrandService {
    @Resource
    private LitemallBrandMapper brandMapper;
    private Column[] columns = new Column[]{Column.id, Column.name, Column.desc, Column.picUrl, Column.floorPrice};

    public List<LitemallBrand> query(Integer page, Integer limit, String sort, String order) {
        LitemallBrandExample example = new LitemallBrandExample();
        example.or().andDeletedEqualTo(false);
        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {

            

Reported by PMD.

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

Line: 19

              public class LitemallBrandService {
    @Resource
    private LitemallBrandMapper brandMapper;
    private Column[] columns = new Column[]{Column.id, Column.name, Column.desc, Column.picUrl, Column.floorPrice};

    public List<LitemallBrand> query(Integer page, Integer limit, String sort, String order) {
        LitemallBrandExample example = new LitemallBrandExample();
        example.or().andDeletedEqualTo(false);
        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {

            

Reported by PMD.

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

Line: 23

              
    public List<LitemallBrand> query(Integer page, Integer limit, String sort, String order) {
        LitemallBrandExample example = new LitemallBrandExample();
        example.or().andDeletedEqualTo(false);
        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
            example.setOrderByClause(sort + " " + order);
        }
        PageHelper.startPage(page, limit);
        return brandMapper.selectByExampleSelective(example, columns);

            

Reported by PMD.

Rather than using a lot of String arguments, consider using a container object for those values.
Design

Line: 39

                      return brandMapper.selectByPrimaryKey(id);
    }

    public List<LitemallBrand> querySelective(String id, String name, Integer page, Integer size, String sort, String order) {
        LitemallBrandExample example = new LitemallBrandExample();
        LitemallBrandExample.Criteria criteria = example.createCriteria();

        if (!StringUtils.isEmpty(id)) {
            criteria.andIdEqualTo(Integer.valueOf(id));

            

Reported by PMD.

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

Line: 49

                      if (!StringUtils.isEmpty(name)) {
            criteria.andNameLike("%" + name + "%");
        }
        criteria.andDeletedEqualTo(false);

        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
            example.setOrderByClause(sort + " " + order);
        }


            

Reported by PMD.

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

Line: 76

              
    public List<LitemallBrand> all() {
        LitemallBrandExample example = new LitemallBrandExample();
        example.or().andDeletedEqualTo(false);
        return brandMapper.selectByExample(example);
    }
}

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGoodsProductService.java
7 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 17

              @Service
public class LitemallGoodsProductService {
    @Resource
    private LitemallGoodsProductMapper litemallGoodsProductMapper;
    @Resource
    private GoodsProductMapper goodsProductMapper;

    public List<LitemallGoodsProduct> queryByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();

            

Reported by PMD.

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

Line: 19

                  @Resource
    private LitemallGoodsProductMapper litemallGoodsProductMapper;
    @Resource
    private GoodsProductMapper goodsProductMapper;

    public List<LitemallGoodsProduct> queryByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();
        example.or().andGoodsIdEqualTo(gid).andDeletedEqualTo(false);
        return litemallGoodsProductMapper.selectByExample(example);

            

Reported by PMD.

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

Line: 23

              
    public List<LitemallGoodsProduct> queryByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();
        example.or().andGoodsIdEqualTo(gid).andDeletedEqualTo(false);
        return litemallGoodsProductMapper.selectByExample(example);
    }

    public LitemallGoodsProduct findById(Integer id) {
        return litemallGoodsProductMapper.selectByPrimaryKey(id);

            

Reported by PMD.

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

Line: 23

              
    public List<LitemallGoodsProduct> queryByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();
        example.or().andGoodsIdEqualTo(gid).andDeletedEqualTo(false);
        return litemallGoodsProductMapper.selectByExample(example);
    }

    public LitemallGoodsProduct findById(Integer id) {
        return litemallGoodsProductMapper.selectByPrimaryKey(id);

            

Reported by PMD.

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

Line: 43

              
    public int count() {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();
        example.or().andDeletedEqualTo(false);
        return (int) litemallGoodsProductMapper.countByExample(example);
    }

    public void deleteByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();

            

Reported by PMD.

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

Line: 49

              
    public void deleteByGid(Integer gid) {
        LitemallGoodsProductExample example = new LitemallGoodsProductExample();
        example.or().andGoodsIdEqualTo(gid);
        litemallGoodsProductMapper.logicalDeleteByExample(example);
    }

    public int addStock(Integer id, Short num){
        return goodsProductMapper.addStock(id, num);

            

Reported by PMD.

Avoid unused imports such as 'org.apache.ibatis.annotations.Param'
Design

Line: 3

              package org.linlinjava.litemall.db.service;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.dao.GoodsProductMapper;
import org.linlinjava.litemall.db.dao.LitemallGoodsProductMapper;
import org.linlinjava.litemall.db.domain.LitemallGoodsProduct;
import org.linlinjava.litemall.db.domain.LitemallGoodsProductExample;
import org.springframework.stereotype.Service;


            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallNoticeService.java
7 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 19

              @Service
public class LitemallNoticeService {
    @Resource
    private LitemallNoticeMapper noticeMapper;


    public List<LitemallNotice> querySelective(String title, String content, Integer page, Integer limit, String sort, String order) {
        LitemallNoticeExample example = new LitemallNoticeExample();
        LitemallNoticeExample.Criteria criteria = example.createCriteria();

            

Reported by PMD.

Rather than using a lot of String arguments, consider using a container object for those values.
Design

Line: 22

                  private LitemallNoticeMapper noticeMapper;


    public List<LitemallNotice> querySelective(String title, String content, Integer page, Integer limit, String sort, String order) {
        LitemallNoticeExample example = new LitemallNoticeExample();
        LitemallNoticeExample.Criteria criteria = example.createCriteria();

        if (!StringUtils.isEmpty(title)) {
            criteria.andTitleLike("%" + title + "%");

            

Reported by PMD.

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

Line: 32

                      if (!StringUtils.isEmpty(content)) {
            criteria.andContentLike("%" + content + "%");
        }
        criteria.andDeletedEqualTo(false);

        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
            example.setOrderByClause(sort + " " + order);
        }


            

Reported by PMD.

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

Line: 63

              
    public void deleteByIds(List<Integer> ids) {
        LitemallNoticeExample example = new LitemallNoticeExample();
        example.or().andIdIn(ids).andDeletedEqualTo(false);
        LitemallNotice notice = new LitemallNotice();
        notice.setUpdateTime(LocalDateTime.now());
        notice.setDeleted(true);
        noticeMapper.updateByExampleSelective(notice, example);
    }

            

Reported by PMD.

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

Line: 63

              
    public void deleteByIds(List<Integer> ids) {
        LitemallNoticeExample example = new LitemallNoticeExample();
        example.or().andIdIn(ids).andDeletedEqualTo(false);
        LitemallNotice notice = new LitemallNotice();
        notice.setUpdateTime(LocalDateTime.now());
        notice.setDeleted(true);
        noticeMapper.updateByExampleSelective(notice, example);
    }

            

Reported by PMD.

Avoid unused imports such as 'org.linlinjava.litemall.db.domain.LitemallNoticeAdmin'
Design

Line: 6

              import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallNoticeMapper;
import org.linlinjava.litemall.db.domain.LitemallNotice;
import org.linlinjava.litemall.db.domain.LitemallNoticeAdmin;
import org.linlinjava.litemall.db.domain.LitemallNoticeAdminExample;
import org.linlinjava.litemall.db.domain.LitemallNoticeExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;


            

Reported by PMD.

Avoid unused imports such as 'org.linlinjava.litemall.db.domain.LitemallNoticeAdminExample'
Design

Line: 7

              import org.linlinjava.litemall.db.dao.LitemallNoticeMapper;
import org.linlinjava.litemall.db.domain.LitemallNotice;
import org.linlinjava.litemall.db.domain.LitemallNoticeAdmin;
import org.linlinjava.litemall.db.domain.LitemallNoticeAdminExample;
import org.linlinjava.litemall.db.domain.LitemallNoticeExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

            

Reported by PMD.

litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxIssueController.java
7 issues
Avoid unused private fields such as 'logger'.
Design

Line: 23

              @RequestMapping("/wx/issue")
@Validated
public class WxIssueController {
    private final Log logger = LogFactory.getLog(WxIssueController.class);

    @Autowired
    private LitemallIssueService issueService;

    /**

            

Reported by PMD.

Logger should be defined private static final and have the correct class
Error

Line: 23

              @RequestMapping("/wx/issue")
@Validated
public class WxIssueController {
    private final Log logger = LogFactory.getLog(WxIssueController.class);

    @Autowired
    private LitemallIssueService issueService;

    /**

            

Reported by PMD.

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

Line: 26

                  private final Log logger = LogFactory.getLog(WxIssueController.class);

    @Autowired
    private LitemallIssueService issueService;

    /**
     * 帮助中心
     */
    @GetMapping("/list")

            

Reported by PMD.

Avoid unused imports such as 'com.github.pagehelper.PageInfo'
Design

Line: 3

              package org.linlinjava.litemall.wx.web;

import com.github.pagehelper.PageInfo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.core.validator.Order;
import org.linlinjava.litemall.core.validator.Sort;
import org.linlinjava.litemall.db.domain.LitemallIssue;

            

Reported by PMD.

Avoid unused imports such as 'org.springframework.web.bind.annotation'
Design

Line: 13

              import org.linlinjava.litemall.db.service.LitemallIssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


            

Reported by PMD.

Avoid unused imports such as 'java.util.HashMap'
Design

Line: 15

              import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wx/issue")

            

Reported by PMD.

Avoid unused imports such as 'java.util.Map'
Design

Line: 17

              
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wx/issue")
@Validated
public class WxIssueController {

            

Reported by PMD.

litemall-core/src/test/java/org/linlinjava/litemall/core/AsyncTask.java
6 issues
Logger calls should be surrounded by log level guards.
Design

Line: 14

              
    @Async
    public void asyncMethod() {
        logger.info("Execute method asynchronously. "
                + Thread.currentThread().getName());
    }

    public void nonasyncMethod() {
        logger.info("Execute method nonasynchronously. "

            

Reported by PMD.

Logger calls should be surrounded by log level guards.
Design

Line: 19

                  }

    public void nonasyncMethod() {
        logger.info("Execute method nonasynchronously. "
                + Thread.currentThread().getName());
    }
}

            

Reported by PMD.

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

Line: 10

              
@Service
public class AsyncTask {
    private final Log logger = LogFactory.getLog(AsyncTask.class);

    @Async
    public void asyncMethod() {
        logger.info("Execute method asynchronously. "
                + Thread.currentThread().getName());

            

Reported by PMD.

Logger should be defined private static final and have the correct class
Error

Line: 10

              
@Service
public class AsyncTask {
    private final Log logger = LogFactory.getLog(AsyncTask.class);

    @Async
    public void asyncMethod() {
        logger.info("Execute method asynchronously. "
                + Thread.currentThread().getName());

            

Reported by PMD.

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

Line: 15

                  @Async
    public void asyncMethod() {
        logger.info("Execute method asynchronously. "
                + Thread.currentThread().getName());
    }

    public void nonasyncMethod() {
        logger.info("Execute method nonasynchronously. "
                + Thread.currentThread().getName());

            

Reported by PMD.

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

Line: 20

              
    public void nonasyncMethod() {
        logger.info("Execute method nonasynchronously. "
                + Thread.currentThread().getName());
    }
}

            

Reported by PMD.

litemall-db/sql/litemall_schema.sql
6 issues
Syntax error at or near "'litemall'"
Syntax error

Line: 2 Column: 21

              drop database if exists litemall;
drop user if exists 'litemall'@'%';
-- 支持emoji:需要mysql数据库参数: character_set_server=utf8mb4
create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci;
use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.

Syntax error at or near "default"
Syntax error

Line: 4 Column: 26

              drop database if exists litemall;
drop user if exists 'litemall'@'%';
-- 支持emoji:需要mysql数据库参数: character_set_server=utf8mb4
create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci;
use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.

Syntax error at or near "use"
Syntax error

Line: 5 Column: 1

              drop user if exists 'litemall'@'%';
-- 支持emoji:需要mysql数据库参数: character_set_server=utf8mb4
create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci;
use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.

Syntax error at or near "'litemall'"
Syntax error

Line: 6 Column: 13

              -- 支持emoji:需要mysql数据库参数: character_set_server=utf8mb4
create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci;
use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.

Syntax error at or near "to"
Syntax error

Line: 7 Column: 36

              create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci;
use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.

Syntax error at or near "flush"
Syntax error

Line: 8 Column: 1

              use litemall;
create user 'litemall'@'%' identified by 'litemall123456';
grant all privileges on litemall.* to 'litemall'@'%';
flush privileges;
            

Reported by SQLint.