Ignore:
Timestamp:
2013-08-09T18:05:11+02:00 (12 years ago)
Author:
bastiK
Message:

applied #8895 - Upgrade metadata-extractor to v. 2.6.4 (patch by ebourg)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/lang/CompoundException.java

    r4231 r6127  
    11/*
    2  * This is public domain software - that is, you can do whatever you want
    3  * with it, and include it software that is licensed under the GNU or the
    4  * BSD license, or whatever other licence you choose, including proprietary
    5  * closed source licenses.  I do ask that you leave this header in tact.
     2 * Copyright 2002-2012 Drew Noakes
    63 *
    7  * If you make modifications to this code that you think would benefit the
    8  * wider community, please send me a copy and I'll post it on my site.
     4 *    Licensed under the Apache License, Version 2.0 (the "License");
     5 *    you may not use this file except in compliance with the License.
     6 *    You may obtain a copy of the License at
    97 *
    10  * If you make use of this code, I'd appreciate hearing about it.
    11  *   drew@drewnoakes.com
    12  * Latest version of this software kept at
    13  *   http://drewnoakes.com/
     8 *        http://www.apache.org/licenses/LICENSE-2.0
     9 *
     10 *    Unless required by applicable law or agreed to in writing, software
     11 *    distributed under the License is distributed on an "AS IS" BASIS,
     12 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 *    See the License for the specific language governing permissions and
     14 *    limitations under the License.
     15 *
     16 * More information about this project is available at:
     17 *
     18 *    http://drewnoakes.com/code/exif/
     19 *    http://code.google.com/p/metadata-extractor/
    1420 */
    1521package com.drew.lang;
     22
     23import com.drew.lang.annotations.NotNull;
     24import com.drew.lang.annotations.Nullable;
    1625
    1726import java.io.PrintStream;
     
    2231 * unavailable in previous versions.  This class allows support
    2332 * of these previous JDK versions.
     33 *
     34 * @author Drew Noakes http://drewnoakes.com
    2435 */
    2536public class CompoundException extends Exception
    2637{
    27     private final Throwable _innnerException;
     38    private static final long serialVersionUID = -9207883813472069925L;
    2839
    29     public CompoundException(String msg)
     40    @Nullable
     41    private final Throwable _innerException;
     42
     43    public CompoundException(@Nullable String msg)
    3044    {
    3145        this(msg, null);
    3246    }
    3347
    34     public CompoundException(Throwable exception)
     48    public CompoundException(@Nullable Throwable exception)
    3549    {
    3650        this(null, exception);
    3751    }
    3852
    39     public CompoundException(String msg, Throwable innerException)
     53    public CompoundException(@Nullable String msg, @Nullable Throwable innerException)
    4054    {
    4155        super(msg);
    42         _innnerException = innerException;
     56        _innerException = innerException;
    4357    }
    4458
     59    @Nullable
    4560    public Throwable getInnerException()
    4661    {
    47         return _innnerException;
     62        return _innerException;
    4863    }
    4964
     65    @NotNull
    5066    public String toString()
    5167    {
    52         StringBuffer sbuffer = new StringBuffer();
    53         sbuffer.append(super.toString());
    54         if (_innnerException != null) {
    55             sbuffer.append("\n");
    56             sbuffer.append("--- inner exception ---");
    57             sbuffer.append("\n");
    58             sbuffer.append(_innnerException.toString());
     68        StringBuilder string = new StringBuilder();
     69        string.append(super.toString());
     70        if (_innerException != null) {
     71            string.append("\n");
     72            string.append("--- inner exception ---");
     73            string.append("\n");
     74            string.append(_innerException.toString());
    5975        }
    60         return sbuffer.toString();
     76        return string.toString();
    6177    }
    6278
    63     public void printStackTrace(PrintStream s)
     79    public void printStackTrace(@NotNull PrintStream s)
    6480    {
    6581        super.printStackTrace(s);
    66         if (_innnerException != null) {
     82        if (_innerException != null) {
    6783            s.println("--- inner exception ---");
    68             _innnerException.printStackTrace(s);
     84            _innerException.printStackTrace(s);
    6985        }
    7086    }
    7187
    72     public void printStackTrace(PrintWriter s)
     88    public void printStackTrace(@NotNull PrintWriter s)
    7389    {
    7490        super.printStackTrace(s);
    75         if (_innnerException != null) {
     91        if (_innerException != null) {
    7692            s.println("--- inner exception ---");
    77             _innnerException.printStackTrace(s);
     93            _innerException.printStackTrace(s);
    7894        }
    7995    }
     
    8298    {
    8399        super.printStackTrace();
    84         if (_innnerException != null) {
     100        if (_innerException != null) {
    85101            System.err.println("--- inner exception ---");
    86             _innnerException.printStackTrace();
     102            _innerException.printStackTrace();
    87103        }
    88104    }
Note: See TracChangeset for help on using the changeset viewer.