统计目录下java代码行数
发表于|更新于
|浏览量:
画画用的是脑筋,而不是双手。——米开朗基罗
例如
1 | find /Users/achao/IdeaProjects/ -name "*.java" | xargs wc -l |
即可
相关推荐
2021-10-23
ThreadLocal子线程共享
世人缺乏的是毅力,而非气力。——雨果 昨天聊了ThreadLocal可以用作单个线程中变量共享 其底层实现其实就是个Map,用线程作为key,不信可以看这部分源码: 123456789101112131415161718192021/** * Returns the value in the current thread's copy of this * thread-local variable. If the variable has no value for the * current thread, it is first initialized to the value returned * by an invocation of the {@link #initialValue} method. * * @return the current thread's value of this thread-local */public T get() { Thread t = Thread.currentThr...
2023-12-13
boot项目添加运行参数的maven插件
不存在十全十美的文章,如同不存在彻头彻尾的绝望。——村上春树 之前说了 单元测试添加运行参数的maven插件 难道对于非单元测试就只能手动写命令了吗?当然不是!我们只需要使用: 123456789101112131415161718192021222324252627282930313233<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> <config...
2021-09-14
并行流线程数获取
我那时喜欢的是黄昏、荒郊和忧伤,而如今则向往清晨、市区和宁静。——博尔赫斯 这里用一个Set去接收并行流产生的线程id,对于上方的reduce函数我之前一篇博客已经讲过了,今天就来论证一下,到底并行流的线程数是否和JVM虚拟机可用的处理器数一致: 代码如下: 12345678910List<Integer> list = Stream.generate(() -> 1).limit(100).collect(Collectors.toList());System.out.println(list);int sum = list.parallelStream().reduce(1, Integer::sum, (a, b) -> { System.out.println(Thread.currentThread().getId() + " " + Thread.currentThread().getName() + " parallelStream执行sum时上次结果:[" + a + "...
2022-05-28
mvn一键换版本
一条路并不因为它路边长满荆棘而丧失其美丽,旅行者照旧向前进。——罗曼·罗兰 命令: 1mvn versions:set -DnewVersion=[版本号] 例如 1mvn versions:set -DnewVersion=0.0.1 即可
2021-06-08
isPrimitive
常制不可以待变化,一涂不可以应万方,刻船不以索遗剑。一一东晋·葛洪《抱朴子》 常制不可以待变化,一涂不可以应万方,刻船不以索遗剑。一一东晋·葛洪《抱朴子》 在Class中有这样一个函数isPrimitive 可以判断我们的class是否为基本类型 1234567891011121314151617181920212223242526package com.ruben;/** * @author <achao1441470436@gmail.com> * @since 2021/6/8 0008 22:00 */public class ClassDemo { public static void main(String[] args) { Class<Integer> integerClass = int.class; System.out.println("int.class是否为基本类型:" + integerClass.isPrimitive()); C...
2024-08-04
HuTool 6.0LambdaUtil
家庭是用孜孜不倦的爱情的劳动建立起来的。——陀思妥耶夫斯基 介绍LambdaUtil 是一个用于处理 Lambda 表达式的工具类,提供了解析、获取信息和构建 Lambda 方法的多种功能。 使用方法介绍Lambda 获取相关方法 getRealClass 获取 Lambda 实现类。 resolve 解析 Lambda 表达式,并缓存结果。 getMethodName 获取 Lambda 表达式的函数名称。 getFieldName 获取 Lambda 表达式 Getter 或 Setter 对应的字段名称。 buildGetter 构建 Getter 方法引用。 buildSetter 构建 Setter 方法引用。 build 构建指定方法的 Lambda 引用。 toFunction 将 BiFunction 转换为 Function。 toPredicate 将 BiPredicate 转换为 Predicate。 toConsumer 将 BiConsumer 转换为 Consumer。 getInvokeMethod ...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog