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 cbfc191 + 23fd74c commit 39ce686Copy full SHA for 39ce686
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 denominator) {
+ public double divide(int numerator, int d) {
15
// 潜在 Bug 1: 除以零未处理
16
// 潜在 Bug 2: 返回 double,但参数是 int,可能导致精度问题(如果结果需要精确)
17
- return numerator / denominator;
+ return numerator / d;
18
}
19
20
- public int multiply(int a, int b) {
+ public int multiply(int a, int c) {
21
// 潜在 Bug 3: 整数溢出未检查
22
- return a * b;
+ return a * c;
23
24
25
public String concatenateStrings(String s1, String s2) {
0 commit comments