Skip to content

Commit 9f0443a

Browse files
author
Daan Hoogland
committed
cleanup
1 parent 7c39933 commit 9f0443a

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

api/src/main/java/com/cloud/user/User.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public enum Source {
3535

3636
public String getUuid();
3737

38-
public void setUuid(String uuid);
39-
4038
public Date getCreated();
4139

4240
public Date getRemoved();

engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,12 @@ public Pair<User, Account> findUserAccountByApiKey(String apiKey) {
138138
PreparedStatement pstmt = null;
139139
Pair<User, Account> userAcctPair = null;
140140
try {
141-
String sql = FIND_USER_ACCOUNT_BY_API_KEY;
142-
pstmt = txn.prepareAutoCloseStatement(sql);
141+
pstmt = txn.prepareAutoCloseStatement(FIND_USER_ACCOUNT_BY_API_KEY);
143142
pstmt.setString(1, apiKey);
144143
ResultSet rs = pstmt.executeQuery();
145144
// TODO: make sure we don't have more than 1 result? ApiKey had better be unique
146145
if (rs.next()) {
147-
User u = new UserVO(rs.getLong(1));
146+
UserVO u = new UserVO(rs.getLong(1));
148147
u.setUuid(rs.getString(2));
149148
u.setUsername(rs.getString(3));
150149
u.setAccountId(rs.getLong(4));
@@ -170,10 +169,10 @@ public Pair<User, Account> findUserAccountByApiKey(String apiKey) {
170169
a.setApiKeyAccess(apiKeyAccess);
171170
}
172171

173-
userAcctPair = new Pair<User, Account>(u, a);
172+
userAcctPair = new Pair<>(u, a);
174173
}
175174
} catch (Exception e) {
176-
logger.warn("Exception finding user/acct by api key: " + apiKey, e);
175+
logger.warn("Exception finding user/acct by api key: {}", apiKey, e);
177176
}
178177
return userAcctPair;
179178
}
@@ -342,11 +341,9 @@ public long getDomainIdForGivenAccountId(long id) {
342341
domain_id = account_vo.getDomainId();
343342
}
344343
catch (Exception e) {
345-
logger.warn("getDomainIdForGivenAccountId: Exception :" + e.getMessage());
346-
}
347-
finally {
348-
return domain_id;
344+
logger.warn("Can not get DomainId for the given AccountId; exception message : {}", e.getMessage());
349345
}
346+
return domain_id;
350347
}
351348

352349
@Override

0 commit comments

Comments
 (0)