Subject: use simple_json library
Author: Olivier Sallou <osallou@debian.org>
Description: json.org library is not "free", use simple_json
 library and update according to API
Last-Updated: 30/05/12

--- a/biojava3-ws/src/main/java/org/biojava3/ws/hmmer/RemoteHmmerScan.java
+++ b/biojava3-ws/src/main/java/org/biojava3/ws/hmmer/RemoteHmmerScan.java
@@ -13,8 +13,9 @@
 import java.util.TreeSet;
 
 import org.biojava3.core.sequence.ProteinSequence;
-import org.json.JSONArray;
-import org.json.JSONObject;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
 
 
 /** Makes remote calls to the Hmmer3 web site and returns Pfam domain annotations for an input protein sequence.
@@ -102,15 +103,14 @@
 
 		SortedSet<HmmerResult> results = new TreeSet<HmmerResult>();
 		try {
-			JSONObject json = new JSONObject(result.toString());
+			JSONObject json= (JSONObject) JSONValue.parse(result.toString());
+			JSONObject hmresults = (JSONObject) json.get("results");
 
-			JSONObject hmresults = json.getJSONObject("results");
 
+			JSONArray hits = (JSONArray) hmresults.get("hits");
 
-			JSONArray hits = hmresults.getJSONArray("hits");
-
-			for(int i =0 ; i < hits.length() ; i++){
-				JSONObject hit = hits.getJSONObject(i);
+			for(int i =0 ; i < hits.size() ; i++){
+				JSONObject hit = (JSONObject) hits.get(i);
 				//System.out.println("hit: "+ hit);
 
 				HmmerResult hmmResult = new HmmerResult();
@@ -125,11 +125,11 @@
 				hmmResult.setPvalue((Double)hit.get("pvalue"));
 				hmmResult.setScore(Float.parseFloat((String)hit.get("score")));
 
-				JSONArray hmmdomains = hit.getJSONArray("domains");
+				JSONArray hmmdomains = (JSONArray) hit.get("domains");
 
 				SortedSet<HmmerDomain> domains = new TreeSet<HmmerDomain>();
-				for ( int j= 0 ; j < hmmdomains.length() ; j++){
-					JSONObject d = hmmdomains.getJSONObject(j);
+				for ( int j= 0 ; j < hmmdomains.size() ; j++){
+					JSONObject d = (JSONObject) hmmdomains.get(j);
 					//System.out.println(d);
 					Integer is_reported = getInteger(d.get("is_reported"));
 					if ( is_reported != 1) {
