Fix unchecked operations

This commit is contained in:
Nico Mexis 2023-07-20 21:57:53 +02:00
parent c932596d1a
commit 555d68ab42
No known key found for this signature in database
GPG key ID: 27D6E17CE092AB78

View file

@ -14,6 +14,7 @@ import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.Arrays;
import java.util.List; import java.util.List;
/*************************************************************************** /***************************************************************************
@ -67,11 +68,13 @@ public class MemberWithAnnotationSearch implements SearchPanel {
if (srchText.isEmpty()) return; if (srchText.isEmpty()) return;
node.fields.stream().filter(fn -> hasAnnotation(srchText, fn.invisibleAnnotations, fn.visibleAnnotations)).forEach(fn -> BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult(container, resourceWorkingName, node, null, fn, fn.name + " " + fn.desc, ""))); node.fields.stream().filter(fn -> hasAnnotation(srchText, Arrays.asList(fn.invisibleAnnotations, fn.visibleAnnotations)))
node.methods.stream().filter(mn -> hasAnnotation(srchText, mn.invisibleAnnotations, mn.visibleAnnotations)).forEach(mn -> BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult(container, resourceWorkingName, node, mn, null, mn.name + mn.desc, ""))); .forEach(fn -> BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult(container, resourceWorkingName, node, null, fn, fn.name + " " + fn.desc, "")));
node.methods.stream().filter(mn -> hasAnnotation(srchText, Arrays.asList(mn.invisibleAnnotations, mn.visibleAnnotations)))
.forEach(mn -> BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult(container, resourceWorkingName, node, mn, null, mn.name + mn.desc, "")));
} }
public static boolean hasAnnotation(String annotation, List<AnnotationNode>... annoLists) { public static boolean hasAnnotation(String annotation, List<List<AnnotationNode>> annoLists) {
if (annoLists == null) return false; if (annoLists == null) return false;
for (List<AnnotationNode> annos : annoLists) { for (List<AnnotationNode> annos : annoLists) {
if (annos == null) continue; if (annos == null) continue;