Merge branch 'feature/JAL-3144noJTree' into
[jalview.git] / src / jalview / fts / service / pdb / PDBFTSRestClient.java
index a5b441f..c0ca3a5 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.fts.service.pdb;
 
+import jalview.bin.Jalview;
 import jalview.datamodel.SequenceI;
 import jalview.fts.api.FTSData;
 import jalview.fts.api.FTSDataColumnI;
@@ -43,26 +44,15 @@ import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
 import org.json.simple.parser.ParseException;
 
-//import jalview.javascript.web.Client;
-//import jalview.javascript.web.ClientResponse;
-//import jalview.javascript.web.WebResource;
-
 import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.WebResource;
-
-import com.sun.jersey.api.client.config.ClientConfig;
 import com.sun.jersey.api.client.config.DefaultClientConfig;
 
 /**
  * A rest client for querying the Search endpoint of the PDB API
  * 
- * BH 2018: just a tiny tweak here - for SwingJS, we coerce the classes to be
- * from jalview.javascript.web instead of com.sun.jersey.api.client
- * 
- * 
  * @author tcnofoegbu
- *
  */
 public class PDBFTSRestClient extends FTSRestClient
 {
@@ -90,9 +80,6 @@ public class PDBFTSRestClient extends FTSRestClient
   {
     try
     {
-      Client client;
-      WebResource webResource;
-
       String wantedFields = getDataColumnsFieldsAsCommaDelimitedString(
               pdbRestRequest.getWantedFields());
       int responseSize = (pdbRestRequest.getResponseSize() == 0)
@@ -137,9 +124,9 @@ public class PDBFTSRestClient extends FTSRestClient
 
       // BH 2018 the trick here is to coerce the classes in Javascript to be 
       // different from the ones in Java yet still allow this to be correct for Java
+      Client client;
       Class<ClientResponse> clientResponseClass;
-      if (/** @j2sNative true || */
-      false)
+      if (Jalview.isJS())
       {
         // JavaScript only -- coerce types to Java types for Java
         client = (Client) (Object) new jalview.javascript.web.Client();
@@ -152,6 +139,7 @@ public class PDBFTSRestClient extends FTSRestClient
         clientResponseClass = ClientResponse.class;
       }
 
+      WebResource webResource;
       if (pdbRestRequest.isFacet())
       {
         webResource = client.resource(PDB_SEARCH_ENDPOINT)