lombok.javac.apt.LombokProcessor could not be initialized解决办法
1月 31, 2023 |
Nix.Huang
最近将IDEA 升级到IntelliJ IDEA 2022.3.1后原来可以运行的工程启动报: java: l […more]
最近将IDEA 升级到IntelliJ IDEA 2022.3.1后原来可以运行的工程启动报: java: l […more]
changelog文件
1 2 3 4 5 6 7 8 |
--changeset javacoder:5 dbms:mysql --preconditions onFail:MARK_RAN onError:HALT --precondition-sql-check expectedResult:1 select count(1) from information_schema.COLUMNS where table_name='user' and column_name='email' and table_schema='${schema}' --comment: 删除user.email 字段 ALTER TABLE user DROP COLUMN `email`; |
使用 ${schem […more]
LockSupport简介 java并发包中很多类都基于LockSupport实现锁,而Thread.susp […more]
java代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost post = new HttpPost(url); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setBoundary("123456789"); builder.setCharset(java.nio.charset.Charset.forName("UTF-8")); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); // 文件流 builder.addBinaryBody("file", getInputStream(), ContentType.DEFAULT_BINARY, "xyz.txt"); builder.addPart("type", new StringBody("0", ContentType.TEXT_PLAIN)); //Finally post.setEntity(builder.build()); CloseableHttpResponse response = httpClient.execute(post); response.getEntity().writeTo(System.out); |
生成的报文 POST /ebo […more]
em相对于父级元素的排版大小,(typography,指定了font-size就以父元素的font-size为 […more]
使用axios发送Ajax理由 使用XMLHttpRequest 发送Ajax请求已经很简单,为啥很多工程使用 […more]
code=1009, reason=The decoded text message was too big […more]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
public static <T, U> BiConsumer<T, U> getSetter(Class<T> clazz, String fieldName, Class<U> fieldType) throws Throwable { MethodHandles.Lookup caller = MethodHandles.lookup(); MethodType setter = MethodType.methodType(void.class, fieldType); MethodHandle target = caller.findVirtual(clazz, computeSetterName(fieldName), setter); CallSite site = LambdaMetafactory.metafactory( caller, "accept", //interfaceMethodName MethodType.methodType(BiConsumer.class), //factoryType //interfaceMethodType,泛型一律使用Object.class MethodType.methodType(void.class, Object.class, Object.class), target, //implementation target.type() //dynamicMethodType, 泛型对应的具体类型 ); MethodHandle factory = site.getTarget(); return (BiConsumer<T, U>) factory.invokeExact(); } public static String computeSetterName(String fieldName) { return "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); } |
当获取的函数对象是泛型时,那么interfa […more]
CompletableFuture 介绍 自带线程池,拿来即用 可以手动完成 多个Future协同 常规使用 […more]