config.getString(key, null) Returns Incorrectly

Discussion in 'Plugin Development' started by kuzi117, Oct 23, 2011.

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

    kuzi117

    Code:
    List<String> keys = getKeys(config);
    for (int n = 0; n < strings.size(); n++) {
        newData[n][0] = config.getString(perms.get(n), null);
    }
    This chunk of my code iterates through keys collected by this other chunk:
    Code:
    private List<String> getKeys(YamlConfiguration config) {
        List<String> keys = new ArrayList<String>();
        Set<String> allKeys = config.getKeys(true);
        for(String key : allKeys) {
            if (!config.isConfigurationSection(key)) {
                permKeys.add(key);
            }
        }
        return permKeys;
    }
    Now if the YAMLConfiguration file contains keys to the second level (eg. "first.second") the string is returned fine. But since my file has many third and fourth levels ("first.second.third.fourth") the method automatically returns the specified default. Anybody see the bug in my code? Or is it a bukkit bug (doubt it though).
    Anything you guys could toss me would be helpful.
    Thanks in advance :)
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    @kuzi117
    Update your server to RB 1337.... atleast.
     
  3. Offline

    kuzi117

    I swear to jesus, if that's what's causing this... -.- lol
    EDIT: UGH. God I'm stupid. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page