Fix build with JDK 9+

This commit is contained in:
Nico Mexis 2021-06-22 20:54:37 +02:00
parent 5581a343f5
commit 913b49c593
No known key found for this signature in database
GPG Key ID: 27D6E17CE092AB78

AI 샘플 코드 생성 중입니다

Loading...
3 changed files with 9 additions and 8 deletions

View File

@ -6,7 +6,7 @@
<version>2.10.12</version>
<properties>
<java.version>8</java.version>
<java.version>1.8</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -256,7 +256,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.1.1</version> <!-- 3.1.2 breaks build on JDK 9+ -->
<configuration>
<archive>
<manifest>

View File

@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.MutableTreeNode;
import java.util.Comparator;
import javax.swing.tree.TreeNode;
/**
* @author Konloch
@ -33,19 +34,19 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
private void recursiveSort(final ResourceTreeNode node)
{
node.children.sort(nodeComparator);
for (ResourceTreeNode nextNode : (Iterable<ResourceTreeNode>) node.children)
for (TreeNode nextNode : (Iterable<TreeNode>) node.children)
{
if (nextNode.getChildCount() > 0)
{
recursiveSort(nextNode);
recursiveSort((ResourceTreeNode) nextNode);
}
}
}
protected Comparator<ResourceTreeNode> nodeComparator = new Comparator<ResourceTreeNode>()
protected Comparator<TreeNode> nodeComparator = new Comparator<TreeNode>()
{
@Override
public int compare(final ResourceTreeNode o1, final ResourceTreeNode o2)
public int compare(final TreeNode o1, final TreeNode o2)
{
// To make sure nodes with children are always on top
final int firstOffset = o1.getChildCount() > 0 ? -1000 : 0;

View File

@ -82,10 +82,10 @@ public class SearchKeyAdapter extends KeyAdapter
else
{
@SuppressWarnings("unchecked")
Enumeration<ResourceTreeNode> enums = curNode.depthFirstEnumeration();
Enumeration<TreeNode> enums = curNode.depthFirstEnumeration();
while (enums != null && enums.hasMoreElements())
{
ResourceTreeNode node = enums.nextElement();
ResourceTreeNode node = (ResourceTreeNode) enums.nextElement();
if (node.isLeaf())
{
if (((String) (node.getUserObject())).toLowerCase().contains(path[path.length - 1].toLowerCase()))