private static Set<Emoticon> parseEmotes(String json,String channelRestriction){
  Set<Emoticon> emotes=new HashSet<>();
  if (json == null) {
    return emotes;
  }
  JSONParser parser=new JSONParser();
  try {
    JSONObject root=(JSONObject)parser.parse(json);
    String urlTemplate=(String)root.get("urlTemplate");
    if (urlTemplate == null || urlTemplate.isEmpty()) {
      LOGGER.warning("No URL Template");
      return emotes;
    }
    JSONArray emotesArray=(JSONArray)root.get("emotes");
    for (    Object o : emotesArray) {
      if (o instanceof JSONObject) {
        Emoticon emote=parseEmote((JSONObject)o,urlTemplate,channelRestriction);
        if (emote != null) {
          emotes.add(emote);
        }
      }
    }
  }
 catch (  ParseException|ClassCastException ex) {
    LOGGER.warning("BTTV: Error parsing emotes: " + ex);
  }
  return emotes;
}

private static Set < Emoticon > parseEmotes ( String json , String channelRestriction ) { Set < Emoticon > emotes = new HashSet < > ( ) ; if ( json == null ) { return emotes ; } JSONParser parser = new JSONParser ( ) ; try { JSONObject root = ( JSONObject ) parser . parse ( json ) ; String urlTemplate = ( String ) root . get ( "urlTemplate" ) ; if ( urlTemplate == null || urlTemplate . isEmpty ( ) ) { LOGGER . warning ( "No URL Template" ) ; return emotes ; } JSONArray emotesArray = ( JSONArray ) root . get ( "emotes" ) ; for ( Object o : emotesArray ) { if ( o instanceof JSONObject ) { Emoticon emote = parseEmote ( ( JSONObject ) o , urlTemplate , channelRestriction ) ; if ( emote != null ) { emotes . add ( emote ) ; } } } } catch ( ParseException | ClassCastException ex ) { LOGGER . warning ( "BTTV: Error parsing emotes: " + ex ) ; } return emotes ; }
parse emotes from the given json .
