Hi i am getting a very strange exception that i dont quit understand because when i debug the area in which the exception is thrown, no exception is thrown during debugging at the specific area.
to make my problem simplier to understand, the exception points to this code below that gets some string value and splits into an array and than grab a part of the string value.
The following code is executed below in this method. look at the amount of times the method split() is executed. when debugging it, not one of them indicates an exception but has soon as i move to the next part of my code, the exception is thrown.Code:public String split(String original, String separator) { Vector nodes = new Vector(); String tab = ""; // Parse nodes into vector int index = original.indexOf(separator); while(index>=0) { nodes.addElement( original.substring(0, index) ); original = original.substring(index+separator.length()); index = original.indexOf(separator); } // Get the last node nodes.addElement( original ); // Create splitted string array String[] result = new String[ nodes.size() ]; if( nodes.size()>0 ) { for(int loop=0; loop<nodes.size(); loop++) result[loop] = (String)nodes.elementAt(loop); } /////////////////////////////// StringBuffer b = new StringBuffer(); int length = 0; int j = 0; try { int g = 0; int q = 0; length = result[2].length(); while(q < length) { char val = result[2].charAt(q); if ((val == '"') && (g == 0) && (length != q)) { //store digits g = q; char val1; while((val1 = result[2].charAt(g+1)) != '"') // exception error points here { b.append(val1); g++; } } q++; } g=0; q=0; tab = b.toString(); } catch(Exception e) { e.printStackTrace(); } return tab; }
Please note that the type of data thats contained in result[2] is value="glazlo">Code://get the values and prepare them fname = "?sg_FirstName=" + split(data[8], " ") + "\n" + "\0"; lname = "&sg_LastName=" + split(data[9], " ") + "\n" + "\0"; address = "&sg_Address=" + split(data[10], " ") + "\n" + "\0"; city = "&sg_City=" + split(data[18], " ") + "\n" + "\0"; state1 = "&sg_State=" + "&" + "\n" + "\0"; ip = "sg_IPAddress=&" + "\n" + "\0"; zip = "sg_Zip=" + split(data[12], " ") + "\n" + "\0"; country = "&sg_Country=" + split(data[16], " ") + "\n" + "\0"; phone = "&sg_Phone=" + split(data[13], " ") + "\n" + "\0"; email = "&sg_Email=" + split(data[11], " ")+ "\n" + "\0"; cvv2 = "&sg_CVV2=" + card[0] + "\n" + "\0"; number = "&sg_CardNumber=" + card[1] + "\n" + "\0"; expM = "&sg_ExpMonth=" + card[2] + "\n" + "\0"; expY = "&sg_ExpYear=" + card[3] + "\n" + "\0"; amount = "&sg_Amount=" + card[4] + "\n" + "\0"; id = "&sg_ClientUniqueID=" + split(data[6], " ") + "\n" + "\0"; login = "&login=" + split(data[0], " ") + "\n" + "\0"; pass = "&pass=" + split(data[1], " ") + "\n" + "\0"; lang = "&lang=" + split(data[2], " ") + "\n" + "\0"; cur = "&cur=" + split(data[19], " ") + "\n" + "\0"; String sid = "id=1&" + "\n" + "\0"; String cart = "cartec=casino770" + "\n" + "\0"; //exception thrown at this point but why? String url2 = "http://fcg.casino770.com/fcg-games/depot/mobileok.php3" +fname+lname+address+city+state1+ip+zip+country+phone +email+cvv2+number+expM+expY+amount+id+login+pass+lang +cur+sid+cart; server2 = (HttpConnection) Connector.open(url2, Connector.READ_WRITE);
Thanks for reading this and hope someone can help me thanks


LinkBack URL
About LinkBacks
Reply With Quote