Here you can find the source of calcCompileWarnings(String compilerResult)
private static int calcCompileWarnings(String compilerResult)
//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; } }