commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [compress] problems with 7z BCJ methods
Date Fri, 28 Feb 2014 19:00:48 GMT
On 28 February 2014 17:47, Stefan Bodewig <bodewig@apache.org> wrote:
> On 2014-02-28, sebb wrote:
>
>> Can Compress catch the specific Assertion Error and convert it to a
>> message that explains the issue?  Perhaps even provide a link to a
>> Wiki FAQ?
>
> not without catching all AssertionErrors
>
> java.lang.AssertionError: null
>      at org.tukaani.xz.SimpleInputStream.<init>(Unknown Source)
>      at org.tukaani.xz.X86Options.getInputStream(Unknown Source)
>      at org.apache.commons.compress.archivers.sevenz.Coders$BCJDecoder.decode(Coders.java:123)
>
>> Alternatively, can Compress detect the XZ version and refuse to run
>> BCJ, again with suitable message?
>
> No way short of parsing the OSGi attributes from the manifest.

The following seems to work for me in Eclipse at least:

String version = XZ.class.getPackage().getImplementationVersion();

Would need to allow for getPackage() returning null, but otherwise it
looks quite easy to use.

> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message