Skip to content

Commit

Permalink
[MNG-7899] Various memory usage improvements
Browse files Browse the repository at this point in the history
- Remove the Collections.synchronizedMap since all methods that use the
transfers map are synchronized
  • Loading branch information
sebastien-doyon committed Oct 19, 2023
1 parent 2895d01 commit e3647fa
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.maven.cli.transfer;

import java.io.PrintStream;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Locale;
Expand All @@ -35,7 +34,7 @@
*/
public class ConsoleMavenTransferListener extends AbstractMavenTransferListener {

private Map<TransferResource, Long> transfers = Collections.synchronizedMap(new LinkedHashMap<>());
private Map<TransferResource, Long> transfers = new LinkedHashMap<>();
private FileSizeFormat format = new FileSizeFormat(Locale.ENGLISH); // use in a synchronized fashion
private StringBuilder buffer = new StringBuilder(128); // use in a synchronized fashion

Expand Down

0 comments on commit e3647fa

Please sign in to comment.