mirror of
https://github.com/alibaba/p3c.git
synced 2025-10-15 23:53:58 +00:00
@@ -204,7 +204,7 @@ Positive example:
|
||||
// please refer to the pseudo-code as follows
|
||||
boolean existed = (file.open(fileName, "w") != null) && (...) || (...);
|
||||
if (existed) {
|
||||
...
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -212,7 +212,7 @@ Positive example:
|
||||
|
||||
```java
|
||||
if ((file.open(fileName, "w") != null) && (...) || (...)) {
|
||||
...
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -41,6 +41,7 @@ public class NodeUtils {
|
||||
|
||||
/**
|
||||
* TODO optimize
|
||||
*
|
||||
* @param expression expression
|
||||
* @return true if wrapper type
|
||||
*/
|
||||
|
@@ -42,7 +42,7 @@
|
||||
<![CDATA[
|
||||
Positive example:
|
||||
String KEY_PRE = "Id#taobao_1";
|
||||
if(key.equals(KEY_PRE)){
|
||||
if (KEY_PRE.equals(key)) {
|
||||
//...
|
||||
}
|
||||
]]>
|
||||
|
@@ -49,7 +49,7 @@
|
||||
<![CDATA[
|
||||
Negative example:
|
||||
if ((file.open(fileName, "w") != null) && (...) || (...)) {
|
||||
...
|
||||
// ...
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
@@ -58,7 +58,7 @@ Negative example:
|
||||
Positive example:
|
||||
boolean existed = (file.open(fileName, "w") != null) && (...) || (...);
|
||||
if (existed) {
|
||||
...
|
||||
//...
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
Integer a = 235;
|
||||
Integer b = 235;
|
||||
if (a.equals(b)) {
|
||||
//相等
|
||||
// code
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<example>
|
||||
<![CDATA[
|
||||
反例:
|
||||
Negative example:
|
||||
String result;
|
||||
for (String string : tagNameList) {
|
||||
result = result + string;
|
||||
@@ -121,7 +121,7 @@
|
||||
</example>
|
||||
<example>
|
||||
<![CDATA[
|
||||
正例:
|
||||
Positive example:
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String string : tagNameList) {
|
||||
stringBuilder.append(string);
|
||||
|
@@ -104,7 +104,6 @@ Negative example:
|
||||
if (delCondition) {
|
||||
it.remove();
|
||||
}
|
||||
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
|
Reference in New Issue
Block a user