From patchwork Tue Jan 28 18:13:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: frobware X-Patchwork-Id: 23808 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F6D0202B2 for ; Tue, 28 Jan 2014 18:13:31 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf2486659oag.8 for ; Tue, 28 Jan 2014 10:13:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :user-agent:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=g6LhbYqv53hrAY7CwBcKxlSyHkmoF10CZKEzAfsPkQg=; b=BhyL0+4+aYDaELzvEjg59u0iBtX2m6iGLVHvp3u1D4CI4mwTsMd2n+HiDrnlxh21Mj S1gxxukQx4+oDYR/O9L2EteI5Z0mwj6hkfumZJ5rRQO1bagqHOZQgFWlnEzjHtkdZsTC pJFZEy/QbBYDXYy4W5KZhk1J1C2BthZ7JDYpSXesSqBHnE1tuUqWG1mBK00cwFZkqCFU D+Lij2xs/Ejm0EWNw5c8JeiwVobfbIn3/3X5vv3juA4tn5+YIedILW3sqSOFetIGb0M1 DUk7nRP213JL5wwag0sbs44SoTscnOwWOgBh9P6thCjjz/EXYTtSxmcjuhyO/cq6xOO2 VPDA== X-Gm-Message-State: ALoCoQmQ9faTB4xb8v2lgfE8h8cco64tuYieKzVvsx3pQcawjVlDj5ajvgFBygzkENcswK6Sek50 X-Received: by 10.182.151.42 with SMTP id un10mr1083549obb.12.1390932810394; Tue, 28 Jan 2014 10:13:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.113 with SMTP id p104ls1894012qga.41.gmail; Tue, 28 Jan 2014 10:13:30 -0800 (PST) X-Received: by 10.53.13.44 with SMTP id ev12mr1776631vdd.17.1390932810289; Tue, 28 Jan 2014 10:13:30 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id kl10si871031vdb.142.2014.01.28.10.13.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 10:13:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ie18so487473vcb.12 for ; Tue, 28 Jan 2014 10:13:30 -0800 (PST) X-Received: by 10.52.30.167 with SMTP id t7mr48688vdh.36.1390932810143; Tue, 28 Jan 2014 10:13:30 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp51124vcz; Tue, 28 Jan 2014 10:13:29 -0800 (PST) X-Received: by 10.181.12.20 with SMTP id em20mr2947301wid.0.1390932809112; Tue, 28 Jan 2014 10:13:29 -0800 (PST) Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by mx.google.com with ESMTPS id hl1si4370014wjb.19.2014.01.28.10.13.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 10:13:29 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.54 is neither permitted nor denied by best guess record for domain of andrew.mcdermott@linaro.org) client-ip=74.125.82.54; Received: by mail-wg0-f54.google.com with SMTP id x13so1520914wgg.9 for ; Tue, 28 Jan 2014 10:13:28 -0800 (PST) X-Received: by 10.180.100.70 with SMTP id ew6mr2799577wib.57.1390932808505; Tue, 28 Jan 2014 10:13:28 -0800 (PST) Received: from localhost (host86-152-244-234.range86-152.btcentralplus.com. [86.152.244.234]) by mx.google.com with ESMTPSA id y13sm34507351wjr.8.2014.01.28.10.13.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 28 Jan 2014 10:13:27 -0800 (PST) From: Andrew McDermott To: jtreg-dev-request@openjdk.java.net, patches@linaro.org Subject: [PATCH] jtreg: handle StringIndexOutOfBoundsException when parsing summary.txt Date: Tue, 28 Jan 2014 18:13:23 +0000 Message-ID: <87zjmgnfek.fsf@spicy.frobware.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: andrew.mcdermott@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , # HG changeset patch # User Andrew McDermott # Date 1390932496 0 # Node ID 2f0c51ac5a7313e2199c412e02e0532627409ea3 # Parent e08a5e0b79ba57743222bbea19c0bdb142968769 jtreg: handle StringIndexOutOfBoundsException when parsing summary.txt Handle a case where a badly formatted summary.txt causes a StringIndexOutOfBoundsException to be generated. This can happen when the format in the summary.txt file has additional lines of output from a failed test. A real-world example is as follows: runtime/8026365/InvokeSpecialAnonTest.java Passed. Execution successful runtime/8026394/InterfaceObjectTest.java Passed. Execution successful runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java Passed. Execution successful runtime/ClassFile/JsrRewriting.java Failed. Execution failed: `main' [...elided...] java.lang.LinkageError java.lang.NoSuchMethodError Main method not found in class OOMCrashClass4000_1 runtime/ClassFile/OomWhileParsingRepeatedJsr.java Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'Cannot reserve enough memory' missing from stdout/stderr runtime/ClassUnload/KeepAliveClass.java Passed. Execution successful runtime/ClassUnload/KeepAliveClassLoader.java Passed. Execution successful diff --git a/src/share/classes/com/sun/javatest/diff/Diff.java b/src/share/classes/com/sun/javatest/diff/Diff.java --- a/src/share/classes/com/sun/javatest/diff/Diff.java +++ b/src/share/classes/com/sun/javatest/diff/Diff.java @@ -75,7 +75,9 @@ int[] counts = new int[Status.NUM_STATES]; for (TestResult tr: r) { table.addRow(index, tr.getTestName(), tr); - counts[tr.getStatus().getType()]++; + if (tr.getStatus() != null) { + counts[tr.getStatus().getType()]++; + } } testCounts.add(counts); } diff --git a/src/share/classes/com/sun/javatest/diff/ReportReader.java b/src/share/classes/com/sun/javatest/diff/ReportReader.java --- a/src/share/classes/com/sun/javatest/diff/ReportReader.java +++ b/src/share/classes/com/sun/javatest/diff/ReportReader.java @@ -105,8 +105,8 @@ String line; while ((line = in.readLine()) != null) { int sp = line.indexOf(' '); - String t = line.substring(0, sp); - Status s = Status.parse(line.substring(sp).trim()); + String t = line.substring(0, sp == -1 ? line.length() : sp); + Status s = Status.parse(line.substring(sp == -1 ? line.length() : sp).trim()); TestDescription td = new TestDescription(root, new File(t), Collections.emptyMap()); TestResult tr = new TestResult(td, s); list.add(tr);