Fixed Duplicates in HashMap
This commit is contained in:
parent
92e519e567
commit
ccc19fac3e
2 changed files with 23 additions and 6 deletions
26
.idea/workspace.xml
generated
26
.idea/workspace.xml
generated
|
@ -4,8 +4,7 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="9b57ac51-c870-474b-9dfd-64a5fc490635" name="Changes" comment="Removing not needed lines">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<list default="true" id="9b57ac51-c870-474b-9dfd-64a5fc490635" name="Changes" comment="Fixed Duplicates in HashMap">
|
||||
<change beforePath="$PROJECT_DIR$/src/ThreadedCompare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ThreadedCompare.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -20,6 +19,17 @@
|
|||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Rebase.Settings">
|
||||
<option name="NEW_BASE" value="master" />
|
||||
</component>
|
||||
<component name="GithubPullRequestsUISettings">
|
||||
<option name="selectedUrlAndAccountId">
|
||||
<UrlAndAccount>
|
||||
<option name="accountId" value="614b6e79-2a1d-40ca-82ec-6c7ae06c9284" />
|
||||
<option name="url" value="https://github.com/bly-codes/Sherly.git" />
|
||||
</UrlAndAccount>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
|
@ -79,7 +89,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1672704560597</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="6" />
|
||||
<task id="LOCAL-00006" summary="Fixed Duplicates in HashMap">
|
||||
<created>1672749481858</created>
|
||||
<option name="number" value="00006" />
|
||||
<option name="presentableId" value="LOCAL-00006" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1672749481858</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="7" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -109,6 +126,7 @@
|
|||
<MESSAGE value="First Creation" />
|
||||
<MESSAGE value="Just a Test" />
|
||||
<MESSAGE value="Removing not needed lines" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Removing not needed lines" />
|
||||
<MESSAGE value="Fixed Duplicates in HashMap" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Fixed Duplicates in HashMap" />
|
||||
</component>
|
||||
</project>
|
|
@ -25,9 +25,8 @@ public class ThreadedCompare extends Thread {
|
|||
bothList.add(file1);
|
||||
bothList.add(file2);
|
||||
|
||||
//here it is trying to add the values in the HashMap
|
||||
//here it is trying to add the values in the HashMap so everything is nice and clear
|
||||
Main.fileMap.putIfAbsent(getMD5Sum(file1.toFile()), bothList);
|
||||
|
||||
Main.fileMap.get(getMD5Sum(file1.toFile())).removeAll(bothList);
|
||||
Main.fileMap.get(getMD5Sum(file1.toFile())).addAll(bothList);
|
||||
|
||||
|
|
Reference in a new issue