随笔分类 - Java
摘要:问题: 通过debug发现result.removeAll的时候 删不了 public boolean equals(Object obj) { return obj instanceof OspSpringBoot2Initializer.OspBean && this.bean.equals((
阅读全文
摘要:官方文档 https://docs.gradle.org/current/userguide/java_testing.html test{ useJUnit() //指定使用junit执行测试。 // 打印test的进度 testLogging { events "PASSED", "STARTE
阅读全文
摘要:校验事务是否生效 debug 方法: org.springframework.transaction.interceptor.TransactionAspectSupport#invokeWithinTransaction 锁跟事务一起使用时 一般业务来说 都是锁的范围要包含事务的范围,不要等锁释放
阅读全文
摘要:gradle 项目修改这里的gradle jvm
阅读全文
摘要:maven 官方文档: https://maven.apache.org/surefire/maven-surefire-plugin/usage.html maven是通过插件 maven-surefire-plugin 来执行单元测试 指定test文件的之间的执行顺序 <plugin> <gro
阅读全文
摘要:JDK版本: JDK8u192 bug: https://bugs.openjdk.org/browse/JDK-8206333 堆栈: "Common-Business-Thread-572" Id=1723 BLOCKED at java.security.Provider.getService
阅读全文
摘要:okHttp 发送表单请求 需要添加依赖 compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.0' import okhttp3.FormBody; import okhttp3.OkHttpClient; imp
阅读全文
摘要:1. Guava github google的开源本地缓存 堆内缓存 需要考虑GC问题 不用考虑序列化和反序列化问题 2. caffeine github Caffeine provides an in-memory cache using a Google Guava inspired API.
阅读全文
摘要:1. BlockingCache 2. FifoCache 3. LruCache 4. SoftCache 5. WeakCache 6. LoggingCache 7. ScheduledCache 8. SynchronizedCache 9. PerpetualCache 10. Seria
阅读全文