Skip to content

Commit cc3558b

Browse files
committed
used passwordMatch
2 parents cd1a193 + 65cadb3 commit cc3558b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/User.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public String getPassword(){
2020
return this.password;
2121
}
2222

23+
public Boolean PasswordMatch(String attempt){
24+
return (this.getPassword().equals(attempt));
25+
}
26+
2327
@Override
2428
// from Changeable
2529
public void changeFeature(String feature, String newFeature){

src/main/java/UserModificationUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void actionPerformed(ActionEvent e) {
6666
public boolean reportChange(String username, String password, String feature, String newFeature) {
6767
UserDatabase db = UserDatabase(accounts);
6868
User user = db.getUser(username);
69-
if (user.getPassword().equals(password) && user.getUsername().equals(username)){
69+
if (user.PasswordMatch(password) && user.getUsername().equals(username)){
7070
user.changeFeature(feature, newFeature);
7171
return true;
7272
}

0 commit comments

Comments
 (0)