From 1b52f9d266acc4ab493a658753167f2a831d75d2 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 3 May 2021 23:29:08 +0200 Subject: [PATCH] Fix compiler warning --- src/main/java/net/fornwall/jelf/ElfFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/fornwall/jelf/ElfFile.java b/src/main/java/net/fornwall/jelf/ElfFile.java index 35f5b21..152153e 100644 --- a/src/main/java/net/fornwall/jelf/ElfFile.java +++ b/src/main/java/net/fornwall/jelf/ElfFile.java @@ -290,7 +290,7 @@ public ElfSection firstSectionByType(int type) throws ElfException { public T firstSectionByType(Class type) throws ElfException { for (int i = 1; i < num_sh; i++) { ElfSection sh = getSection(i); - if (type.isInstance(sh)) return (T) sh; + if (type.isInstance(sh)) return type.cast(sh); } return null; }