title: Get hashmap using reflection Java, code error
body: <p>I am attempting to load the corresponding hashmap using reflection. However I get a field not found exception. Please let me know what you think the issue is. Thanks</p>
  
  <pre><code>//Find the map
          HashMap&lt;String, Matches&gt; map = null;
  
          //Reflection to find the appropriate map
          try {
              Field field = Field.class.getField(mapName); //exception (mapname = lookupHashmap) this class has a lookupHashmap declared)
              try {
  
                  //Set the map
                  map = (HashMap&lt;String, Matches&gt;)field.get(this); //Not sure if this is correct
  
              } catch (IllegalArgumentException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (IllegalAccessException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
          } catch (SecurityException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (NoSuchFieldException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>Stack trace</p>
  
  <pre><code>java.lang.NoSuchFieldException: majorFieldLookup
      at java.lang.Class.getField(Class.java:1522)
      at MatchingGraph.getResultsForMap(MatchingGraph.java:245)
      at MatchingGraph.getmajorFieldMatches(MatchingGraph.java:196)
      at Matcher.findMatches(Matcher.java:95)
      at Tester.main(Tester.java:27)
  </code></pre>