Skip to content

Commit

Permalink
MID-8842 code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed May 31, 2023
1 parent 31ba3a5 commit 5c575f3
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

package com.evolveum.midpoint.ninja.action;

import java.util.ArrayList;
import java.util.List;

import com.evolveum.midpoint.ninja.impl.LogTarget;
import com.evolveum.midpoint.ninja.impl.NinjaException;
import com.evolveum.midpoint.ninja.opts.CountOptions;
Expand All @@ -16,12 +19,6 @@
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* Created by Viliam Repan (lazyman).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class DeleteRepositoryAction extends RepositoryAction<DeleteOptions> {

private enum State {

DELETE, SKIP, STOP;
DELETE, SKIP, STOP
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ public File downloadDistribution(@NotNull String version, ProgressListener liste
FileUtils.forceMkdirParent(file);
file.createNewFile();

StringBuilder url = new StringBuilder();
url.append(DOWNLOAD_URL);
url.append(version);
url.append("/");
url.append(distributionFile);

String url = DOWNLOAD_URL + version + "/" + distributionFile;
Request request = new Request.Builder()
.url(url.toString())
.url(url)
.build();

OkHttpClient client = new OkHttpClient.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public enum UpgradePhase {

BEFORE, AFTER;
BEFORE, AFTER
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public UpgradePreCheckResult execute() throws Exception {
}

String version = versions.iterator().next();
boolean match = Arrays.stream(UpgradeConstants.SUPPORTED_VERSIONS).anyMatch(v -> v.equals(version));
boolean match = Arrays.asList(UpgradeConstants.SUPPORTED_VERSIONS).contains(version);
if (!match) {
// todo error, version didn't match. Ask whether to continue?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

import org.apache.commons.lang3.BooleanUtils;
import org.apache.xml.serialize.LineSeparator;

/**
* @author Radovan Semancik
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

import java.io.File;

/**
* @author semancik
*/
Expand All @@ -22,10 +20,10 @@ public class VerifyOptions extends ExportOptions {

public static final String P_CREATE_REPORT = "--create-report";

@Parameter(names = {P_WARN, P_WARN_LONG}, descriptionKey = "verify.warn")
@Parameter(names = { P_WARN, P_WARN_LONG }, descriptionKey = "verify.warn")
private String warn;

@Parameter(names = {P_CREATE_REPORT}, descriptionKey = "verify.createReport")
@Parameter(names = { P_CREATE_REPORT }, descriptionKey = "verify.createReport")
private Boolean createReport;

public String getWarn() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class OperationStatus {

public enum State {
NOT_STARTED, STARTED, PRODUCER_FINISHED, FINISHED;
NOT_STARTED, STARTED, PRODUCER_FINISHED, FINISHED
}

private final NinjaContext context;
Expand Down

This file was deleted.

0 comments on commit 5c575f3

Please sign in to comment.