GitXplorerGitXplorer
a

p3c

public
30380 stars
8064 forks
184 issues

Commits

List of commits on branch master.
Verified
6c59c8c36ecd8722c712d5685b8c3822c1c8b030

upload Java开发手册(黄山版).pdf

ddyrone committed 2 years ago
Verified
22ab84e96337b6bd72fb89fad7d0aa1fa0d7bd00

Update README.md

ttibetty committed 3 years ago
Verified
2dc8faff96dd73d02ccec8ad221a4012974d1d31

Update README.md

ggujin520 committed 3 years ago
Verified
2e61c02ee1e3c8f57d401c91cece60f6e5294fdd

Update README.md

ggujin520 committed 3 years ago
Verified
8ea71e336e6797fb8d2fd891d1ff5ac3e8149bc5

Add files via upload

ggujin520 committed 3 years ago
Verified
da05a24c0c08646d57ab41166dd837858d82ec8a

Delete 13.Java开发手册(黄山版).pdf

ggujin520 committed 3 years ago

README

The README file for this repository.

P3C

最新版本:黄山版(2022.2.3发布)

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.