mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
suppress compile type warnings
This commit is contained in:
parent
66e1f5cca6
commit
eb57361b6f
@ -172,7 +172,7 @@ final class ResultViewerPersistence {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulate the property sort order and sort rank into onde data bag.
|
* Encapsulate the property, sort order, and sort rank into one data bag.
|
||||||
*/
|
*/
|
||||||
static class SortCriterion {
|
static class SortCriterion {
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ import java.util.concurrent.CancellationException;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.swing.SortOrder;
|
import javax.swing.SortOrder;
|
||||||
@ -163,17 +164,25 @@ class ThumbnailViewChildren extends Children.Keys<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Comparator<Node> getCriterionComparator(SortCriterion criterion) {
|
private Comparator<Node> getCriterionComparator(SortCriterion criterion) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
Comparator<Node> c = Comparator.comparing(node -> getPropertyValue(node, criterion.getProperty()),
|
Comparator<Node> c = Comparator.comparing(node -> getPropertyValue(node, criterion.getProperty()),
|
||||||
Comparator.nullsFirst(Comparator.naturalOrder()));
|
Comparator.nullsFirst(Comparator.naturalOrder()));
|
||||||
return criterion.getSortOrder() == SortOrder.ASCENDING ? c : c.reversed();
|
return criterion.getSortOrder() == SortOrder.ASCENDING ? c : c.reversed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
private Comparable getPropertyValue(Node node, Node.Property<?> prop) {
|
private Comparable getPropertyValue(Node node, Node.Property<?> prop) {
|
||||||
for (Node.PropertySet ps : node.getPropertySets()) {
|
for (Node.PropertySet ps : node.getPropertySets()) {
|
||||||
for (Node.Property<?> p : ps.getProperties()) {
|
for (Node.Property<?> p : ps.getProperties()) {
|
||||||
if (p.equals(prop)) {
|
if (p.equals(prop)) {
|
||||||
try {
|
try {
|
||||||
return (Comparable) p.getValue();
|
if (p.getValue() instanceof Comparable) {
|
||||||
|
return (Comparable) p.getValue();
|
||||||
|
} else {
|
||||||
|
//if the value is not comparable use its string representation
|
||||||
|
return p.getValue().toString();
|
||||||
|
}
|
||||||
|
|
||||||
} catch (IllegalAccessException | InvocationTargetException ex) {
|
} catch (IllegalAccessException | InvocationTargetException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
Exceptions.printStackTrace(ex);
|
||||||
}
|
}
|
||||||
@ -221,7 +230,7 @@ class ThumbnailViewChildren extends Children.Keys<Integer> {
|
|||||||
*/
|
*/
|
||||||
private class ThumbnailViewNode extends FilterNode {
|
private class ThumbnailViewNode extends FilterNode {
|
||||||
|
|
||||||
private final Logger logger = Logger.getLogger(ThumbnailViewNode.class.getName());
|
private final Logger logger = Logger.getLogger(ThumbnailViewNode.class.getName());
|
||||||
|
|
||||||
private final Image waitingIcon = Toolkit.getDefaultToolkit().createImage(ThumbnailViewNode.class.getResource("/org/sleuthkit/autopsy/images/working_spinner.gif"));
|
private final Image waitingIcon = Toolkit.getDefaultToolkit().createImage(ThumbnailViewNode.class.getResource("/org/sleuthkit/autopsy/images/working_spinner.gif"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user