文章分类 - java
org.apache.commons.lang3
[问题解决]Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.
摘要:背景以及问题 记处理一次sonarqube扫出来的代码问题。 代码 public void main() { try { Thread.sleep(100L); } catch (Exception e) { log.error("err. "e); } } sonar提示问题 Either re-
阅读全文
摘要:介绍 compute是java8 Map接口带来的默认接口函数, 其他相关函数computeIfPresent computeIfAbsent compute 源码如下, 1. newValue替换oldValue,返回newValue 2. 如果newValue==null则剔除元素。 //源码
阅读全文
摘要:StopWatch 计时器 开始/结束(createStarted) StopWatch stopWatch = StopWatch.createStarted(); stopWatch.stop(); 开始、获取某一时刻、结束 StopWatch stopWatch = new StopWatch
阅读全文
摘要:简单使用 public class Solution { public static void main(String... arg) { /** * 创建 */ //string BigDecimal bigDecimal = new BigDecimal("1.010"); //int bigD
阅读全文
摘要:public class Solution { private static Boolean result; public static void main(String... arg) { String str = "13"; //判空 StringUtils.isBlank(str); Stri
阅读全文
摘要:简单使用 创建 public class Test { public static void main(String... arg) { BitSet bitSet = new BitSet(8); System.out.println(bitSet); //BitSet 中最高设置位的索引加 1
阅读全文