unicode换行符
发表于|更新于
|浏览量:
良好的教养在于隐藏我们对自己较佳的评价,以及隐藏我们对他人较差的评价——马克吐温
挺有趣的:
1 | String words = "哈哈"; |

以下语句输出

因为\u000d换行符被解析了
相关推荐
2022-06-24
opencc4j
“不用给我爱,不用给我钱,不用给我声誉,给我真理吧。我们应该有勇气去面对真实的内心,即使前面荆棘满地,也要坚定地走下去。为了不浪费你的这一辈子。”——梭罗《瓦尔登湖》 分享一个java简繁转换的库opencc4j https://github.com/houbb/opencc4j Group ArtifactId Version 12345<dependency> <groupId>com.github.houbb</groupId> <artifactId>opencc4j</artifactId> <version>1.7.2</version></dependency> 使用起来: 繁简体转换转为简体123String original = "生命不息,奮鬥不止";String result = ZhConverterUtil.toSimple(original);Assert.assertEquals("生命不息,奋斗不止...
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...
2022-04-21
在SpringBoot单元测试中添加参数
我的肩上是风,风上是闪烁的星群。——北岛《结局或开始·献给遇罗克》 当时是解决一个issue而去查阅的 https://github.com/baomidou/mybatis-plus/issues/4417 最后代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566package com.ruben.mybatisplusissue;import javax.annotation.Resource;import org.junit.jupiter.api.Test;import org.junit.jupiter.api.extension.ExtendWith;import org.springframework.boot.SpringApplication;import org.springframework.boot.test.context.SpringBootCo...
2021-02-24
gson坑
一直只做自己会做的,就什么也做不成。最重要的是,你自己有没有兴趣——《碧蓝之海》 前两天使用Gson中遇到一个坑 同事使用 1Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); 创建gson对象 所以到我这,出现了字段不序列化,或者反序列化不了的问题 例如下面这个类 1234567891011@Datapublic static class User implements Serializable { private static final long serialVersionUID = 509877226276918727L; @Expose private String firstName; @Expose(serialize = false) private String lastName; @Expose(serialize = false, deserialize = false) private Stri...
2023-11-03
open-feign自定义反序列化decoder
人受谏,则圣。木受绳,则直。金就砺,则利。——孔子 主要是解决map类型擦除的问题,GlobalResponse继承了Map 代码如下: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465import cn.hutool.core.util.TypeUtil;import com.fasterxml.jackson.core.type.TypeReference;import com.fasterxml.jackson.databind.JsonNode;import feign.RequestTemplate;import feign.Response;import feign.Util;import feign.codec.DecodeException;import feign.codec.Decoder;import feign.codec.EncodeException;imp...
2024-04-04
修改mybatis-plus更新策略
把完善的教育留给子女,乃是最佳的遗产。——斯各特 就像: https://github.com/apache/incubator-streampark/pull/3615 首先修改dbConfig.setUpdateStrategy(FieldStrategy.IGNORED); 1234567891011121314151617181920212223/** * mybatis plus setting * * @return MybatisPlusPropertiesCustomizer */@Beanpublic MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() { return properties -> { properties.setTypeAliasesPackage("org.apache.streampark.console.*.entity"); properties.setTypeEnumsPackage(&quo...

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