Revert "removing strange condition"

This reverts commit 249bc2c6bc.
This commit is contained in:
rusefillc 2022-07-12 06:41:42 -04:00
parent 249bc2c6bc
commit acc8ceec76
2 changed files with 5 additions and 6 deletions

Binary file not shown.

View File

@ -78,17 +78,16 @@ public class PinoutLogic {
classList.set(index, listPin.getPinTsName()); classList.set(index, listPin.getPinTsName());
} }
for (Map.Entry<String, ArrayList<String>> kv : names.entrySet()) { for (Map.Entry<String, ArrayList<String>> kv : names.entrySet()) {
String pinName = kv.getKey(); PinType namePinType = PinType.find(kv.getKey());
PinType namePinType = PinType.find(pinName);
String outputEnumName = namePinType.getOutputEnumName(); String outputEnumName = namePinType.getOutputEnumName();
String pinType = namePinType.getPinType(); String pinType = namePinType.getPinType();
String nothingName = namePinType.getNothingName(); String nothingName = namePinType.getNothingName();
EnumsReader.EnumState enumList = state.enumsReader.getEnums().get(pinType); EnumsReader.EnumState enumList = state.enumsReader.getEnums().get(pinType);
EnumPair pair = enumToOptionsList(nothingName, enumList, kv.getValue()); EnumPair pair = enumToOptionsList(nothingName, enumList, kv.getValue());
if (pair.getSimpleForm().isEmpty()) if (pair.getSimpleForm().length() > 0) {
throw new IllegalStateException("No simple form for " + pinName); registry.register(outputEnumName + ENUM_SUFFIX, pair.getShorterForm());
registry.register(outputEnumName + ENUM_SUFFIX, pair.getShorterForm()); parseState.addDefinition(outputEnumName + ENUM_SUFFIX, pair.getShorterForm(), Definition.OverwritePolicy.IgnoreNew);
parseState.addDefinition(outputEnumName + ENUM_SUFFIX, pair.getShorterForm(), Definition.OverwritePolicy.IgnoreNew); }
registry.register(outputEnumName + FULL_JAVA_ENUM, pair.getSimpleForm()); registry.register(outputEnumName + FULL_JAVA_ENUM, pair.getSimpleForm());
parseState.addDefinition(outputEnumName + FULL_JAVA_ENUM, pair.getSimpleForm(), Definition.OverwritePolicy.IgnoreNew); parseState.addDefinition(outputEnumName + FULL_JAVA_ENUM, pair.getSimpleForm(), Definition.OverwritePolicy.IgnoreNew);
} }