String (Object... infos) { final Object value = infos[0]; if (value instanceof Exception exception) { final String message = exception.getMessage(); if (message != null) { return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.illegal", message); } return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.malformed"); } final FormatDecode.Validator[] validators = (FormatDecode.Validator[])value; final int argumentCount = ((Integer)infos[1]).intValue(); if (validators.length < argumentCount) { return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.too.many.arguments", argumentCount, validators.length); } if (validators.length > argumentCount) { final boolean isPrefix = ((Boolean)infos[2]).booleanValue(); if(isPrefix){ return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.at.least.too.few.arguments", argumentCount, validators.length); }else{ return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.too.few.arguments", argumentCount, validators.length); } } final PsiType argumentType = (PsiType)infos[2]; final FormatDecode.Validator validator = (FormatDecode.Validator)infos[3]; String specifier = validator.getInvalidSpecifier(argumentType); return InspectionGadgetsBundle.message("malformed.format.string.problem.descriptor.arguments.do.not.match.type", argumentType.getPresentableText(), specifier); }