From: gmungoc Date: Tue, 13 Nov 2018 17:52:42 +0000 (+0000) Subject: JAL-3026 test for File.hashCode problem X-Git-Tag: Release_2_11_4_0~45^2~18^2~407^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=691e1c1636c4a831e37db17eadb1e0f0ca73ac3f;p=jalview.git JAL-3026 test for File.hashCode problem --- diff --git a/utils/test/JalviewJSTest.java b/utils/test/JalviewJSTest.java index 989d13d..e981196 100644 --- a/utils/test/JalviewJSTest.java +++ b/utils/test/JalviewJSTest.java @@ -6,7 +6,10 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.MediaTracker; +import java.io.File; import java.text.DecimalFormat; +import java.util.HashMap; +import java.util.Map; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -32,14 +35,22 @@ public class JalviewJSTest extends JPanel { public static void main(String[] args) { - new JalviewJSTest().doTest(); + new JalviewJSTest().doTest2(); } + void doTest2() { + Map map = new HashMap<>(); + File f1 = new File("/var/folders/y/xyz"); + File f2 = new File("/var/folders/y/xyz"); + map.put(f1, "hello world"); + System.out.println(map.get(f2)); + } /** * Put some content in a JFrame and show it */ void doTest() { + System.out.println("ab;c;".split(";")); new DecimalFormat("###,###").format((Integer) 1); JFrame main = new JFrame(); main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);