Using getList(" ") in FileConfiguration?

Discussion in 'Plugin Development' started by thehutch, Nov 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    thehutch

    Ok so I am struggling on how to find out how to use this because everytime I use it I get this warning

    Type safety: The expression of type List needs unchecked conversion to conform to List<String>

    But everytime I use this it never works and I tried List<?> but thats obviously wrong.

    If your stuck as to what i'm using this for i'm trying to get a list of players as strings so basically getting this list.

    Code:
    Players:
     
        - player1
     
        - player2
     
        - player3
     
    etc....
     
    [All help is appreciated Thank you
     
  2. Offline

    surtic

    Thats work for me :)


    Code:
    List<String> clanNameList = plugin.getConfig().getList("Clans.List");
     
  3. Offline

    thehutch

    Do you still have the warning line under it though?
     
  4. Offline

    surtic

    hehe yes i have it :) and i ignore it :) i have see this on the bukkit wiki
     
  5. Offline

    Fishrock123

    You cant fix it, if your using eclipse it will let you put @suppresswarnings() somewhere.

    Its because getList(String) and even the newer getStringList(String) do dot produce List<String>, but rather (edit: ) List (Thanks Samkio).
     
  6. Offline

    thehutch

    They doesnt work because it requires an element or something and I was told by @Samkio not to use it :D
     
  7. Offline

    Fishrock123

    Well, they *work*, but they return warnings.
     
    Samkio likes this.
  8. Offline

    Samkio

    public List getList(String path);
    It's a list.
     
Thread Status:
Not open for further replies.

Share This Page