static String generateIllegalInvocationString()

in dubbo-error-code-inspector/src/main/java/org/apache/dubbo/errorcode/reporter/impl/StringifyUtil.java [48:77]


    static String generateIllegalInvocationString(InspectionResult inspectionResult) {
        StringBuilder illegalInvocationReportStringBuilder = new StringBuilder();
        illegalInvocationReportStringBuilder.append("Illegal logger method invocations: ");
        illegalInvocationReportStringBuilder.append('\n');

        List<String> sortedFileNameKeys = new ArrayList<>(inspectionResult.getIllegalInvocations().keySet());
        sortedFileNameKeys.sort(FilePathComparator.getInstance());

        for (String key : sortedFileNameKeys) {

            illegalInvocationReportStringBuilder.append(FileUtils.getSourceFilePathFromClassFilePath(key));

            illegalInvocationReportStringBuilder.append(": ");
            illegalInvocationReportStringBuilder.append("\n");

            List<LoggerMethodInvocation> loggerMethodInvocations = inspectionResult.getInvalidLoggerMethodInvocationLocations().get(key);

            for (LoggerMethodInvocation mi : loggerMethodInvocations) {
                illegalInvocationReportStringBuilder.append("Line ");
                illegalInvocationReportStringBuilder.append(mi.getOccurredLines());
                illegalInvocationReportStringBuilder.append(": ");
                illegalInvocationReportStringBuilder.append(mi.getLoggerMethodInvocationCode());
                illegalInvocationReportStringBuilder.append('\n');
            }

            illegalInvocationReportStringBuilder.append('\n');
        }

        return illegalInvocationReportStringBuilder.toString();
    }