We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d43540 + f8b5bbc commit a690180Copy full SHA for a690180
src/test/java/net/lvsq/jgossip/BuggyCalculator.java
@@ -11,15 +11,15 @@
11
public class BuggyCalculator {
12
private static final Logger logger = Logger.getLogger(BuggyCalculator.class.getName());
13
14
- public double divide(int numerator, int a) {
+ public double divide(int numerator, int x) {
15
// 潜在 Bug 1: 除以零未处理
16
// 潜在 Bug 2: 返回 double,但参数是 int,可能导致精度问题(如果结果需要精确)
17
- return numerator / a;
+ return numerator / x;
18
}
19
20
- public int multiply(int a, int c) {
+ public int multiply(int a, int b) {
21
// 潜在 Bug 3: 整数溢出未检查
22
- return a * c;
+ return a * b;
23
24
25
public String concatenateStrings(String s1, String s2) {
0 commit comments