JAVA-13947 Potential issue in A Solid Guide to SOLID Principles article (#12654)
This commit is contained in:
parent
0bbab5326c
commit
1ce3754d16
|
@ -10,8 +10,8 @@ public class BadBook {
|
|||
|
||||
|
||||
//methods that directly relate to the book properties
|
||||
public String replaceWordInText(String word){
|
||||
return text.replaceAll(word, text);
|
||||
public String replaceWordInText(String word, String replacementWord){
|
||||
return text.replaceAll(word, replacementWord);
|
||||
}
|
||||
|
||||
public boolean isWordInText(String word){
|
||||
|
|
|
@ -9,8 +9,8 @@ public class GoodBook {
|
|||
//constructor, getters and setters
|
||||
|
||||
//methods that directly relate to the book properties
|
||||
public String replaceWordInText(String word){
|
||||
return text.replaceAll(word, text);
|
||||
public String replaceWordInText(String word, String replacementWord){
|
||||
return text.replaceAll(word, replacementWord);
|
||||
}
|
||||
|
||||
public boolean isWordInText(String word){
|
||||
|
|
Loading…
Reference in New Issue