diff --git a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java index 93f6c0ee8..01b793cf5 100644 --- a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java +++ b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java @@ -77,7 +77,8 @@ public class AllureAwaitilityListener implements ConditionEvaluationListener lifecycle = new InheritableThreadLocal() { + private static final InheritableThreadLocal LIFECYCLE + = new InheritableThreadLocal() { @Override protected AllureLifecycle initialValue() { return Allure.getLifecycle(); @@ -85,7 +86,7 @@ protected AllureLifecycle initialValue() { }; public static AllureLifecycle getLifecycle() { - return lifecycle.get(); + return LIFECYCLE.get(); } /** @@ -250,7 +251,7 @@ public void exceptionIgnored(final IgnoredException ignoredException) { * @param allure allure lifecycle to set */ public static void setLifecycle(final AllureLifecycle allure) { - lifecycle.set(allure); + LIFECYCLE.set(allure); } } diff --git a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java index b9f58879d..d549ee811 100644 --- a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java +++ b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java @@ -60,10 +60,7 @@ public class TemporalDuration implements TemporalAccessor { @Override public boolean isSupported(final TemporalField field) { - if (!temporal.isSupported(field)) { - return false; - } - return temporal.getLong(field) - BASE.getLong(field) != 0L; + return temporal.isSupported(field) && temporal.getLong(field) - BASE.getLong(field) != 0L; } @Override diff --git a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java b/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java index 0c7417c05..0c6f76e44 100644 --- a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java +++ b/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java @@ -52,13 +52,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final PickleTag tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.getName().toUpperCase()); } diff --git a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java index 546838100..f7fc242e7 100644 --- a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java +++ b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java @@ -395,15 +395,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java index 211939586..ced0a37f1 100644 --- a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java +++ b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java index bb0e513bf..6dd1dacfb 100644 --- a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java +++ b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java @@ -380,15 +380,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java index a594d97d9..ada27215b 100644 --- a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java +++ b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTagsList().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTagsList().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java index 5f85512fd..9d7c89b34 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java @@ -393,15 +393,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java index 8efb825a4..a20ad07bf 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java index 37d2fb7ff..8b3533d65 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java @@ -124,7 +124,7 @@ private void processScenarioDefinition( for (Step step : child.getSteps()) { nodeMap.put(step.getLocation().getLine(), createAstNode(step, childNode)); } - if (child.getExamples().size() > 0) { + if (!child.getExamples().isEmpty()) { processScenarioOutlineExamples(nodeMap, child, childNode); } } diff --git a/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java b/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java index b4487310e..320ffe841 100644 --- a/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java +++ b/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java @@ -82,7 +82,7 @@ public boolean process(final Set annotations, final Round } final String docs = rawDocs.trim(); - if ("".equals(docs)) { + if (docs.isEmpty()) { return; } diff --git a/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java b/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java index 1217dcf92..caf8612d5 100644 --- a/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java +++ b/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java @@ -85,22 +85,21 @@ public AllureGrpc interceptResponseMetadata(final boolean value) { return this; } - @SuppressWarnings({"PMD.MethodArgumentCouldBeFinal", "PMD.NPathComplexity"}) + @SuppressWarnings({"PMD.NPathComplexity"}) @Override - public ClientCall interceptCall(MethodDescriptor method, - CallOptions callOptions, - Channel next) { + public ClientCall interceptCall(final MethodDescriptor method, + final CallOptions callOptions, + final Channel next) { final AttachmentProcessor processor = new DefaultAttachmentProcessor(); return new ForwardingClientCall.SimpleForwardingClientCall( next.newCall(method, callOptions.withoutWaitForReady())) { private String stepUuid; - private List parsedResponses = new ArrayList<>(); + private final List parsedResponses = new ArrayList<>(); - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") @Override - public void sendMessage(T message) { + public void sendMessage(final T message) { stepUuid = UUID.randomUUID().toString(); Allure.getLifecycle().startStep(stepUuid, (new StepResult()).setName( "Send gRPC request to " @@ -126,18 +125,17 @@ public void sendMessage(T message) { } } - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") + @SuppressWarnings({"PMD.NcssCount"}) @Override - public void start(Listener responseListener, Metadata headers) { + public void start(final Listener responseListener, final Metadata headers) { final ClientCall.Listener listener = new ForwardingClientCallListener() { @Override protected Listener delegate() { return responseListener; } - @SuppressWarnings({"PMD.MethodArgumentCouldBeFinal", "PMD.AvoidLiteralsInIfCondition"}) @Override - public void onClose(io.grpc.Status status, Metadata trailers) { + public void onClose(final io.grpc.Status status, final Metadata trailers) { GrpcResponseAttachment.Builder responseAttachmentBuilder = null; if (parsedResponses.size() == 1) { @@ -183,9 +181,8 @@ public void onClose(io.grpc.Status status, Metadata trailers) { super.onClose(status, trailers); } - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") @Override - public void onMessage(A message) { + public void onMessage(final A message) { try { parsedResponses.add(JSON_PRINTER.print((MessageOrBuilder) message)); super.onMessage(message); diff --git a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java index 2e4ab5584..14167a41d 100644 --- a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java +++ b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java @@ -34,7 +34,6 @@ /** * @author a-simeshin (Simeshin Artem) */ -@SuppressWarnings("PMD.MethodArgumentCouldBeFinal") public class AllureHttpClient5Request implements HttpRequestInterceptor { private final AttachmentRenderer renderer; @@ -62,7 +61,9 @@ public AllureHttpClient5Request(final AttachmentRenderer rendere * @param context the HTTP context */ @Override - public void process(HttpRequest request, EntityDetails entity, HttpContext context) { + public void process(final HttpRequest request, + final EntityDetails entity, + final HttpContext context) { final String attachmentName = getAttachmentName(request); final HttpRequestAttachment.Builder builder = create(attachmentName, request.getRequestUri()); builder.setMethod(request.getMethod()); diff --git a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java index bf5bff643..f4e53c931 100644 --- a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java +++ b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java @@ -39,7 +39,6 @@ */ @SuppressWarnings({ "checkstyle:ParameterAssignment", - "PMD.MethodArgumentCouldBeFinal", "PMD.AvoidReassigningParameters"}) public class AllureHttpClient5Response implements HttpResponseInterceptor { private final AttachmentRenderer renderer; @@ -69,7 +68,9 @@ public AllureHttpClient5Response(final AttachmentRenderer render * @throws IOException if an I/O error occurs */ @Override - public void process(HttpResponse response, EntityDetails entity, HttpContext context) throws IOException { + public void process(final HttpResponse response, + EntityDetails entity, + final HttpContext context) throws IOException { final HttpResponseAttachment.Builder builder = create("Response"); builder.setResponseCode(response.getCode()); diff --git a/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java b/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java index bbf94fd4e..e052c8d11 100644 --- a/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java +++ b/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java @@ -15,6 +15,7 @@ */ package io.qameta.allure.internal; +import java.util.Deque; import java.util.LinkedList; import java.util.Objects; import java.util.Optional; @@ -32,7 +33,7 @@ public class AllureThreadContext { * Returns last (most recent) uuid. */ public Optional getCurrent() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); return uuids.isEmpty() ? Optional.empty() : Optional.of(uuids.getFirst()); @@ -42,7 +43,7 @@ public Optional getCurrent() { * Returns first (oldest) uuid. */ public Optional getRoot() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); return uuids.isEmpty() ? Optional.empty() : Optional.of(uuids.getLast()); @@ -62,7 +63,7 @@ public void start(final String uuid) { * @return removed uuid. */ public Optional stop() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); if (!uuids.isEmpty()) { return Optional.of(uuids.pop()); } @@ -79,15 +80,15 @@ public void clear() { /** * Thread local context that stores information about not finished tests and steps. */ - private static final class Context extends InheritableThreadLocal> { + private static final class Context extends InheritableThreadLocal> { @Override - public LinkedList initialValue() { + public Deque initialValue() { return new LinkedList<>(); } @Override - protected LinkedList childValue(final LinkedList parentStepContext) { + protected Deque childValue(final Deque parentStepContext) { return new LinkedList<>(parentStepContext); } diff --git a/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java b/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java index 5bd8211d9..137e24df5 100644 --- a/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java +++ b/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java @@ -310,6 +310,7 @@ public void reportingEntryPublished(final TestIdentifier testIdentifier, } + @SuppressWarnings("PMD.InefficientEmptyStringCheck") private Map unwrap(final Map data) { final Map res = new HashMap<>(); data.forEach((key, value) -> { diff --git a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java index ed594591b..b652feb08 100644 --- a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java +++ b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java @@ -180,7 +180,6 @@ private Optional getDisplayName(final Description result) { .map(DisplayName::value); } - @SuppressWarnings("PMD.AvoidLiteralsInIfCondition") private Optional getDescription(final Description result) { final io.qameta.allure.Description annotation = result .getAnnotation(io.qameta.allure.Description.class); diff --git a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java index ebe87e56b..24fa2a8a2 100644 --- a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java +++ b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java @@ -78,10 +78,7 @@ static class CucumberCheck implements Serializable { @Override public boolean equals(final Object obj) { - if (Objects.isNull(obj)) { - return false; - } - return "io.cucumber.junit.PickleRunners.PickleId" + return !Objects.isNull(obj) && "io.cucumber.junit.PickleRunners.PickleId" .equals(obj.getClass().getCanonicalName()); } diff --git a/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java b/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java index 6ede30ed2..7413d70a2 100644 --- a/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java +++ b/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java @@ -187,6 +187,7 @@ public Map buildFailureEvent(final String type, return map; } + @SuppressWarnings("PMD.InefficientEmptyStringCheck") public Map wrap(final Map data) { final Map res = new HashMap<>(); data.forEach((key, value) -> { diff --git a/allure-model/src/main/java/io/qameta/allure/model/Stage.java b/allure-model/src/main/java/io/qameta/allure/model/Stage.java index 697478122..ff08a6149 100644 --- a/allure-model/src/main/java/io/qameta/allure/model/Stage.java +++ b/allure-model/src/main/java/io/qameta/allure/model/Stage.java @@ -57,7 +57,7 @@ public enum Stage { * @return the stage */ public static Stage fromValue(final String v) { - for (Stage c : Stage.values()) { + for (Stage c : values()) { if (c.value.equals(v)) { return c; } diff --git a/allure-model/src/main/java/io/qameta/allure/model/Status.java b/allure-model/src/main/java/io/qameta/allure/model/Status.java index 15c275bd2..37ed668f2 100644 --- a/allure-model/src/main/java/io/qameta/allure/model/Status.java +++ b/allure-model/src/main/java/io/qameta/allure/model/Status.java @@ -54,7 +54,7 @@ public enum Status { * @return the status */ public static Status fromValue(final String v) { - for (Status c : Status.values()) { + for (Status c : values()) { if (c.value.equals(v)) { return c; } diff --git a/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java b/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java index ca06a32b4..1f320f68b 100644 --- a/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java +++ b/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java @@ -31,7 +31,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.HashMap; +import java.util.EnumMap; import java.util.Map; import java.util.Optional; import java.util.UUID; @@ -52,7 +52,7 @@ public class AllureSelenide implements LogEventListener { private boolean saveScreenshots = true; private boolean savePageHtml = true; private boolean includeSelenideLocatorsSteps = true; - private final Map logTypesToSave = new HashMap<>(); + private final Map logTypesToSave = new EnumMap<>(LogType.class); private final AllureLifecycle lifecycle; public AllureSelenide() { @@ -93,8 +93,8 @@ public AllureSelenide disableLogs(final LogType logType) { private static Optional getScreenshotBytes() { try { return WebDriverRunner.hasWebDriverStarted() - ? Optional.of(((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES)) - : Optional.empty(); + ? Optional.of(((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES)) + : Optional.empty(); } catch (WebDriverException e) { LOGGER.warn("Could not get screen shot", e); return Optional.empty(); @@ -104,8 +104,8 @@ private static Optional getScreenshotBytes() { private static Optional getPageSourceBytes() { try { return WebDriverRunner.hasWebDriverStarted() - ? Optional.of(WebDriverRunner.getWebDriver().getPageSource().getBytes(UTF_8)) - : Optional.empty(); + ? Optional.of(WebDriverRunner.getWebDriver().getPageSource().getBytes(UTF_8)) + : Optional.empty(); } catch (WebDriverException e) { LOGGER.warn("Could not get page source", e); return Optional.empty(); diff --git a/build.gradle.kts b/build.gradle.kts index d5edada83..3b3738097 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -158,7 +158,7 @@ configure(libs) { dependency("io.github.benas:random-beans:3.9.0") dependency("io.github.glytching:junit-extensions:2.6.0") dependency("javax.annotation:javax.annotation-api:1.3.2") - dependency("net.sourceforge.pmd:pmd-java:6.55.0") + dependency("net.sourceforge.pmd:pmd-java:7.3.0") dependency("org.apache.commons:commons-lang3:3.12.0") dependency("org.apache.httpcomponents:httpclient:4.5.14") dependency("org.apache.httpcomponents.client5:httpclient5:5.2.1") diff --git a/gradle/quality-configs/checkstyle/checkstyle.xml b/gradle/quality-configs/checkstyle/checkstyle.xml index f1bbd4945..8e3f80a29 100644 --- a/gradle/quality-configs/checkstyle/checkstyle.xml +++ b/gradle/quality-configs/checkstyle/checkstyle.xml @@ -44,7 +44,7 @@ - + @@ -86,7 +86,9 @@ - + + + @@ -152,10 +154,10 @@ - - + + - + @@ -211,7 +213,7 @@ - + diff --git a/gradle/quality-configs/pmd/pmd.xml b/gradle/quality-configs/pmd/pmd.xml index 7a26c293e..adc57b64f 100644 --- a/gradle/quality-configs/pmd/pmd.xml +++ b/gradle/quality-configs/pmd/pmd.xml @@ -26,9 +26,7 @@ - - @@ -45,6 +43,7 @@ + @@ -57,17 +56,15 @@ + + - - - - @@ -112,13 +109,13 @@ - + + -