Retour au classement

Alibaba Java Coding Guidelines pmd implements and IDE plugin

Croissance des étoiles
Étoiles
30.8k
Forks
8k
Croissance hebdomadaire
Issues
161
10k20k30k
sept. 2017août 2020août 2023juil. 2026
README

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.
Dépôts similaires
topjohnwu/Magisk

The Magic Mask for Android

KotlinGNU General Public License v3.0
61.8k18k
2dust/v2rayNG

A V2Ray client for Android, support Xray core and v2fly core

KotlinGNU General Public License v3.0androidproxy
v2rayng.2dust.link
59.9k7.8k
JetBrains/kotlin

The Kotlin Programming Language.

Kotlinkotlinprogramming-language
kotlinlang.org
53.2k6.4k
bannedbook/fanqiang

翻墙-科学上网

Kotlinssrv2ray
49.2k8.2k
lysine-dev/okhttp

A meticulous HTTP client for the JVM, Android, and GraalVM.

KotlinApache License 2.0javaandroid
lysine.dev/okhttp/
47k9.3k
gedoor/legado

Legado 3.0 Book Reader with powerful controls & full functions❤️阅读3.0, 阅读是一款可以自定义来源阅读网络内容的工具,为广大网络文学爱好者提供一种方便、快捷舒适的试读体验。

Kotlin
46.9k5.5k
square/okhttp

Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

KotlinApache License 2.0javaandroid
square.github.io/okhttp/
46.2k9.2k
android/architecture-samples

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.

KotlinApache License 2.0android-architectureandroid
45.8k11.9k
gkd-kit/gkd

基于无障碍,高级选择器,订阅规则的自定义屏幕点击安卓应用 | An Android APP with custom screen tapping based on Accessibility, Advanced Selectors, and Subscription Rules

KotlinGNU General Public License v3.0androidkotlin
gkd.li
40.3k1.9k
shadowsocks/shadowsocks-android

A shadowsocks client for Android

KotlinOthershadowsocksandroid
36.7k11.5k
square/leakcanary

A memory leak detection library for Android.

KotlinApache License 2.0androidmemory-leak
square.github.io/leakcanary
29.9k4k
librepods-org/librepods

AirPods liberated from Apple's ecosystem.

KotlinGNU General Public License v3.0airpodslinux
29.1k1.6k