Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
ge-mange
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
joel.cavat
ge-mange
Commits
bd66ebd7
Commit
bd66ebd7
authored
6 years ago
by
michael.ramusi
Browse files
Options
Downloads
Patches
Plain Diff
fixed omission of get() call to optional
parent
023fb142
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/src/main/java/ch/hepia/account/AccountDatabase.java
+3
-2
3 additions, 2 deletions
services/src/main/java/ch/hepia/account/AccountDatabase.java
with
3 additions
and
2 deletions
services/src/main/java/ch/hepia/account/AccountDatabase.java
+
3
−
2
View file @
bd66ebd7
...
...
@@ -29,7 +29,7 @@ public class AccountDatabase {
}
public
void
creditAnAccount
(
int
idAccount
,
double
amount
){
this
.
database
.
get
(
this
.
database
.
indexOf
(
getById
(
idAccount
))).
addAmount
(
amount
);
this
.
database
.
get
(
this
.
database
.
indexOf
(
getById
(
idAccount
)
.
get
()
)).
addAmount
(
amount
);
}
public
boolean
hasEnoughMoney
(
int
idAccount
,
double
price
){
...
...
@@ -37,6 +37,7 @@ public class AccountDatabase {
}
public
void
withdrawCreditAccount
(
int
idAccount
,
double
credit
){
this
.
database
.
get
(
this
.
database
.
indexOf
(
getById
(
idAccount
))).
withdraw
(
credit
);
System
.
out
.
println
(
"ID:"
+
idAccount
);
this
.
database
.
get
(
this
.
database
.
indexOf
(
getById
(
idAccount
).
get
())).
withdraw
(
credit
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment