Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E12D09D1C for ; Mon, 3 Sep 2012 17:50:08 +0000 (UTC) Received: (qmail 31702 invoked by uid 500); 3 Sep 2012 17:50:07 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 31647 invoked by uid 500); 3 Sep 2012 17:50:07 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 31639 invoked by uid 99); 3 Sep 2012 17:50:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 17:50:07 +0000 Date: Tue, 4 Sep 2012 04:50:07 +1100 (NCT) From: "Uwe Schindler (JIRA)" To: dev@lucene.apache.org Message-ID: <1282176743.30886.1346694607733.JavaMail.jiratomcat@arcas> In-Reply-To: <1185898433.30098.1346673307649.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (LUCENE-4352) only the test runner should be able to System.exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-4352: ---------------------------------- Attachment: LUCENE-4352.patch Here is a quick patch thet prevents System.exit() with a dirty hack: - This installs a subclass of Java's original java.lang.SecurityManager, so the tests.policy file is still taken into account (see common-build.xml) - The method checkExit(int) was overridden to: # create a SecurityException, but don't throw (just to get the stack trace). # Inspect stack trace and saerch for System.exit (to walk over JVM-internal things) # The *next* element in the stack trace (important, no gaps inbetween) after System.exit() must be SlaveMain.main() from Junit4's ANT runner. If this stack element is found, checkExit() delegates to superclass (which will always pass without SecurityException) # If no valid stack trace element is found, checkExit() will finally throw the already instantiated SecurityException This patch works for me, but I need a list of all "valid" exit points with stack traces that can occur in Dawid's code. THIS IS A HACK, BUT WORKS! > only the test runner should be able to System.exit > -------------------------------------------------- > > Key: LUCENE-4352 > URL: https://issues.apache.org/jira/browse/LUCENE-4352 > Project: Lucene - Core > Issue Type: Bug > Reporter: Robert Muir > Attachments: LUCENE-4352.patch > > > All others should get SecurityException -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org