From 555d68ab422fffe934aaea8abd24d346d9f642b8 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Thu, 20 Jul 2023 21:57:53 +0200 Subject: [PATCH] Fix unchecked operations --- .../searching/impl/MemberWithAnnotationSearch.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java index ec572948..ec7da6e4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java @@ -14,6 +14,7 @@ import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel; import javax.swing.*; import java.awt.*; +import java.util.Arrays; import java.util.List; /*************************************************************************** @@ -67,11 +68,13 @@ public class MemberWithAnnotationSearch implements SearchPanel { 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.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, ""))); + node.fields.stream().filter(fn -> hasAnnotation(srchText, Arrays.asList(fn.invisibleAnnotations, fn.visibleAnnotations))) + .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... annoLists) { + public static boolean hasAnnotation(String annotation, List> annoLists) { if (annoLists == null) return false; for (List annos : annoLists) { if (annos == null) continue;