commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt (JIRA)" <j...@apache.org>
Subject [jira] Closed: (COMPRESS-29) Closing an CBZip2OutputStream when no data has been written fails with an java.lang.ArithmeticException: / by zero
Date Tue, 13 Apr 2010 20:43:53 GMT

     [ https://issues.apache.org/jira/browse/COMPRESS-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Torsten Curdt closed COMPRESS-29.
---------------------------------


> Closing an CBZip2OutputStream when no data has been written fails with an java.lang.ArithmeticException:
/ by zero
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-29
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-29
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Stefan Liebig
>            Assignee: Torsten Curdt
>            Priority: Critical
>             Fix For: 1.0
>
>         Attachments: patch-update-bzip2.txt
>
>
> The following test case reproduces the error:
> public class CBZip2OutputStreamTest extends TestCase {
> 	/**
> 	 * @throws IOException
> 	 */
> 	public void testEmtpyOutput() throws IOException {
> 		CBZip2OutputStream outputStream = new CBZip2OutputStream( new ByteArrayOutputStream()
);
> 		outputStream.close();
> 	}
> }
> fails with:
> java.lang.ArithmeticException: / by zero
> 	at org.apache.tools.bzip2.CBZip2OutputStream.mainSort(CBZip2OutputStream.java:1174)
> 	at org.apache.tools.bzip2.CBZip2OutputStream.doReversibleTransformation(CBZip2OutputStream.java:1386)
> 	at org.apache.tools.bzip2.CBZip2OutputStream.endBlock(CBZip2OutputStream.java:476)
> 	at org.apache.tools.bzip2.CBZip2OutputStream.close(CBZip2OutputStream.java:427)
> 	at CBZip2OutputStreamTest.testEmtpyOutput(CBZip2OutputStreamTest.java:23)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message