Solved Eclipse error

Discussion in 'Plugin Development' started by brord, Dec 11, 2012.

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

    brord

    Good morning folks :)
    Im here once again, with an eclipse derp this time.
    Could anyone explain to me what i am doing wrong here:
    Code:
        FileConfiguration mapconfig;
        Config customconfig;
     
        // Arena list
        public HashMap<String, Integer> maps;
     
        void load(){
             customconfig = new Config(FPSCaste.getInstance());
             FileConfiguration mapconfig = customconfig.getConfig("maps");
        }
     
        /**
            * Load all maps-related stuff.
            * @return
            */
        public void loadmaps()
        {
            maps = new HashMap<String, Integer>();
           
            for (String mapname: mapconfig.getKeys(false));
            {
                maps.put(mapname, 0);
            }
        }
    
    Eclipse gives me the following errors:
    When highlighting the new Config(FPSCaste.getInstance()) part:
    - "Cannot instantiate the type Config"

    When highlighting the customconfig.getConfig("maps"); part:
    - "The method getConfig(String) is undefined for the type Config"

    When highlighting the maps.put(mapname, 0); part:
    - "mapname cannot be resolved to a variable"

    The class Config clearly exists, and works 100%.

    and the mapname String gets initialized 2 lines above, in the enhanced for loop. So i do not understaind what the problem is...

    Thakns in advance!

    - Fixed
    I jsut rewrote the method, exacly the same, and it worked like a charm.
    Oh you, eclipse...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
Thread Status:
Not open for further replies.

Share This Page