MCPcopy Index your code
hub / github.com/PCGen/pcgen / buildMap

Method buildMap

code/src/java/pcgen/util/JepCountType.java:727–749  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

725 }
726
727 private static void buildMap()
728 {
729 typeMap = new CaseInsensitiveMap<>();
730 Field[] fields = JepCountType.class.getDeclaredFields();
731 for (Field field : fields)
732 {
733 int mod = field.getModifiers();
734 if (Modifier.isStatic(mod) && Modifier.isFinal(mod) && Modifier.isPublic(mod))
735 {
736 try
737 {
738 Object obj = field.get(null);
739 if (obj instanceof JepCountType)
740 {
741 typeMap.put(field.getName(), (JepCountType) obj);
742 }
743 } catch (IllegalArgumentException | IllegalAccessException e)
744 {
745 throw new UnreachableError(e);
746 }
747 }
748 }
749 }
750
751 /**
752 * Returns the constant for the given String (the search for the constant is

Callers 2

valueOfMethod · 0.95
getAllConstantsMethod · 0.95

Calls 5

getModifiersMethod · 0.80
isStaticMethod · 0.65
getMethod · 0.65
putMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected