Подскажите,что не нравится валидатору?
package com.javarush.task.task15.task1527;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Парсер реквестов
*/
public class Solution {
public static void main(String[] args) {
//add your code here
String value = "";
double valueDoble = 0;
String strDouble = "";
ArrayList list = new ArrayList();
try(BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))){
String str = reader.readLine();
StringBuffer sb = new StringBuffer(str);
String newStr = sb.substring(str.indexOf('?')+1);
String[] words = newStr.split("&");
for(int i = 0; i < words.length; i++){
//System.out.println(word);
if(i < words.length){
// System.out.println("i = "+ i + " "+ words.length);
if(words[i].indexOf('=')>0){
if (words[i].substring(0,words[i].indexOf('=')).equals("obj")){
strDouble = words[i].substring(words[i].indexOf('=')+1);
valueDoble = Double.parseDouble(strDouble);
// test = words[i].substring(words[i].indexOf('=')+1);
// System.out.println(test);
}
// value =value + words[i].substring(0,words[i].indexOf('='))+" ";
list.add(words[i].substring(0,words[i].indexOf('=')));
}else value = value + words[i]+" ";
}else{
if(words[i].indexOf('=')>0){
value =value + words[i].substring(0,words[i].indexOf('='));
}else value = value + words[i];
}
}
for(Object s: list){
System.out.print(s+" ");
}
System.out.println();
if(valueDoble !=0)alert(valueDoble);
}catch(NumberFormatException i){
alert(strDouble);
}catch ( IOException i){
i.printStackTrace();
}
}
public static void alert(double value) {
System.out.println("double: " + value);
}
public static void alert(String value) {
System.out.println("String: " + value);//
}
}