提交 73033b74 编写于 作者: J johnsonlee 提交者: zhiguoWang

Improves thread renaming and optimization

上级 2e4e9b4d
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
package com.didiglobal.booster.instrument;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinWorkerThread;
import static com.didiglobal.booster.instrument.ShadowThread.makeThreadName;
/**
* @author johnsonlee
*/
public class NamedForkJoinWorkerThreadFactory implements ForkJoinPool.ForkJoinWorkerThreadFactory {
private final String name;
private final ForkJoinPool.ForkJoinWorkerThreadFactory factory;
public NamedForkJoinWorkerThreadFactory(final ForkJoinPool.ForkJoinWorkerThreadFactory factory, final String name) {
this.factory = factory;
this.name = name;
}
public NamedForkJoinWorkerThreadFactory(final String name) {
this(null, name);
}
@Override
public ForkJoinWorkerThread newThread(final ForkJoinPool pool) {
final ForkJoinWorkerThread thread = (null != this.factory)
? factory.newThread(pool)
: new ForkJoinWorkerThread(pool) {};
thread.setName(makeThreadName(thread.getName(), this.name));
return thread;
}
}
......@@ -5,7 +5,28 @@ import java.util.concurrent.atomic.AtomicInteger;
import static com.didiglobal.booster.instrument.ShadowThread.setThreadName;
class NamedThreadFactory implements ThreadFactory {
public class NamedThreadFactory implements ThreadFactory {
/**
* Used by {@code ThreadTransformer} for thread renaming
*
* @param prefix the prefix of name
* @return an instance of ThreadFactory
*/
public static ThreadFactory newInstance(final String prefix) {
return new NamedThreadFactory(prefix);
}
/**
* Used by {@code ThreadTransformer} for thread renaming
*
* @param factory the factory delegate
* @param prefix the prefix of name
* @return an instance of ThreadFactory
*/
public static ThreadFactory newInstance(final ThreadFactory factory, final String prefix) {
return new NamedThreadFactory(factory, prefix);
}
private final String name;
private final AtomicInteger counter = new AtomicInteger(1);
......
......@@ -7,6 +7,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
......@@ -107,6 +108,30 @@ public class ShadowExecutors {
// </editor-fold>
// <editor-fold desc="- named work stealing pool">
public static ExecutorService newWorkStealingPool(final String name) {
return new ForkJoinPool(Runtime.getRuntime().availableProcessors(), new NamedForkJoinWorkerThreadFactory(name), null, true);
}
public static ExecutorService newWorkStealingPool(final int parallelism, final String name) {
return new ForkJoinPool(parallelism, new NamedForkJoinWorkerThreadFactory(name), null, true);
}
// </editor-fold>
// <editor-fold desc="- optimized fixed thread pool">
public static ExecutorService newOptimizedFixedThreadPool(final int nThreads, final String name) {
return Executors.newFixedThreadPool(nThreads, new NamedThreadFactory(name));
}
public static ExecutorService newOptimizedFixedThreadPool(final int nThreads, final ThreadFactory factory, final String name) {
return Executors.newFixedThreadPool(nThreads, new NamedThreadFactory(factory, name));
}
// </editor-fold>
// <editor-fold desc="* optimized single thread scheduled executor">
public static ScheduledExecutorService newOptimizedSingleThreadScheduledExecutor(final String name) {
......@@ -175,6 +200,18 @@ public class ShadowExecutors {
//</editor-fold>
// <editor-fold desc="* optimized work stealing pool">
public static ExecutorService newOptimizedWorkStealingPool(final String name) {
return new ForkJoinPool(Runtime.getRuntime().availableProcessors(), new NamedForkJoinWorkerThreadFactory(name), null, true);
}
public static ExecutorService newOptimizedWorkStealingPool(final int parallelism, final String name) {
return new ForkJoinPool(parallelism, new NamedForkJoinWorkerThreadFactory(name), null, true);
}
// </editor-fold>
private static class DelegatedExecutorService extends AbstractExecutorService {
private final ExecutorService executor;
......
......@@ -5,7 +5,10 @@ import android.os.HandlerThread;
import static com.didiglobal.booster.instrument.ShadowThread.makeThreadName;
import static java.lang.Math.min;
public class ShadowHandlerThread {
/**
* @author johnsonlee
*/
public class ShadowHandlerThread extends HandlerThread {
public static HandlerThread newHandlerThread(final String name, final String prefix) {
return new HandlerThread(makeThreadName(name, prefix));
......@@ -15,4 +18,25 @@ public class ShadowHandlerThread {
return new HandlerThread(makeThreadName(name, prefix), min(android.os.Process.THREAD_PRIORITY_DEFAULT, priority));
}
/**
* Initialize {@code HandlerThread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowHandlerThread(final String name, final String prefix) {
super(makeThreadName(name, prefix));
}
/**
* Initialize {@code HandlerThread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param name the original name
* @param priority the thread priority
* @param prefix the prefix of new name
*/
public ShadowHandlerThread(final String name, final int priority, final String prefix) {
super(makeThreadName(name, prefix), priority);
}
}
package com.didiglobal.booster.instrument;
public class ShadowThread {
/**
* @author johnsonlee
*/
public class ShadowThread extends Thread {
/**
* {@code U+200B}: Zero-Width Space
......@@ -52,4 +55,96 @@ public class ShadowThread {
return name == null ? prefix : (name.startsWith(MARK) ? name : (prefix + "#" + name));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param prefix the new name
*/
public ShadowThread(final String prefix) {
super(makeThreadName(prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param target the object whose {@code run} method is invoked when this thread is started.
* If {@code null}, this thread's run method is invoked.
* @param prefix the new name
*/
public ShadowThread(final Runnable target, final String prefix) {
super(target, makeThreadName(prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param group the thread group
* @param target the object whose {@code run} method is invoked when this thread is started.
* If {@code null}, this thread's run method is invoked.
* @param prefix the new name
*/
public ShadowThread(final ThreadGroup group, final Runnable target, final String prefix) {
super(group, target, makeThreadName(prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowThread(final String name, final String prefix) {
super(makeThreadName(name, prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param group the thread group
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowThread(final ThreadGroup group, final String name, final String prefix) {
super(group, makeThreadName(name, prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param target the object whose {@code run} method is invoked when this thread is started.
* If {@code null}, this thread's run method is invoked.
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowThread(final Runnable target, final String name, final String prefix) {
super(target, makeThreadName(name, prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param group the thread group
* @param target the object whose {@code run} method is invoked when this thread is started.
* If {@code null}, this thread's run method is invoked.
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowThread(final ThreadGroup group, final Runnable target, final String name, final String prefix) {
super(group, target, makeThreadName(name, prefix));
}
/**
* Initialize {@code Thread} with new name, this constructor is used by {@code ThreadTransformer} for renaming
*
* @param group the thread group
* @param target the object whose {@code run} method is invoked when this thread is started.
* If {@code null}, this thread's run method is invoked.
* @param name the original name
* @param stackSize the desired stack size for the new thread, or zero to indicate that this parameter is to be ignored.
* @param prefix the prefix of new name
*/
public ShadowThread(final ThreadGroup group, final Runnable target, final String name, final long stackSize, final String prefix) {
super(group, target, makeThreadName(name, prefix), stackSize);
}
}
......@@ -6,7 +6,10 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class ShadowThreadPoolExecutor {
/**
* @author johnsonlee
*/
public class ShadowThreadPoolExecutor extends ThreadPoolExecutor {
// <editor-fold desc="- named thread pool executor">
......@@ -84,4 +87,272 @@ public class ShadowThreadPoolExecutor {
// </editor-fold>
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param prefix the prefix of new thread
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final String prefix
) {
this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, prefix, false);
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param prefix the prefix of new thread
* @param optimize the value indicates that the thread pool optimization should be applied
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final String prefix,
final boolean optimize
) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, new NamedThreadFactory(prefix));
if (optimize) {
allowCoreThreadTimeOut(getKeepAliveTime(unit) > 0);
}
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param threadFactory the factory to use when the executor creates a new thread
* @param prefix the prefix of new thread
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final ThreadFactory threadFactory,
final String prefix
) {
this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, prefix, false);
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param threadFactory the factory to use when the executor creates a new thread
* @param prefix the prefix of new thread
* @param optimize the value indicates that the thread pool optimization should be applied
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final ThreadFactory threadFactory,
final String prefix,
final boolean optimize
) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, new NamedThreadFactory(threadFactory, prefix));
if (optimize) {
allowCoreThreadTimeOut(getKeepAliveTime(unit) > 0);
}
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param handler the handler to use when execution is blocked because the thread bounds and queue capacities are reached
* @param prefix the prefix of new thread
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final RejectedExecutionHandler handler,
final String prefix
) {
this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler, prefix, false);
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param handler the handler to use when execution is blocked because the thread bounds and queue capacities are reached
* @param prefix the prefix of new thread
* @param optimize the value indicates that the thread pool optimization should be applied
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final RejectedExecutionHandler handler,
final String prefix,
final boolean optimize
) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, new NamedThreadFactory(prefix), handler);
if (optimize) {
allowCoreThreadTimeOut(getKeepAliveTime(unit) > 0);
}
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param threadFactory the factory to use when the executor creates a new thread
* @param handler the handler to use when execution is blocked because the thread bounds and queue capacities are reached
* @param prefix the prefix of new thread
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final ThreadFactory threadFactory,
final RejectedExecutionHandler handler,
final String prefix
) {
this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler, prefix, false);
}
/**
* Initialize {@code ThreadPoolExecutor} with new thread name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param corePoolSize the number of threads to keep in the pool, even if they are idle,
* unless {@code allowCoreThreadTimeOut} is set
* @param maximumPoolSize the maximum number of threads to allow in the pool
* @param keepAliveTime when the number of threads is greater than the core,
* this is the maximum time that excess idle threads will wait for new tasks before terminating.
* @param unit the time unit for the {@code keepAliveTime} argument
* @param workQueue the queue to use for holding tasks before they are executed.
* This queue will hold only the {@code Runnable} tasks submitted by the {@code execute} method.
* @param threadFactory the factory to use when the executor creates a new thread
* @param handler the handler to use when execution is blocked because the thread bounds and queue capacities are reached
* @param prefix the prefix of new thread
* @param optimize the value indicates that the thread pool optimization should be applied
* @throws IllegalArgumentException if one of the following holds:<br>
* {@code corePoolSize < 0}<br>
* {@code keepAliveTime < 0}<br>
* {@code maximumPoolSize <= 0}<br>
* {@code maximumPoolSize < corePoolSize}
*/
public ShadowThreadPoolExecutor(
final int corePoolSize,
final int maximumPoolSize,
final long keepAliveTime,
final TimeUnit unit,
final BlockingQueue<Runnable> workQueue,
final ThreadFactory threadFactory,
final RejectedExecutionHandler handler,
final String prefix,
final boolean optimize
) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, new NamedThreadFactory(threadFactory, prefix), handler);
if (optimize) {
allowCoreThreadTimeOut(getKeepAliveTime(unit) > 0);
}
}
}
......@@ -4,7 +4,10 @@ import java.util.Timer;
import static com.didiglobal.booster.instrument.ShadowThread.makeThreadName;
public class ShadowTimer {
/**
* @author johnsonlee
*/
public class ShadowTimer extends Timer {
public static Timer newTimer(final String name) {
return new Timer(name);
......@@ -22,4 +25,44 @@ public class ShadowTimer {
return new Timer(makeThreadName(name, prefix), isDaemon);
}
/**
* Initialize {@code Timer} with new name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param prefix the prefix of new name
*/
public ShadowTimer(final String prefix) {
super(prefix);
}
/**
* Initialize {@code Timer} with new name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param isDaemon true if the associated thread should run as a daemon
* @param prefix the prefix of new name
*/
public ShadowTimer(final boolean isDaemon, final String prefix) {
super(prefix, isDaemon);
}
/**
* Initialize {@code Timer} with new name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param name the original name
* @param prefix the prefix of new name
*/
public ShadowTimer(final String name, final String prefix) {
super(makeThreadName(name, prefix));
}
/**
* Initialize {@code Timer} with new name, this constructor is used by {@code ThreadTransformer} for thread renaming
*
* @param name the original name
* @param isDaemon true if the associated thread should run as a daemon
* @param prefix the prefix of new name
*/
public ShadowTimer(final String name, final boolean isDaemon, final String prefix) {
super(makeThreadName(name, prefix), isDaemon);
}
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compileOnly project(':booster-android-api')
......
package com.didiglobal.booster.transform
class TransformException : Exception {
constructor() : super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable) : super(message, cause)
constructor(cause: Throwable) : super(cause)
constructor(message: String, cause: Throwable, enableSuppression: Boolean, writableStackTrace: Boolean)
: super(message, cause, enableSuppression, writableStackTrace)
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ allprojects { project ->
apply plugin: 'de.marcphilipp.nexus-publish'
group = 'com.didiglobal.booster'
version = '2.2.0'
version = '2.3.0-SNAPSHOT'
repositories {
mavenLocal()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册