The following issues were found
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallRoleService.java
9 issues
Line: 19
@Service
public class LitemallRoleService {
@Resource
private LitemallRoleMapper roleMapper;
public Set<String> queryByIds(Integer[] roleIds) {
Set<String> roles = new HashSet<String>();
if(roleIds.length == 0){
Reported by PMD.
Line: 29
}
LitemallRoleExample example = new LitemallRoleExample();
example.or().andIdIn(Arrays.asList(roleIds)).andEnabledEqualTo(true).andDeletedEqualTo(false);
List<LitemallRole> roleList = roleMapper.selectByExample(example);
for(LitemallRole role : roleList){
roles.add(role.getName());
}
Reported by PMD.
Line: 29
}
LitemallRoleExample example = new LitemallRoleExample();
example.or().andIdIn(Arrays.asList(roleIds)).andEnabledEqualTo(true).andDeletedEqualTo(false);
List<LitemallRole> roleList = roleMapper.selectByExample(example);
for(LitemallRole role : roleList){
roles.add(role.getName());
}
Reported by PMD.
Line: 29
}
LitemallRoleExample example = new LitemallRoleExample();
example.or().andIdIn(Arrays.asList(roleIds)).andEnabledEqualTo(true).andDeletedEqualTo(false);
List<LitemallRole> roleList = roleMapper.selectByExample(example);
for(LitemallRole role : roleList){
roles.add(role.getName());
}
Reported by PMD.
Line: 47
if (!StringUtils.isEmpty(name)) {
criteria.andNameLike("%" + name + "%");
}
criteria.andDeletedEqualTo(false);
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
example.setOrderByClause(sort + " " + order);
}
Reported by PMD.
Line: 78
public boolean checkExist(String name) {
LitemallRoleExample example = new LitemallRoleExample();
example.or().andNameEqualTo(name).andDeletedEqualTo(false);
return roleMapper.countByExample(example) != 0;
}
public List<LitemallRole> queryAll() {
LitemallRoleExample example = new LitemallRoleExample();
Reported by PMD.
Line: 78
public boolean checkExist(String name) {
LitemallRoleExample example = new LitemallRoleExample();
example.or().andNameEqualTo(name).andDeletedEqualTo(false);
return roleMapper.countByExample(example) != 0;
}
public List<LitemallRole> queryAll() {
LitemallRoleExample example = new LitemallRoleExample();
Reported by PMD.
Line: 84
public List<LitemallRole> queryAll() {
LitemallRoleExample example = new LitemallRoleExample();
example.or().andDeletedEqualTo(false);
return roleMapper.selectByExample(example);
}
}
Reported by PMD.
Line: 22
private LitemallRoleMapper roleMapper;
public Set<String> queryByIds(Integer[] roleIds) {
Set<String> roles = new HashSet<String>();
if(roleIds.length == 0){
return roles;
}
Reported by PMD.
litemall-core/src/main/java/org/linlinjava/litemall/core/task/Task.java
9 issues
Line: 10
import java.util.concurrent.TimeUnit;
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
Reported by PMD.
Line: 10
import java.util.concurrent.TimeUnit;
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
Reported by PMD.
Line: 10
import java.util.concurrent.TimeUnit;
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
Reported by PMD.
Line: 11
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
}
Reported by PMD.
Line: 11
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
}
Reported by PMD.
Line: 11
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
}
Reported by PMD.
Line: 11
public abstract class Task implements Delayed, Runnable{
private String id = "";
private long start = 0;
public Task(String id, long delayInMilliseconds){
this.id = id;
this.start = System.currentTimeMillis() + delayInMilliseconds;
}
Reported by PMD.
Line: 41
return false;
}
Task t = (Task)o;
return this.id.equals(t.getId());
}
@Override
public int hashCode() {
return this.id.hashCode();
Reported by PMD.
Line: 5
import com.google.common.primitives.Ints;
import java.time.LocalDateTime;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
public abstract class Task implements Delayed, Runnable{
private String id = "";
Reported by PMD.
litemall-core/src/main/java/org/linlinjava/litemall/core/util/SystemInfoPrinter.java
9 issues
Line: 44
private static void printHeader(String title) {
logger.info(getLineCopper());
logger.info("");
logger.info(" " + title);
logger.info("");
}
private static void printEnd() {
logger.info(" ");
Reported by PMD.
Line: 68
if (head.startsWith(CREATE_PART_COPPER)) {
logger.info("");
logger.info(" [[ " + line + " ]]");
logger.info("");
} else {
logger.info(" " + head + " -> " + line);
}
}
Reported by PMD.
Line: 71
logger.info(" [[ " + line + " ]]");
logger.info("");
} else {
logger.info(" " + head + " -> " + line);
}
}
}
Reported by PMD.
Line: 8
import java.util.Map;
public class SystemInfoPrinter {
private static final Log logger = LogFactory.getLog(SystemInfoPrinter.class);
public static final String CREATE_PART_COPPER = "XOXOXOXOX";
private static int maxSize = 0;
Reported by PMD.
Line: 10
public class SystemInfoPrinter {
private static final Log logger = LogFactory.getLog(SystemInfoPrinter.class);
public static final String CREATE_PART_COPPER = "XOXOXOXOX";
private static int maxSize = 0;
public static void printInfo(String title, Map<String, String> infos) {
Reported by PMD.
Line: 13
private static final Log logger = LogFactory.getLog(SystemInfoPrinter.class);
public static final String CREATE_PART_COPPER = "XOXOXOXOX";
private static int maxSize = 0;
public static void printInfo(String title, Map<String, String> infos) {
setMaxSize(infos);
printHeader(title);
Reported by PMD.
Line: 32
if (entry.getValue() == null)
continue;
int size = entry.getKey().length() + entry.getValue().length();
if (size > maxSize)
maxSize = size;
}
Reported by PMD.
Line: 32
if (entry.getValue() == null)
continue;
int size = entry.getKey().length() + entry.getValue().length();
if (size > maxSize)
maxSize = size;
}
Reported by PMD.
Line: 56
private static String getLineCopper() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < maxSize; i++) {
sb.append("=");
}
return sb.toString();
}
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/util/OrderHandleOption.java
9 issues
Line: 3
package org.linlinjava.litemall.db.util;
public class OrderHandleOption {
private boolean cancel = false; // 取消操作
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
Reported by PMD.
Line: 4
package org.linlinjava.litemall.db.util;
public class OrderHandleOption {
private boolean cancel = false; // 取消操作
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
Reported by PMD.
Line: 5
public class OrderHandleOption {
private boolean cancel = false; // 取消操作
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
Reported by PMD.
Line: 6
public class OrderHandleOption {
private boolean cancel = false; // 取消操作
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
Reported by PMD.
Line: 7
private boolean cancel = false; // 取消操作
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
Reported by PMD.
Line: 8
private boolean delete = false; // 删除操作
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
public boolean isCancel() {
Reported by PMD.
Line: 9
private boolean pay = false; // 支付操作
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
public boolean isCancel() {
return cancel;
Reported by PMD.
Line: 10
private boolean comment = false; // 评论操作
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
public boolean isCancel() {
return cancel;
}
Reported by PMD.
Line: 11
private boolean confirm = false; // 确认收货操作
private boolean refund = false; // 取消订单并退款操作
private boolean rebuy = false; // 再次购买
private boolean aftersale = false; // 售后操作
public boolean isCancel() {
return cancel;
}
Reported by PMD.
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/CaptchaCodeManager.java
9 issues
Line: 13
/**
* 缓存系统中的验证码
*/
public class CaptchaCodeManager {
private static ConcurrentHashMap<String, CaptchaItem> captchaCodeCache = new ConcurrentHashMap<>();
/**
* 添加到缓存
*
Reported by PMD.
Line: 27
//已经发过验证码且验证码还未过期
if (captchaCodeCache.get(phoneNumber) != null) {
if (captchaCodeCache.get(phoneNumber).getExpireTime().isAfter(LocalDateTime.now())) {
return false;
} else {
//存在但是已过期,删掉
captchaCodeCache.remove(phoneNumber);
}
Reported by PMD.
Line: 27
//已经发过验证码且验证码还未过期
if (captchaCodeCache.get(phoneNumber) != null) {
if (captchaCodeCache.get(phoneNumber).getExpireTime().isAfter(LocalDateTime.now())) {
return false;
} else {
//存在但是已过期,删掉
captchaCodeCache.remove(phoneNumber);
}
Reported by PMD.
Line: 39
captchaItem.setPhoneNumber(phoneNumber);
captchaItem.setCode(code);
// 有效期为1分钟
captchaItem.setExpireTime(LocalDateTime.now().plusMinutes(1));
captchaCodeCache.put(phoneNumber, captchaItem);
return true;
}
Reported by PMD.
Line: 58
return null;
//有电话记录但是已经过期
if (captchaCodeCache.get(phoneNumber).getExpireTime().isBefore(LocalDateTime.now())) {
return null;
}
return captchaCodeCache.get(phoneNumber).getCode();
}
Reported by PMD.
Line: 58
return null;
//有电话记录但是已经过期
if (captchaCodeCache.get(phoneNumber).getExpireTime().isBefore(LocalDateTime.now())) {
return null;
}
return captchaCodeCache.get(phoneNumber).getCode();
}
Reported by PMD.
Line: 62
return null;
}
return captchaCodeCache.get(phoneNumber).getCode();
}
}
Reported by PMD.
Line: 6
import org.linlinjava.litemall.wx.dto.CaptchaItem;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 缓存系统中的验证码
Reported by PMD.
Line: 7
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 缓存系统中的验证码
*/
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCouponController.java
8 issues
Line: 27
@RequestMapping("/admin/coupon")
@Validated
public class AdminCouponController {
private final Log logger = LogFactory.getLog(AdminCouponController.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
Reported by PMD.
Line: 27
@RequestMapping("/admin/coupon")
@Validated
public class AdminCouponController {
private final Log logger = LogFactory.getLog(AdminCouponController.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
Reported by PMD.
Line: 30
private final Log logger = LogFactory.getLog(AdminCouponController.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
@RequiresPermissions("admin:coupon:list")
@RequiresPermissionsDesc(menu = {"推广管理", "优惠券管理"}, button = "查询")
Reported by PMD.
Line: 32
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
@RequiresPermissions("admin:coupon:list")
@RequiresPermissionsDesc(menu = {"推广管理", "优惠券管理"}, button = "查询")
@GetMapping("/list")
public Object list(String name, Short type, Short status,
Reported by PMD.
Line: 35
private LitemallCouponUserService couponUserService;
@RequiresPermissions("admin:coupon:list")
@RequiresPermissionsDesc(menu = {"推广管理", "优惠券管理"}, button = "查询")
@GetMapping("/list")
public Object list(String name, Short type, Short status,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 35
private LitemallCouponUserService couponUserService;
@RequiresPermissions("admin:coupon:list")
@RequiresPermissionsDesc(menu = {"推广管理", "优惠券管理"}, button = "查询")
@GetMapping("/list")
public Object list(String name, Short type, Short status,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 77
}
// 如果是兑换码类型,则这里需要生存一个兑换码
if (coupon.getType().equals(CouponConstant.TYPE_CODE)) {
String code = couponService.generateCode();
coupon.setCode(code);
}
couponService.add(coupon);
Reported by PMD.
Line: 18
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
@RestController
Reported by PMD.
litemall-core/src/test/java/org/linlinjava/litemall/core/SmsTest.java
8 issues
Line: 37
public class SmsTest {
@Autowired
private NotifyService notifyService;
@Test
public void testCaptcha() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
Reported by PMD.
Line: 40
private NotifyService notifyService;
@Test
public void testCaptcha() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.CAPTCHA, params);
}
Reported by PMD.
Line: 41
@Test
public void testCaptcha() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.CAPTCHA, params);
}
Reported by PMD.
Line: 42
@Test
public void testCaptcha() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.CAPTCHA, params);
}
@Test
Reported by PMD.
Line: 48
}
@Test
public void testPaySucceed() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.PAY_SUCCEED, params);
}
Reported by PMD.
Line: 56
}
@Test
public void testShip() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.SHIP, params);
}
Reported by PMD.
Line: 64
}
@Test
public void testRefund() {
String phone = "xxxxxxxxxxx";
String[] params = new String[]{"123456"};
notifyService.notifySmsTemplate(phone, NotifyType.REFUND, params);
}
Reported by PMD.
Line: 14
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import java.util.concurrent.Executor;
Reported by PMD.
litemall-db/src/test/java/org/linlinjava/litemall/db/StatMapperTest.java
8 issues
Line: 27
public void testUser() {
List<Map> result = statMapper.statUser();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
@Test
public void testOrder() {
Reported by PMD.
Line: 35
public void testOrder() {
List<Map> result = statMapper.statOrder();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
@Test
public void testGoods() {
Reported by PMD.
Line: 43
public void testGoods() {
List<Map> result = statMapper.statGoods();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
}
Reported by PMD.
Line: 21
public class StatMapperTest {
@Autowired
private StatMapper statMapper;
@Test
public void testUser() {
List<Map> result = statMapper.statUser();
for (Map m : result) {
Reported by PMD.
Line: 24
private StatMapper statMapper;
@Test
public void testUser() {
List<Map> result = statMapper.statUser();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
Reported by PMD.
Line: 32
}
@Test
public void testOrder() {
List<Map> result = statMapper.statOrder();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
Reported by PMD.
Line: 40
}
@Test
public void testGoods() {
List<Map> result = statMapper.statGoods();
for (Map m : result) {
m.forEach((k, v) -> System.out.println("key:value = " + k + ":" + v));
}
}
Reported by PMD.
Line: 8
import org.linlinjava.litemall.db.dao.StatMapper;
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;
import java.util.List;
import java.util.Map;
Reported by PMD.
litemall-all/src/test/java/org/linlinjava/litemall/allinone/AllinoneConfigTest.java
8 issues
Line: 21
@Test
public void test() {
// 测试获取application-core.yml配置信息
System.out.println(environment.getProperty("litemall.express.appId"));
// 测试获取application-db.yml配置信息
System.out.println(environment.getProperty("spring.datasource.druid.url"));
// 测试获取application-wx.yml配置信息
System.out.println(environment.getProperty("litemall.wx.app-id"));
// 测试获取application-admin.yml配置信息
Reported by PMD.
Line: 23
// 测试获取application-core.yml配置信息
System.out.println(environment.getProperty("litemall.express.appId"));
// 测试获取application-db.yml配置信息
System.out.println(environment.getProperty("spring.datasource.druid.url"));
// 测试获取application-wx.yml配置信息
System.out.println(environment.getProperty("litemall.wx.app-id"));
// 测试获取application-admin.yml配置信息
// System.out.println(environment.getProperty(""));
// 测试获取application.yml配置信息
Reported by PMD.
Line: 25
// 测试获取application-db.yml配置信息
System.out.println(environment.getProperty("spring.datasource.druid.url"));
// 测试获取application-wx.yml配置信息
System.out.println(environment.getProperty("litemall.wx.app-id"));
// 测试获取application-admin.yml配置信息
// System.out.println(environment.getProperty(""));
// 测试获取application.yml配置信息
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.wx"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.admin"));
Reported by PMD.
Line: 29
// 测试获取application-admin.yml配置信息
// System.out.println(environment.getProperty(""));
// 测试获取application.yml配置信息
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.wx"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.admin"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall"));
}
}
Reported by PMD.
Line: 30
// System.out.println(environment.getProperty(""));
// 测试获取application.yml配置信息
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.wx"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.admin"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall"));
}
}
Reported by PMD.
Line: 31
// 测试获取application.yml配置信息
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.wx"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.admin"));
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall"));
}
}
Reported by PMD.
Line: 16
@SpringBootTest
public class AllinoneConfigTest {
@Autowired
private Environment environment;
@Test
public void test() {
// 测试获取application-core.yml配置信息
System.out.println(environment.getProperty("litemall.express.appId"));
Reported by PMD.
Line: 19
private Environment environment;
@Test
public void test() {
// 测试获取application-core.yml配置信息
System.out.println(environment.getProperty("litemall.express.appId"));
// 测试获取application-db.yml配置信息
System.out.println(environment.getProperty("spring.datasource.druid.url"));
// 测试获取application-wx.yml配置信息
Reported by PMD.
litemall-core/src/test/java/org/linlinjava/litemall/core/IntegerTest.java
8 issues
Line: 8
public class IntegerTest {
@Test
public void test() {
Integer a = new Integer(512);
int b = 512;
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
Reported by PMD.
Line: 10
public void test() {
Integer a = new Integer(512);
int b = 512;
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
Reported by PMD.
Line: 11
Integer a = new Integer(512);
int b = 512;
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
}
Reported by PMD.
Line: 12
int b = 512;
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
}
Reported by PMD.
Line: 13
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
}
Reported by PMD.
Line: 14
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
}
Reported by PMD.
Line: 7
public class IntegerTest {
@Test
public void test() {
Integer a = new Integer(512);
int b = 512;
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
Reported by PMD.
Line: 13
Integer c = new Integer(512);
System.out.println(a==b);
System.out.println(a.equals(b));
System.out.println(a == c);
System.out.println(a.equals(c));
}
}
Reported by PMD.