31DaysOfRefactoringInJava icon indicating copy to clipboard operation
31DaysOfRefactoringInJava copied to clipboard

Day 13 : Order class's calculate method is not pure

Open havanagrawal opened this issue 8 years ago • 1 comments

Calling calculate on a given Order should return the same value, regardless of how many times it is called.

The current implementation will return a new, increased value each time.

https://github.com/sunnypatel165/31DaysOfRefactoringInJava/blob/master/src/com/sunnypatel/daysofrefactoringjava/day13/extractmethodobjects/problem/Order.java#L20-L30

havanagrawal avatar Jun 11 '17 06:06 havanagrawal

What should be the case? Should I initialize all variables locally? - remember its a "bad" example.

sunnypatel165 avatar Jun 12 '17 02:06 sunnypatel165