httpcore 包
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${httpcore.version}</version>
</dependency>
4.4.4 版本里有个Immutable 注解
@Documented
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Immutable {
}
4.4.13 版本里已经没有这个注解了
用@Contract(threading = ThreadingBehavior.SAFE) 替代
@Documented
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Contract {
ThreadingBehavior threading() default ThreadingBehavior.UNSAFE;
}
public enum ThreadingBehavior {
IMMUTABLE,
IMMUTABLE_CONDITIONAL,
SAFE,
SAFE_CONDITIONAL,
UNSAFE;
private ThreadingBehavior() {
}
}
原创文章,欢迎转载,转载请注明出处!