Java Scanner Usage calcCompileWarnings(String compilerResult)

Here you can find the source of calcCompileWarnings(String compilerResult)

Description

calc Compile Warnings

License

Open Source License

Declaration

private static int calcCompileWarnings(String compilerResult) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Scanner;

public class Main {
    private static int calcCompileWarnings(String compilerResult) {
        int warnings = 0;
        Scanner scanner = new Scanner(compilerResult);
        while (scanner.hasNextLine()) {
            if (scanner.nextLine().contains("warning")) {
                warnings++;// w  ww .  j  av  a2 s .c  o m
            }
        }

        return warnings;
    }
}

Related

  1. asList(String source, String separator)
  2. cleanUpEmptyLinesAndIndent(String input)
  3. close()
  4. common(Scanner in)
  5. computeSumTable(Scanner in, short n)