提交 1cc0a0c2 编写于 作者: 骏烈

Merge remote-tracking branch 'upstream/master'

......@@ -10,7 +10,7 @@
> We are pleased to present Alibaba Java Coding Guidelines which consolidates the best programming practices over the years from Alibaba Group's technical teams. A vast number of Java programming teams impose demanding requirements on code quality across projects as we encourage reuse and better understanding of each other's programs. We have seen many programming problems in the past. For example, defective database table structures and index designs may cause software architecture flaws and performance risks. Another example is confusing code structures being difficult to maintain. Furthermore, vulnerable code without authentication is prone to hackers’ attacks. To address these kinds of problems, we developed this document for Java developers at Alibaba.
For more information please refer the *Alibaba Java Coding Guidelines*:
- 中文版: *[阿里巴巴Java开发手册](https://github.com/alibaba/p3c/blob/master/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4Java%E5%BC%80%E5%8F%91%E6%89%8B%E5%86%8C%EF%BC%88%E7%BA%AA%E5%BF%B5%E7%89%88%EF%BC%89.pdf)*
- 中文版: *[阿里巴巴Java开发手册](https://github.com/alibaba/p3c/blob/master/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4Java%E5%BC%80%E5%8F%91%E6%89%8B%E5%86%8C%EF%BC%88%E8%AF%A6%E5%B0%BD%E7%89%88%EF%BC%89.pdf)*
- English Version: *[Alibaba Java Coding Guidelines](https://alibaba.github.io/Alibaba-Java-Coding-Guidelines)*
- 手册书籍版天猫官方店: *[阿里巴巴JAVA开发手册最新版](https://detail.tmall.com/item.htm?spm=a1z2e.8325951.feedDetail.4.3315431gklIXe&id=562626792765&ns=1&abbucket=14)*
......@@ -38,8 +38,8 @@ The project consists of 3 parts:
Note: String can be used as the key of Map since these two methods have been rewritten.
## Join us
If you have any questions or some advice, please contact with junlie whose email is caikang.ck@alibaba-inc.com, and please join us to make project P3C perfect for more programmers.
If you have any questions or comments, please contact junlie by email at caikang.ck@alibaba-inc.com, and please join us to make project P3C perfect for more programmers.
Please follow our weChat official account as ali_yunxiao blow:
Please follow our WeChat official account as ali_yunxiao below:
![](https://gw.alicdn.com/tfscom/TB1TrNcXjv85uJjSZFNXXcJApXa.png)
##(二) 日志规约
## (二) 日志规约
1. 【强制】应用中不可直接使用日志系统(Log4j、Logback)中的API,而应依赖使用日志框架SLF4J中的API,使用门面模式的日志框架,有利于维护和各个类的日志处理方式统一。
<pre>
import org.slf4j.Logger;
......
##(六) 并发处理
## (六) 并发处理
1. 【强制】获取单例对象需要保证线程安全,其中的方法也要保证线程安全。
<br><span style="color:orange">说明</span>:资源驱动类、工具类、单例工厂类都需要注意。
2. 【强制】创建线程或线程池时请指定有意义的线程名称,方便出错时回溯。
......
......@@ -59,6 +59,10 @@ public class PojoMustOverrideToStringRule extends AbstractPojoRule {
@Override
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) {
if (node.isInterface()) {
return super.visit(node, data);
}
if (!isPojo(node)) {
return super.visit(node, data);
}
......
......@@ -132,4 +132,19 @@
<expected-problems>0</expected-problems>
<code-ref id="lombok-pojo-4" />
</test-code>
<!-- ====================================================================== -->
<code-fragment id="interface-with-pojo-surfix">
<![CDATA[
public interface FooDO {
}
]]>
</code-fragment>
<test-code>
<description>interface with POJO surfix</description>
<expected-problems>0</expected-problems>
<code-ref id="interface-with-pojo-surfix" />
</test-code>
</test-data>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册