You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
caikang.ck c9c6130f9c eclipse-plugin v2.0.1 5 years ago
.github/ISSUE_TEMPLATE Update issue templates 5 years ago
eclipse-plugin eclipse-plugin v2.0.1 5 years ago
idea-plugin v2.0.0 6 years ago
p3c-formatter 方法参数的注释换行,与IDEA行为保持一致 6 years ago
p3c-gitbook correct method name 6 years ago
p3c-pmd comment gpg plugin 5 years ago
.gitignore Source code 7 years ago
README.md Update README.md 6 years ago
license.txt Source code 7 years ago
阿里巴巴Java开发手册(华山版).pdf Update guidelines pdf 6 years ago

README.md

2018年9月22日在2018杭州云栖大会上召开《码出高效Java 开发手册》新书发布会并宣布将图书所有收益均捐赠于技术公益项目“83行代码计划”。

阿里巴巴正式在2018杭州云栖大会《开发者生态峰会》上由阿里巴巴高年级同学中间件负责人林昊、阿里巴巴研究员刘湘雯、阿里巴巴研究员刘国华OpenJDK社区Committer杨晓峰全栈视障工程师蔡勇斌电子工业出版社博文视点出版公司总经理郭立以及两位图书作者杨冠宝孤尽和高海慧鸣莎重磅大咖联合发布新书《码出高效Java开发手册》跳转至天猫书店并宣布将图书所有收益均捐赠于技术公益项目“83行代码计划”第一个“83行代码计划”行动将围绕着帮助盲人工程师开发更多无障碍化产品让盲人上网更便捷。未来我们会坚持用技术为公益行业赋能也希望更多人成为技术受益者<

2017年10月14日杭州云栖大会Java代码规约扫描插件全球首发仪式正式启动规范正式以插件形式公开走向业界引领Java语言的规范之路。目前插件已在云效公有云产品中集成,立即体验!(云效>公有云>设置->测试服务->阿里巴巴Java代码规约

P3C

License

Preface

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:

Introduction

The project consists of 3 parts:

Rules

Forty-nine rules are realized based on PMD, please refer the P3C-PMD documentation for more detailed information. Four rules are implemented within IDE plugins (IDEA and Eclipse) as follows:

  • [Mandatory] Using a deprecated class or method is prohibited.
    Note: For example, decode(String source, String encode) should be used instead of the deprecated method decode(String encodeStr). Once an interface has been deprecated, the interface provider has the obligation to provide a new one. At the same time, client programmers have the obligation to check out what its new implementation is.

  • [Mandatory] An overridden method from an interface or abstract class must be marked with @Override annotation. Counter example: For getObject() and get0bject(), the first one has a letter 'O', and the second one has a number '0'. To accurately determine whether the overriding is successful, an @Override annotation is necessary. Meanwhile, once the method signature in the abstract class is changed, the implementation class will report a compile-time error immediately.

  • [Mandatory] A static field or method should be directly referred by its class name instead of its corresponding object name.

  • [Mandatory] The usage of hashCode and equals should follow:

    1. Override hashCode if equals is overridden.
    2. These two methods must be overridden for Set since they are used to ensure that no duplicate object will be inserted in Set.
    3. These two methods must be overridden if self-defined object is used as the key of Map. 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 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 below: