Subversion Repositories SmartDukaan

Rev

Rev 13604 | Rev 15842 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13604 Rev 13605
Line 374... Line 374...
374
    }
374
    }
375
 
375
 
376
	private Map<Long, Integer> getPolularityMap() {
376
	private Map<Long, Integer> getPolularityMap() {
377
		try {
377
		try {
378
			Reader reader = new FileReader(Utils.EXPORT_PATH + Utils.POPULARITY_JSON);
378
			Reader reader = new FileReader(Utils.EXPORT_PATH + Utils.POPULARITY_JSON);
379
			return new Gson().fromJson(reader, new TypeToken<Map<Long, Integer>>() {}.getType());
379
			Map<Long, Integer> result =  new Gson().fromJson(reader, new TypeToken<Map<Long, Integer>>() {}.getType());
-
 
380
			if(result == null) {
-
 
381
				result = new HashMap<Long, Integer>();
-
 
382
			}
-
 
383
			return result; 
380
		} catch (Exception e) {
384
		} catch (Exception e) {
381
			log.error("Could not read popularity file");
385
			log.error("Could not read popularity file");
382
			e.printStackTrace();
386
			e.printStackTrace();
383
			return new HashMap<Long, Integer>();
387
			return new HashMap<Long, Integer>();
384
		}
388
		}