Repository: TheAlgorithms/Java
Pull request #5359 (2024-08-21 20:43:01)

refactor: fix typo in class name `LongestNonRepetitiveSubstring`
Fix typo in class name 

<!--
Thank you for your contribution!
In order to reduce the number of notifications sent to the maintainers, please:
- create your PR as draft, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests,
- make sure that all of the CI checks pass,
- mark your PR as ready for review, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review
-->

<!-- For completed items, change [ ] to [x] -->

- [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md).
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with `clang-format -i --style=file path/to/your/file.java`

codecov-commenter: ## [Codecov](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5359?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 45.45%. Comparing base [(`5149051`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/5149051e95aebba639b160297f8666f8cb16301d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) to head [(`fed1525`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/fed1525e25d7ad93e792737dac21192b85380271?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff              @@
##             master    #5359      +/-   ##
============================================
+ Coverage     45.44%   45.45%   +0.01%     
  Complexity     2817     2817              
============================================
  Files           522      522              
  Lines         15368    15368              
  Branches       2915     2915              
============================================
+ Hits           6984     6986       +2     
+ Misses         8090     8089       -1     
+ Partials        294      293       -1     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5359?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).


Patch:
diff --git a/src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java b/src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java
similarity index 87%
rename from src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java
rename to src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java
index cc99a16f..c113162f 100644
--- a/src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java
+++ b/src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java
@@ -1,16 +1,17 @@
 package com.thealgorithms.strings;
 
 import java.util.HashMap;
+import java.util.Map;
 
-final class LongestNonRepeativeSubstring {
-    private LongestNonRepeativeSubstring() {
+final class LongestNonRepetitiveSubstring {
+    private LongestNonRepetitiveSubstring() {
     }
 
     public static int lengthOfLongestSubstring(String s) {
         int max = 0;
         int start = 0;
         int i = 0;
-        HashMap<Character, Integer> map = new HashMap<>();
+        Map<Character, Integer> map = new HashMap<>();
 
         while (i < s.length()) {
             char temp = s.charAt(i);


Test patch:
diff --git a/src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java b/src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java
similarity index 50%
rename from src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java
rename to src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java
index 4bd5ac99..c6fd8c59 100644
--- a/src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java
+++ b/src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java
@@ -3,13 +3,13 @@ package com.thealgorithms.strings;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
-public class LongestNonRepeativeSubstringTest {
+public class LongestNonRepetitiveSubstringTest {
 
     @Test
     public void palindrome() {
         String input1 = "HelloWorld";
         String input2 = "javaIsAProgrammingLanguage";
-        Assertions.assertEquals(LongestNonRepeativeSubstring.lengthOfLongestSubstring(input1), 5);
-        Assertions.assertEquals(LongestNonRepeativeSubstring.lengthOfLongestSubstring(input2), 9);
+        Assertions.assertEquals(LongestNonRepetitiveSubstring.lengthOfLongestSubstring(input1), 5);
+        Assertions.assertEquals(LongestNonRepetitiveSubstring.lengthOfLongestSubstring(input2), 9);
     }
 }