From 8b82b7ea32d53a5a520a2db784de90d3c8ea2360 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Sun, 19 Feb 2017 19:51:45 -0800 Subject: [PATCH] increase javac_filter line length limit to 2MB Some javac wrappers output the entire list of java files being compiled on a single line, which can be very large, set the maximum buffer size to 2MB. Test: pipe the grok build output through soong_javac_wrapper Change-Id: Ib208461dca02ced4959433b7695ec760dc134468 --- cmd/javac_filter/javac_filter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/javac_filter/javac_filter.go b/cmd/javac_filter/javac_filter.go index 32fcd6392..a089acd4f 100644 --- a/cmd/javac_filter/javac_filter.go +++ b/cmd/javac_filter/javac_filter.go @@ -54,6 +54,10 @@ func main() { func process(r io.Reader, w io.Writer) error { scanner := bufio.NewScanner(r) + // Some javac wrappers output the entire list of java files being + // compiled on a single line, which can be very large, set the maximum + // buffer size to 2MB. + scanner.Buffer(nil, 2*1024*1024) for scanner.Scan() { processLine(w, scanner.Text()) }