目录前言Static non-final field names should comply with a naming conventionJump statements shou
从年初开始,我司便开始将思码逸作为了 OKR 必选项,从开始的抵触,到现在的坦然,也算是被锤之路...
简单附上对应问题解决的思路或者方式,以便于小伙伴类似直接操作。
个人对于思码逸的看法,其实多属于还是基于阿里一些规范,虽说有点繁琐,甚至有些许难受,长远来看,未尝不是一件好事儿。
点滴做起,基于思码逸,一起来改善自己代码吧~
先附上阿里编码指南:
p3c
提示如下:
大概的意思就是静态非 final 命名不规范,这里直接追加 final 即可。
问题代码如下:
提示如下:
Jump statements such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.
Fix:
问题代码如下:
提示如下:
Fix:
问题代码如下:
提示如下:
附上对应代码图:
当然以下是一些例外情况:
@javax.enterprise.event.Observes
default
methodsthrow
or that have empty bodies@SuppressWarning("unchecked")
or @SuppressWarning("rawtypes")
, in which case the annotation will be ignored问题代码如下:
提示如下:
如何 Fix?
只需要将原本的 == 替换为 Float.compare(a,b) == 0 即可。
Others 知识点回顾:
回顾基本数据类型和包装类型:
基本类型 | 包装类型 |
---|---|
boolean | Boolean |
char | Character |
int | Integer |
byte | Byte |
short | Short |
long | Long |
float | Float |
double | Double |
而它们之间区别如下:
这里额外回顾下 == 和 equals 区别吧:
以上就是Android Notes思码逸问题处理记录的详细内容,更多关于Android Notes思码逸问题处理的资料请关注编程网其它相关文章!
--结束END--
本文标题: Android Notes思码逸问题处理记录
本文链接: https://www.lsjlt.com/news/169047.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0