提交 f08d8209 编写于 作者: oldratlee's avatar oldratlee 🔥

code cleanup: improve format

上级 a82908b5
...@@ -39,7 +39,7 @@ import java.util.logging.Logger; ...@@ -39,7 +39,7 @@ import java.util.logging.Logger;
* <p> * <p>
* More discussion about "disable the <b>inheritable</b> ability" * More discussion about "disable the <b>inheritable</b> ability"
* see <a href="https://github.com/alibaba/transmittable-thread-local/issues/100"> * see <a href="https://github.com/alibaba/transmittable-thread-local/issues/100">
* issue #100: disable Inheritable when it's not necessary and buggy</a>. * issue #100: disable Inheritable when it's not necessary and buggy</a>.
* *
* @author Jerry Lee (oldratlee at gmail dot com) * @author Jerry Lee (oldratlee at gmail dot com)
* @author Yang Fang (snoop dot fy at gmail dot com) * @author Yang Fang (snoop dot fy at gmail dot com)
......
package com.alibaba.ttl.threadpool; package com.alibaba.ttl.threadpool;
import com.alibaba.ttl.TransmittableThreadLocal; import com.alibaba.ttl.TransmittableThreadLocal;
import com.alibaba.ttl.TtlRunnable;
import com.alibaba.ttl.TtlEnhanced; import com.alibaba.ttl.TtlEnhanced;
import com.alibaba.ttl.TtlRunnable;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
......
...@@ -48,9 +48,9 @@ public class TtlForkJoinTransformlet implements JavassistTransformlet { ...@@ -48,9 +48,9 @@ public class TtlForkJoinTransformlet implements JavassistTransformlet {
} }
private void updateForkJoinTaskClass(final CtClass clazz) throws CannotCompileException, NotFoundException { private void updateForkJoinTaskClass(final CtClass clazz) throws CannotCompileException, NotFoundException {
// add new field
final String className = clazz.getName(); final String className = clazz.getName();
// add new field
final String capturedFieldName = "captured$field$added$by$ttl"; final String capturedFieldName = "captured$field$added$by$ttl";
final CtField capturedField = CtField.make("private final Object " + capturedFieldName + ";", clazz); final CtField capturedField = CtField.make("private final Object " + capturedFieldName + ";", clazz);
clazz.addField(capturedField, "com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.Utils.doCaptureWhenNotTtlEnhanced(this);"); clazz.addField(capturedField, "com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.Utils.doCaptureWhenNotTtlEnhanced(this);");
......
package com.alibaba.ttl.threadpool.agent.internal.transformlet.impl; package com.alibaba.ttl.threadpool.agent.internal.transformlet.impl;
import com.alibaba.ttl.TtlEnhanced;
import com.alibaba.ttl.threadpool.agent.internal.logging.Logger; import com.alibaba.ttl.threadpool.agent.internal.logging.Logger;
import com.alibaba.ttl.threadpool.agent.internal.transformlet.JavassistTransformlet; import com.alibaba.ttl.threadpool.agent.internal.transformlet.JavassistTransformlet;
import javassist.*; import javassist.*;
...@@ -49,9 +48,9 @@ public class TtlTimerTaskTransformlet implements JavassistTransformlet { ...@@ -49,9 +48,9 @@ public class TtlTimerTaskTransformlet implements JavassistTransformlet {
} }
private void updateTimerTaskClass(final CtClass clazz) throws CannotCompileException, NotFoundException { private void updateTimerTaskClass(final CtClass clazz) throws CannotCompileException, NotFoundException {
// add new field
final String className = clazz.getName(); final String className = clazz.getName();
// add new field
final String capturedFieldName = "captured$field$added$by$ttl"; final String capturedFieldName = "captured$field$added$by$ttl";
final CtField capturedField = CtField.make("private final Object " + capturedFieldName + ";", clazz); final CtField capturedField = CtField.make("private final Object " + capturedFieldName + ";", clazz);
clazz.addField(capturedField, "com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.Utils.doCaptureWhenNotTtlEnhanced(this);"); clazz.addField(capturedField, "com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.Utils.doCaptureWhenNotTtlEnhanced(this);");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册