From a06a7aa2ffc88fd84bc78b1f28827805ec5eb0a9 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 21 May 2024 18:02:14 +0100 Subject: [PATCH] JAL-1054 Change one more (unused) url.openStream to use the HttpUtils wrapper for completeness --- src/jalview/bin/JalviewLite.java | 48 ++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index b73fffc..7e1296e 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -20,7 +20,27 @@ */ package jalview.bin; +import java.applet.Applet; +import java.awt.Button; +import java.awt.Color; +import java.awt.Component; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.List; import java.util.Locale; +import java.util.StringTokenizer; +import java.util.Vector; import jalview.analysis.AlignmentUtils; import jalview.api.StructureSelectionManagerProvider; @@ -56,28 +76,6 @@ import jalview.structure.StructureSelectionManager; import jalview.util.ColorUtils; import jalview.util.HttpUtils; import jalview.util.MessageManager; - -import java.applet.Applet; -import java.awt.Button; -import java.awt.Color; -import java.awt.Component; -import java.awt.EventQueue; -import java.awt.Font; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.StringTokenizer; -import java.util.Vector; - import netscape.javascript.JSObject; /** @@ -1366,7 +1364,7 @@ public class JalviewLite extends Applet try { BufferedReader reader = new BufferedReader( - new InputStreamReader(url.openStream())); + new InputStreamReader(HttpUtils.openStream(url))); String line; while ((line = reader.readLine()) != null) { @@ -2253,8 +2251,8 @@ public class JalviewLite extends Applet PDBEntry[] pdb = new PDBEntry[pdbs.size()]; String[][] chains = new String[pdbs.size()][]; String[] protocols = new String[pdbs.size()]; - for (int pdbsi = 0, pdbsiSize = pdbs - .size(); pdbsi < pdbsiSize; pdbsi++) + for (int pdbsi = 0, + pdbsiSize = pdbs.size(); pdbsi < pdbsiSize; pdbsi++) { Object[] o = (Object[]) pdbs.elementAt(pdbsi); pdb[pdbsi] = (PDBEntry) o[0]; -- 1.7.10.2