国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

list - java code optimization
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-05-17 10:08:39
0
2
747

The current version can run, but it must be poorly written.

List<? extends WeatherData> data =  weatherReportDao.getCoviReportData(reportType);
WeatherENUM weatherENUM = WeatherENUM.valueOf(reportFunction);
switch (weatherENUM){
            case atmosphere:
                data =  atmosphereReportDao.getAtmosphereReportData(reportType);
                break;
            case covi:
                 data =  weatherReportDao.getCoviReportData(reportType);
                break;
            case windSpeed:
                data = windSpeedReportDao.getWindSpeedReportData(reportType);
                break;
        }
        return data;

The key is the initialization of data. If not initialized, an error will be reported. Ask for guidance.

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級(jí)PHP講師

reply all(2)
習(xí)慣沉默
List<? extends WeatherData> data = null;

Or find a way to pass a certain value of weatherENUM as a parameter to dao

List<? extends WeatherData> data =  weatherReportDao.getReportData(reportType,dataType);
phpcn_u1582

If defined as a global variable, there is no need to initialize it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template