-
-
Notifications
You must be signed in to change notification settings - Fork 117
Code Improved and Bug Fixed #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for this @TT-talhatariq!! Highly appreciated 👏 |
@TT-talhatariq Why have you added a bunch of images in |
.idea/.gitignore
Outdated
@@ -0,0 +1,8 @@ | |||
# Default ignored files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gitignore
in the .idea folder...?
Actually, it was because of IntelliJ Idea. Once I opened this project in that IDE, and that IDE created some extra folders and files in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review this now.
That looks much cleaner now. Thank you! To avoid that, it could be nice to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TT-talhatariq Why did you remove all toLowerCase
?
@@ -175,7 +175,7 @@ public void replace() { | |||
} | |||
|
|||
public void replaceAll() { | |||
txt.setText(txt.getText().toLowerCase().replaceAll(textF.getText().toLowerCase(), textR.getText())); | |||
txt.setText(txt.getText().replaceAll(textF.getText() , textR.getText())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason why you removed the case-insensitive selection.toLowerCase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there is a bug in the replaceAll() method of Find.java class. If we replace the word of Text in NotePad with a word, all the characters who're in Uppercase in NotePad, changed to LowerCase.
Like, let's say there is "Talha is Here" in notePad and I replaced the name "Talha" with "Ali" by using the replace all field.
That statement will first change the text of NotePad "Talha is Here" into "talha is ali".
All Uppercase letters are converted into lower case.
You can Test that replaceAll() function.
@TT-talhatariq With what Java version did you test it? Could you also update the |
@TT-talhatariq Once my concerns have been addressed, I will be happy to approve your work and merge it 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explained replaceAll() bug above in detail. If you have further query let me Know.
Also, I updated the Jar file. And I'm using java version 17.
Now, there's no issue of cases. First It even replaces the word "talha" with "Talha" in notepad and vice-versa. But this is not possible now and also bug of all lowercase letters resolved.
Yes, I've seen it now where you mentioned the bug. Awesome, thanks very much for doing so @TT-talhatariq 😄 |
Can you replace the current jar file of the project by yours? |
Thank you for your appreciation 😁 |
Oh, I see now 🙂 Somehow I missed it 😄 Thank you for your prompt reply @TT-talhatariq! You rock! 👌 |
I improved the code readability by changing for loops and switch statements with enhanced for loops and switch statements respectively
Also, there is a bug in the Find.java class. If we replace a word of Text with another one, all the characters who're in Uppercase in NotePad, changed to LowerCase.