mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
18 lines
388 B
Java
18 lines
388 B
Java
// Inefficient version
|
|
class InefficientDBClient {
|
|
public void connect(String user, String pw) {
|
|
if (user.equals("") || "".equals(pw))
|
|
throw new RuntimeException();
|
|
...
|
|
}
|
|
}
|
|
|
|
// More efficient version
|
|
class EfficientDBClient {
|
|
public void connect(String user, String pw) {
|
|
if (user.length() == 0 || (pw != null && pw.length() == 0))
|
|
throw new RuntimeException();
|
|
...
|
|
}
|
|
}
|