error message : stream closed

后端 未结 3 841
遇见更好的自我
遇见更好的自我 2020-12-21 19:44

Upon running following code under class FlightSearch

String moreSearch = \"y\";
    List resultList;

    // load initial flight d         


        
3条回答
  •  天涯浪人
    2020-12-21 20:28

    After making changes as suggested in previous answer my code didn't tun but with slight more changes as shown below, my code compiled and run just fine

        try {
            do {
                // main thread gets input
                Input inputQuery = new Input();
                inputQuery.getQuery();
    
                // main thread STARTs processing task as background monitors csv
                // repo
                QueryProcessor processor = new QueryProcessor();
                resultList = null;
                resultList = processor.matchQuery(inputQuery);
    
                displayResult(resultList, inputQuery.getFlightClass());
                System.out
                        .println("More Flight Query ? Press n/N to exit. Anyother key to continue searching.");
                moreSearch = br.readLine();
    
            } while (!moreSearch.equalsIgnoreCase("n"));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InvalidException e1) {
            e1.getMessage();
        } finally {
            fl.stopThread();
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        System.out.println("Thank You !!!");
    }
    

    thanks for help.

提交回复
热议问题