updateRunning = true;
}
- Thread thread = new Thread(this);
+ Thread thread = new Thread(this, "OverviewUpdateThread");
thread.start();
repaint();
updateRunning = false;
MessageManager.getString("label.principal_component_analysis"),
475, 400);
- Thread worker = new Thread(this);
+ Thread worker = new Thread(this, "PCACalcThread");
worker.start();
}
ScoreModelI scoreModel = ScoreModels.getInstance()
.getDefaultModel(false);
pcaModel.setScoreModel(scoreModel);
- new Thread(this).start();
+ new Thread(this, "PCARecalcThread").start();
}
}
else if (evt.getSource() == protSetting)
ScoreModelI scoreModel = ScoreModels.getInstance()
.getDefaultModel(true);
pcaModel.setScoreModel(scoreModel);
- new Thread(this).start();
+ new Thread(this, "PCARecalcThread").start();
}
}
}
frame.addWindowListener(this);
- Thread worker = new Thread(this);
+ Thread worker = new Thread(this, "RedundancyCalcThread");
worker.start();
}
*/
package jalview.bin;
-import groovy.lang.Binding;
-import groovy.util.GroovyScriptEngine;
-
import jalview.ext.so.SequenceOntology;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import javax.swing.UIManager;
+import groovy.lang.Binding;
+import groovy.util.GroovyScriptEngine;
+
/**
* Main class for Jalview Application <br>
* <br>
running--;
}
}
- }).start();
+ }, "FeatureFetcherThread").start();
}
public synchronized boolean allFinished()
}
try
{
- Map<String, Object> vbinding = new HashMap<String, Object>();
+ Map<String, Object> vbinding = new HashMap<>();
vbinding.put("Jalview", this);
if (af != null)
{
+ nickname + "|" + url);
if (source == null)
{
- source = new Vector<String>();
+ source = new Vector<>();
}
source.addElement(nickname);
}
System.out.println("adding source '" + data + "'");
if (source == null)
{
- source = new Vector<String>();
+ source = new Vector<>();
}
source.addElement(data);
}
private static final String ALPHACARBON = "CA";
- private List<String> chainNames = new ArrayList<String>();
+ private List<String> chainNames = new ArrayList<>();
- private Hashtable<String, String> chainFile = new Hashtable<String, String>();
+ private Hashtable<String, String> chainFile = new Hashtable<>();
/*
* Object through which we talk to Chimera
/*
* Map of ChimeraModel objects keyed by PDB full local file name
*/
- private Map<String, List<ChimeraModel>> chimeraMaps = new LinkedHashMap<String, List<ChimeraModel>>();
+ private Map<String, List<ChimeraModel>> chimeraMaps = new LinkedHashMap<>();
String lastHighlightCommand;
String file = pe.getFile();
try
{
- List<ChimeraModel> modelsToMap = new ArrayList<ChimeraModel>();
+ List<ChimeraModel> modelsToMap = new ArrayList<>();
List<ChimeraModel> oldList = viewer.getModelList();
boolean alreadyOpen = false;
// exit thread if Chimera Viewer is closed in Jalview
}
}
- });
+ }, "ChimeraMonitorThread");
chimeraMonitor.start();
}
protected List<AtomSpec> convertStructureResiduesToAlignment(
List<String> structureSelection)
{
- List<AtomSpec> atomSpecs = new ArrayList<AtomSpec>();
+ List<AtomSpec> atomSpecs = new ArrayList<>();
for (String atomSpec : structureSelection)
{
try
protected IProgressIndicator progressIndicator;
- protected JComboBox<FTSDataColumnI> cmb_searchTarget = new JComboBox<FTSDataColumnI>();
+ protected JComboBox<FTSDataColumnI> cmb_searchTarget = new JComboBox<>();
protected JButton btn_ok = new JButton();
protected int pageLimit;
- protected HashSet<String> paginatorCart = new HashSet<String>();
+ protected HashSet<String> paginatorCart = new HashSet<>();
private static final int MIN_WIDTH = 670;
private void jbInit() throws Exception
{
- txt_search = new JvCacheableInputBox<String>(getCacheKey());
+ txt_search = new JvCacheableInputBox<>(getCacheKey());
populateCmbSearchTargetOptions();
Integer width = getTempUserPrefs().get("FTSPanel.width") == null ? 800
: getTempUserPrefs().get("FTSPanel.width");
*/
public void populateCmbSearchTargetOptions()
{
- List<FTSDataColumnI> searchableTargets = new ArrayList<FTSDataColumnI>();
+ List<FTSDataColumnI> searchableTargets = new ArrayList<>();
try
{
Collection<FTSDataColumnI> foundFTSTargets = getFTSRestClient()
public void transferToSequenceFetcher(String ids)
{
seqFetcher.getTextArea().setText(ids);
- Thread worker = new Thread(seqFetcher);
+ Thread worker = new Thread(seqFetcher, "GFTSSeqFetcherThread");
worker.start();
}
private static String defaultFTSFrameTitle = MessageManager
.getString("label.pdb_sequence_fetcher");
- private static Map<String, Integer> tempUserPrefs = new HashMap<String, Integer>();
+ private static Map<String, Integer> tempUserPrefs = new HashMap<>();
private static final String PDB_FTS_CACHE_KEY = "CACHE.PDB_FTS";
// mainFrame.dispose();
disableActionButtons();
StringBuilder selectedIds = new StringBuilder();
- HashSet<String> selectedIdsSet = new HashSet<String>();
+ HashSet<String> selectedIdsSet = new HashSet<>();
int primaryKeyColIndex = 0;
try
{
String ids = selectedIds.toString();
// System.out.println(">>>>>>>>>>>>>>>> selected Ids: " + ids);
seqFetcher.getTextArea().setText(ids);
- Thread worker = new Thread(seqFetcher);
+ Thread worker = new Thread(seqFetcher, "PDBFTSSeqFetcherThread");
worker.start();
delayAndEnableActionButtons();
}
}
buildingMenu = false;
}
- }).start();
+ }, "BuildWebServiceThread").start();
}
protected void showProductsFor(final SequenceI[] sel, final boolean _odna,
final String source)
{
- new Thread(CrossRefAction.showProductsFor(sel, _odna, source, this))
+ new Thread(CrossRefAction.showProductsFor(sel, _odna, source, this),
+ "CrossReferencesThread")
.start();
}
ex.printStackTrace();
}
}
- }).start();
+ }, "DropFileThread").start();
}
}
});
dbRefFetcher.fetchDBRefs(false);
}
- }).start();
+ }, "BuildFetchDBMenuThread").start();
}
setSize(400, 400); // probably should be a configurable/dynamic default here
initMenus();
addingStructures = false;
- worker = new Thread(this);
+ worker = new Thread(this, "OpenJmolThread");
worker.start();
this.addInternalFrameListener(new InternalFrameAdapter()
initMenus();
addingStructures = false;
- worker = new Thread(this);
+ worker = new Thread(this, "OpenChimeraThread");
worker.start();
this.addInternalFrameListener(new InternalFrameAdapter()
// Starting two seperate threads to read from the PipedInputStreams
//
- reader = new Thread(this);
+ reader = new Thread(this, "ConsoleReader1Thread");
reader.setDaemon(true);
reader.start();
//
- reader2 = new Thread(this);
+ reader2 = new Thread(this, "ConsoleReader2Thread");
reader2.setDaemon(true);
reader2.start();
// and a thread to append text to the textarea
- textAppender = new Thread(this);
+ textAppender = new Thread(this, "ConsoleTextAppendThread");
textAppender.setDaemon(true);
textAppender.start();
}
// We do it with a seperate Thread becasue we don't wan't to break a Thread
// used by the Console.
System.out.println("\nLets throw an error on this console");
- errorThrower = new Thread(this);
+ errorThrower = new Thread(this, "ConsoleErrorLogThread");
errorThrower.setDaemon(true);
errorThrower.start();
}
import javax.swing.JCheckBox;
import javax.swing.JLabel;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
{
if (sourceRegistry == null)
{
- Thread worker = new Thread(this);
+ Thread worker = new Thread(this, "PaintDasThread");
worker.start();
}
}
}
}
- Vector<jalviewSourceI> selected = new Vector<jalviewSourceI>();
+ Vector<jalviewSourceI> selected = new Vector<>();
for (String source : selectedSources)
{
jalviewSourceI srce = sourceRegistry.getSource(source);
{
saveProperties(jalview.bin.Cache.applicationProperties);
- Thread worker = new Thread(this);
+ Thread worker = new Thread(this, "RepaintDasThread");
worker.start();
}
private void setCapabilities(DasSourceRegistryI sourceRegistry2)
{
- Vector<String> authority = new Vector<String>();
- Vector<String> type = new Vector<String>();
- Vector<String> label = new Vector<String>();
- Vector<String> taxIds = new Vector<String>();
+ Vector<String> authority = new Vector<>();
+ Vector<String> type = new Vector<>();
+ Vector<String> label = new Vector<>();
+ Vector<String> taxIds = new Vector<>();
authority.add("Any");
type.add("Any");
label.add("Any");
fileFormat);
Cache.log.debug("Filechooser init thread finished.");
}
- }).start();
+ }, "InitFileChooserThread").start();
// Add the service change listener
changeSupport.addJalviewPropertyChangeListener("services",
new PropertyChangeListener()
Desktop.instance.setProgressBar(null, now);
jvnews.showNews();
}
- }).start();
+ }, "ShowNewsWindowThread").start();
}
}
}
{
new SplashScreen(true);
}
- }).start();
+ }, "ShowAboutMenuThread").start();
}
public StringBuffer getAboutMessage(boolean shortv)
}
setProgressBar(null, choice.hashCode());
}
- }).start();
+ }, "SaveJalviewProjectThread").start();
}
}
}
setProgressBar(null, choice.hashCode());
}
- }).start();
+ }, "LoadJalviewProjectThread").start();
}
}
dsktp.v_client.initial_update();
}
- });
+ }, "VamsasSessionThread");
rthr.start();
}
};
{
UserQuestionnaireCheck jvq = new UserQuestionnaireCheck(url);
// javax.swing.SwingUtilities.invokeLater(jvq);
- new Thread(jvq).start();
+ new Thread(jvq, "CheckQuestionnaireThread").start();
}
public void checkURLLinks()
this.showMemoryUsage = showMemory;
if (showMemory)
{
- Thread worker = new Thread(this);
+ Thread worker = new Thread(this, "ShowMemoryUsageThread");
worker.start();
}
repaint();
}
// JAL-940 - disabled JWS1 service configuration - always start discoverer
// until we phase out completely
- (t0 = new Thread(discoverer)).start();
+ (t0 = new Thread(discoverer, "DiscovererThread")).start();
}
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
progress.setProgressBar(null, this.hashCode());
}
}
- }).start();
+ }, "OpenURLThread").start();
}
public static WsParamSetManager wsparamManager = null;
frame.setVisible(true);
}
- }).start();
+ }, "UnblockedDialogThread").start();
}
else
{
return;
}
- Thread thread = new Thread(this);
+ Thread thread = new Thread(this, "UpdateOverviewThread");
thread.start();
repaint();
// and call ourselves again.
addStructure(pdbentry, seqs, chains, align, alignFrame);
}
- }).start();
+ }, "Adding3DStructureQueueThread").start();
return;
}
}
addingStructures = true;
_started = false;
alignAddedStructures = align;
- worker = new Thread(this);
+ worker = new Thread(this, "Adding3DStructureThread");
worker.start();
return;
}
*/
void startPrinting()
{
- Thread thread = new Thread(this);
+ Thread thread = new Thread(this, "PrintTreeCanvasThread");
thread.start();
}
Vector<SequenceNode> l = tree.findLeaves(groups.get(i));
- Vector<SequenceI> sequences = new Vector<SequenceI>();
+ Vector<SequenceI> sequences = new Vector<>();
for (int j = 0; j < l.size(); j++)
{
Cache.log.info("Jalview finished updating to the Vamsas Session.");
}
- });
+ }, "UpdateVamsasThread");
udthread.start();
}
import javax.swing.JComponent;
import javax.swing.JEditorPane;
import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
AnimatedPanel ap = new AnimatedPanel();
titlePanel.add(ap, BorderLayout.CENTER);
- Thread thread = new Thread(ap);
+ Thread thread = new Thread(ap, "AnimatedPanelThread");
thread.start();
final WebserviceInfo thisinfo = this;
frame.addInternalFrameListener(
new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void cancel_actionPerformed(ActionEvent e)
{
if (!serviceIsCancellable)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
JvOptionPane.showInternalMessageDialog(Desktop.desktop, message,
BufferedImage offscreen;
+ @Override
public void run()
{
startTime = System.currentTimeMillis();
}
}
+ @Override
public void paintComponent(Graphics g1)
{
drawPanel();
renderAsHtml = b;
}
+ @Override
public void hyperlinkUpdate(HyperlinkEvent e)
{
Desktop.hyperlinkUpdate(e);
import java.util.Vector;
import javax.swing.JLabel;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
wsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls();
if (!wsUrls.isEmpty())
{
- oldUrls = new Vector<String>(wsUrls);
+ oldUrls = new Vector<>(wsUrls);
}
else
{
oldUrls = null;
- wsUrls = new Vector<String>();
+ wsUrls = new Vector<>();
}
wsList.setDefaultRenderer(Integer.class, new JabaWSStatusRenderer());
wsList.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
rsbsUrls = jalview.ws.rest.RestClient.getRsbsDescriptions();
if (rsbsUrls != null)
{
- oldRsbsUrls = new Vector<String>(rsbsUrls);
+ oldRsbsUrls = new Vector<>(rsbsUrls);
}
else
{
oldRsbsUrls = null;
- rsbsUrls = new Vector<String>();
+ rsbsUrls = new Vector<>();
}
updateRsbsList();
enableEnfinServices.setSelected(
updateWsMenuConfig(false);
refreshWsMenu(true);
}
- }).start();
+ }, "RefreshWebServicesThread").start();
}
progressBar.setVisible(false);
validate();
}
- }).start();
+ }, "RefreshWebServicesMenuProgressBarThread").start();
}
else
Desktop.instance.setProgressBar(null, ct);
}
- }).start();
+ }, "RefreshWebServicesMenuThread").start();
}
}
updateWsMenuConfig(false);
refreshWsMenu(showProgressInDialog);
}
- }).start();
+ }, "UpdateAndRefreshWebServicesMenuThread").start();
}
}
e.printStackTrace();
return;
}
- new Thread(this).start();
+ new Thread(this, "ExportBioJsHTMLThread").start();
}
File directory = new File(BJS_TEMPLATES_LOCAL_DIRECTORY);
Objects.requireNonNull(dirName, "dirName MUST not be null!");
Objects.requireNonNull(directory, "directory MUST not be null!");
- TreeMap<String, File> versionFileMap = new TreeMap<String, File>();
+ TreeMap<String, File> versionFileMap = new TreeMap<>();
for (File file : directory.listFiles())
{
this.protocol = protocol;
this.format = format;
- final Thread loader = new Thread(this);
+ final Thread loader = new Thread(this, "LoadFileThread");
SwingUtilities.invokeLater(new Runnable()
{
*/
protected AlignFrame _LoadFileWaitTillLoaded()
{
- Thread loader = new Thread(this);
+ Thread loader = new Thread(this, "LoadFileWithWaitingThread");
loader.start();
while (loader.isAlive())
e.printStackTrace();
return;
}
- new Thread(this).start();
+ new Thread(this, "ExportSvgHTMLThread").start();
}
public int printUnwrapped(int pwidth, int pheight, int pi,
{
if (executor == null)
{
- executor = new Thread(new JSFunctionExec(jvlite));
+ executor = new Thread(new JSFunctionExec(jvlite),
+ "JavaScriptThread");
executor.start();
}
synchronized (jsExecQueue)
// create all components and add them
frame = new Frame("Java Console");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension frameSize = new Dimension((int) (screenSize.width / 2),
- (int) (screenSize.height / 2));
- int x = (int) (frameSize.width / 2);
- int y = (int) (frameSize.height / 2);
+ Dimension frameSize = new Dimension(screenSize.width / 2,
+ screenSize.height / 2);
+ int x = frameSize.width / 2;
+ int y = frameSize.height / 2;
frame.setBounds(x, y, frameSize.width, frameSize.height);
textArea = new TextArea();
// Starting two seperate threads to read from the PipedInputStreams
//
- reader = new Thread(this);
+ reader = new Thread(this, "AWTConsoleReader1Thread");
reader.setDaemon(true);
reader.start();
//
- reader2 = new Thread(this);
+ reader2 = new Thread(this, "AWTConsoleReader2Thread");
reader2.setDaemon(true);
reader2.start();
.getLocalGraphicsEnvironment();
String[] fontNames = ge.getAvailableFontFamilyNames();
for (int n = 0; n < fontNames.length; n++)
+ {
System.out.println(fontNames[n]);
+ }
// Testing part: simple an error thrown anywhere in this JVM will be printed
// on the Console
// We do it with a seperate Thread becasue we don't wan't to break a Thread
// used by the Console.
System.out.println("\nLets throw an error on this console");
- errorThrower = new Thread(this);
+ errorThrower = new Thread(this, "AWTConsoleErrorLogThread");
errorThrower.setDaemon(true);
errorThrower.start();
}
+ @Override
public synchronized void windowClosed(WindowEvent evt)
{
quit = true;
System.exit(0);
}
+ @Override
public synchronized void windowClosing(WindowEvent evt)
{
frame.setVisible(false); // default behaviour of JFrame
frame.dispose();
}
+ @Override
public synchronized void actionPerformed(ActionEvent evt)
{
textArea.setText("");
}
+ @Override
public synchronized void run()
{
try
textArea.append(input);
}
if (quit)
+ {
return;
+ }
}
while (Thread.currentThread() == reader2)
textArea.append(input);
}
if (quit)
+ {
return;
+ }
}
} catch (Exception e)
{
{
int available = in.available();
if (available == 0)
+ {
break;
+ }
byte b[] = new byte[available];
in.read(b);
input = input + new String(b, 0, b.length);
DbSourceProxy[] sources, FeatureSettings featureSettings,
boolean isNucleotide)
{
- listeners = new ArrayList<FetchFinishedListenerI>();
+ listeners = new ArrayList<>();
this.progressWindow = progressIndicatorFrame;
alseqs = new SequenceI[seqs.length];
SequenceI[] ds = new SequenceI[seqs.length];
{
// af.featureSettings_actionPerformed(null);
String[] defdb = null;
- List<DbSourceProxy> selsources = new ArrayList<DbSourceProxy>();
+ List<DbSourceProxy> selsources = new ArrayList<>();
Vector<jalviewSourceI> dasselsrc = (featureSettings != null)
? featureSettings.getSelectedSources()
: new DasSourceBrowser().getSelectedSources();
{
defdb = DBRefSource.PROTEINDBS;
}
- List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
+ List<DbSourceProxy> srces = new ArrayList<>();
for (String ddb : defdb)
{
List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
// TODO can we not simply write
// if (waitTillFinished) { run(); } else { new Thread(this).start(); }
- Thread thread = new Thread(this);
+ Thread thread = new Thread(this, "FetchDBRefThread");
thread.start();
running = true;
}
else if (seqs == null)
{
- seqs = new Vector<SequenceI>();
+ seqs = new Vector<>();
seqs.addElement(seq);
}
}
else
{
- seqs = new Vector<SequenceI>();
+ seqs = new Vector<>();
seqs.addElement(seq);
}
e.printStackTrace();
}
- Vector<SequenceI> sdataset = new Vector<SequenceI>(
+ Vector<SequenceI> sdataset = new Vector<>(
Arrays.asList(dataset));
- List<String> warningMessages = new ArrayList<String>();
+ List<String> warningMessages = new ArrayList<>();
int db = 0;
while (sdataset.size() > 0 && db < dbSources.length)
SequenceI[] currSeqs = new SequenceI[sdataset.size()];
sdataset.copyInto(currSeqs);// seqs that are to be validated against
// dbSources[db]
- Vector<String> queries = new Vector<String>(); // generated queries curSeq
- seqRefs = new Hashtable<String, Vector<SequenceI>>();
+ Vector<String> queries = new Vector<>(); // generated queries curSeq
+ seqRefs = new Hashtable<>();
int seqIndex = 0;
{
// Work out which sequences this sequence matches,
// taking into account all accessionIds and names in the file
- Vector<SequenceI> sequenceMatches = new Vector<SequenceI>();
+ Vector<SequenceI> sequenceMatches = new Vector<>();
// look for corresponding accession ids
DBRefEntry[] entryRefs = DBRefUtils
.selectRefs(retrievedSeq.getDBRefs(), new String[]
*/
private SequenceI[] recoverDbSequences(SequenceI[] sequencesArray)
{
- Vector<SequenceI> nseq = new Vector<SequenceI>();
+ Vector<SequenceI> nseq = new Vector<>();
for (int i = 0; sequencesArray != null
&& i < sequencesArray.length; i++)
{
if (reply == JvOptionPane.YES_OPTION)
{
- Thread thread = new Thread(new FetchDBRefs());
+ Thread thread = new Thread(new FetchDBRefs(),
+ "FetchDBReferenceManagerThread");
thread.start();
}
else
private void _startFetching()
{
running = true;
- new Thread(new FetchSeqFeatures()).start();
+ new Thread(new FetchSeqFeatures(), "FetchSeqFeaturesThread").start();
}
class FetchSeqFeatures implements Runnable
public void run()
{
final Discoverer discoverer = this;
- Thread discoverThread = new Thread()
+ Thread discoverThread = new Thread() // no function?
{
@Override
public void run()
running = true;
// first set up exclusion list if needed
- final Set<String> ignoredServices = new HashSet<String>();
+ final Set<String> ignoredServices = new HashSet<>();
for (String ignored : Cache
.getDefault("IGNORED_JABAWS_SERVICETYPES", "").split("\\|"))
{
{
validServiceUrls.removeAllElements();
}
- ArrayList<String> svctypes = new ArrayList<String>();
+ ArrayList<String> svctypes = new ArrayList<>();
- List<JabaWsServerQuery> qrys = new ArrayList<JabaWsServerQuery>();
+ List<JabaWsServerQuery> qrys = new ArrayList<>();
for (final String jwsserver : getServiceUrls())
{
JabaWsServerQuery squery = new JabaWsServerQuery(this, jwsserver);
}
qrys.add(squery);
- new Thread(squery).start();
+ new Thread(squery, "JabaQueryThread").start();
}
boolean finished = true;
do
+ svctypes.indexOf(svc.serviceType);
}
jalview.util.QuickSort.sort(spos, svcs);
- services = new Vector<Jws2Instance>();
+ services = new Vector<>();
for (Jws2Instance svc : svcs)
{
if (!ignoredServices.contains(svc.serviceType))
{
if (services == null)
{
- services = new Vector<Jws2Instance>();
+ services = new Vector<>();
}
System.out.println(
"Discovered service: " + jwsservers + " " + service.toString());
service.hasParameters();
if (validServiceUrls == null)
{
- validServiceUrls = new Vector<String>();
+ validServiceUrls = new Vector<>();
}
validServiceUrls.add(jwsservers);
}
* for moment we keep them separate.
*/
JMenu atpoint;
- List<Jws2Instance> enumerableServices = new ArrayList<Jws2Instance>();
+ List<Jws2Instance> enumerableServices = new ArrayList<>();
// jws2al.removeAll();
- Map<String, Jws2Instance> preferredHosts = new HashMap<String, Jws2Instance>();
- Map<String, List<Jws2Instance>> alternates = new HashMap<String, List<Jws2Instance>>();
+ Map<String, Jws2Instance> preferredHosts = new HashMap<>();
+ Map<String, List<Jws2Instance>> alternates = new HashMap<>();
for (Jws2Instance service : services.toArray(new Jws2Instance[0]))
{
if (!isRecalculable(service.action))
{
if (ph == null)
{
- ph = new ArrayList<Jws2Instance>();
+ ph = new ArrayList<>();
}
ph.add(service);
alternates.put(service.serviceType, ph);
changeSupport.firePropertyChange("services",
new Vector<Jws2Instance>(), services);
};
- }).start();
+ }, "LoadPreferredServiceThread").start();
}
});
*/
JMenu atpoint;
- List<String> hostLabels = new ArrayList<String>();
- Hashtable<String, String> lasthostFor = new Hashtable<String, String>();
- Hashtable<String, ArrayList<Jws2Instance>> hosts = new Hashtable<String, ArrayList<Jws2Instance>>();
- ArrayList<String> hostlist = new ArrayList<String>();
+ List<String> hostLabels = new ArrayList<>();
+ Hashtable<String, String> lasthostFor = new Hashtable<>();
+ Hashtable<String, ArrayList<Jws2Instance>> hosts = new Hashtable<>();
+ ArrayList<String> hostlist = new ArrayList<>();
for (Jws2Instance service : enumerableServices)
{
ArrayList<Jws2Instance> hostservices = hosts.get(service.getHost());
if (hostservices == null)
{
hosts.put(service.getHost(),
- hostservices = new ArrayList<Jws2Instance>());
+ hostservices = new ArrayList<>());
hostlist.add(service.getHost());
}
hostservices.add(service);
{
if (args.length > 0)
{
- testUrls = new ArrayList<String>();
+ testUrls = new ArrayList<>();
for (String url : args)
{
testUrls.add(url);
// return test urls, if there are any, instead of touching cache
return testUrls;
}
- List<String> urls = new ArrayList<String>();
+ List<String> urls = new ArrayList<>();
if (this.preferredUrl != null)
{
public Vector<Jws2Instance> getServices()
{
return (services == null) ? new Vector<Jws2Instance>()
- : new Vector<Jws2Instance>(services);
+ : new Vector<>(services);
}
/**
{
if (urlsWithoutServices == null)
{
- urlsWithoutServices = new Vector<String>();
+ urlsWithoutServices = new Vector<>();
}
if ((invalidServiceUrls == null
{
if (invalidServiceUrls == null)
{
- invalidServiceUrls = new Vector<String>();
+ invalidServiceUrls = new Vector<>();
}
if (!invalidServiceUrls.contains(jwsservers))
{
*/
public Jws2Instance getPreferredServiceFor(String[] serviceURLs)
{
- HashSet<String> urls = new HashSet<String>();
+ HashSet<String> urls = new HashSet<>();
urls.addAll(Arrays.asList(serviceURLs));
Jws2Instance match = null;
if (services != null)
return match;
}
- Map<String, Map<String, String>> preferredServiceMap = new HashMap<String, Map<String, String>>();;
+ Map<String, Map<String, String>> preferredServiceMap = new HashMap<>();;
/**
* get current preferred service of the given type, or global default
String afid = (af == null) ? "" : af.getViewport().getSequenceSetId();
if (preferredServiceMap == null)
{
- preferredServiceMap = new HashMap<String, Map<String, String>>();
+ preferredServiceMap = new HashMap<>();
}
Map<String, String> prefmap = preferredServiceMap.get(afid);
if (prefmap == null)
{
- prefmap = new HashMap<String, String>();
+ prefmap = new HashMap<>();
preferredServiceMap.put(afid, prefmap);
}
prefmap.put(serviceType, selectedServer.getHost());