Reduce code smells (#2089)

Reduce code smells found by deepsource.io. We focused on the low-hanging fruits and not breaking any api.
This commit is contained in:
Eduard Heimbuch
2022-07-15 15:33:37 +02:00
committed by GitHub
parent f61d0c113f
commit 67c083ee54
15 changed files with 149 additions and 443 deletions

View File

@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.it.utils;
import com.google.common.base.Charsets;
@@ -92,11 +92,11 @@ public class RepositoryUtil {
* @throws IOException
*/
public static Changeset commitMultipleFileModifications(RepositoryClient repositoryClient, String username, Map<String, String> addedFiles, Map<String, String> modifiedFiles, List<String> removedFiles) throws IOException {
for (String fileName : addedFiles.keySet()) {
writeAndAddFile(repositoryClient, fileName, addedFiles.get(fileName));
for (Map.Entry<String,String> entry : addedFiles.entrySet()) {
writeAndAddFile(repositoryClient, entry.getKey(), entry.getValue());
}
for (String fileName : modifiedFiles.keySet()) {
writeAndAddFile(repositoryClient, fileName, modifiedFiles.get(fileName));
for (Map.Entry<String,String> entry : modifiedFiles.entrySet()) {
writeAndAddFile(repositoryClient, entry.getKey(), entry.getValue());
}
for (String fileName : removedFiles) {
deleteFileAndApplyRemoveCommand(repositoryClient, fileName);