Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<pmd.build-tools.version>34</pmd.build-tools.version>
<pmd.build-tools.version>35</pmd.build-tools.version>
<pmd.plugin.version>3.28.0</pmd.plugin.version>
<pmd.check.version>7.15.0</pmd.check.version>
<pmd.check.version>7.17.0</pmd.check.version>

<jflex-output>${project.build.directory}/generated-sources/jflex</jflex-output>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class DesignerVersion {
private static final String PMD_CORE_MIN_VERSION;
private static final String UNKNOWN_VERSION = "unknown";

/**
/*
* Determines the version from maven's generated designer.properties file.
*/
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public Var<String> messageProperty() {
}

@Override
@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable") // not used in a sorted set/map
public int compareTo(LogEntry o) {
return getTimestamp().compareTo(o.getTimestamp());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public LiveViolationRecord(int line, @NonNull TextRegion region, String message)


@Override
@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable") // not used in a sorted set/map
public int compareTo(LiveViolationRecord o) {
TextRegion mine = getRegion();
TextRegion theirs = o.getRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

package net.sourceforge.pmd.util.fxdesigner.model.testing;

import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.nio.file.Files;
Expand Down Expand Up @@ -142,9 +140,7 @@ public static String dumpXmlTests(TestCollection collection) throws Exception {


public static void dumpXmlTests(Path path, TestCollection collection) throws Exception {
try (OutputStream is = Files.newOutputStream(path);
Writer out = new OutputStreamWriter(is)) {

try (Writer out = Files.newBufferedWriter(path)) {
dumpXmlTests(out, collection);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ int getScore() {


@Override
@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable") // not used in a sorted set/map
public int compareTo(CompletionResult o) {
return Integer.compare(score, o.score);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public int getScore() {


@Override
@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable") // not used in a sorted set/map
public int compareTo(MatchResult<?> o) {
return Integer.compare(score, o.score);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

package net.sourceforge.pmd.util.fxdesigner.util.controls;

import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.file.Files;
import java.util.function.Function;
Expand Down Expand Up @@ -243,8 +240,7 @@ public static void saveToFileButton(Button button, Stage popupStage, Supplier<St

if (file != null) {

try (OutputStream is = Files.newOutputStream(file.toPath());
Writer out = new BufferedWriter(new OutputStreamWriter(is))) {
try (Writer out = Files.newBufferedWriter(file.toPath())) {

out.write(content.get());
SimplePopups.showActionFeedback(button, AlertType.CONFIRMATION, "File saved");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.IntFunction;

import org.checkerframework.checker.nullness.qual.NonNull;
Expand Down Expand Up @@ -222,7 +221,13 @@ public IntFunction<javafx.scene.Node> testCaseLineNumberFactory(LiveTestCase liv

liveTestCase.addCommitHandler(t -> pin.unsubscribe());

Val<IntFunction<Val<Integer>>> map1 = mapVal.map(it -> (int j) -> Optional.ofNullable(it.get(j)).orElse(new LiveArrayList<>()).sizeProperty());
Val<IntFunction<Val<Integer>>> map1 = mapVal.map(it -> (int j) -> it.entrySet().stream()
// TODO: this is probably wrong - j is not the offset, but the line number
.filter((entry) -> entry.getKey().contains(j))
.findFirst()
.map(Map.Entry::getValue)
.orElse(new LiveArrayList<>())
.sizeProperty());

IntFunction<Val<Integer>> numViolationsPerLine = i -> map1.flatMap(it -> it.apply(i));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public static void showAt(PopOver popOver, Window owner, javafx.scene.Node ancho
popOver.show(owner, bounds.getMinX() + bounds.getWidth() / 2,
bounds.getMinY() + bounds.getHeight() - offset);
break;
default:
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public final class DistinctBetweenStream<I> extends EventStreamBase<I> {
private final Timer timer;
private Object previous = NONE;

@SuppressWarnings("PMD.AssignmentInOperand") // https://github.com/pmd/pmd/issues/6075
private DistinctBetweenStream(EventStream<I> input, Function<Runnable, Timer> timerFactory) {
this.input = input;
this.timer = timerFactory.apply(() -> previous = NONE);
Expand Down