+1 Claus. I'm updating the JDK5 fix.
On Mon, Mar 26, 2012 at 4:59 AM, Claus Ibsen <[email protected]> wrote: > IOException has a initCause method or something like that, you use in > JDK5 or older, to set a nested exception. > Then you can make the code compatible with all JDK versions and still > nest exceptions. > > On Mon, Mar 26, 2012 at 5:58 AM, Andreas Pieber <[email protected]> wrote: >> maybe it's a good idea to log the real exception first? Otherwise >> we'll use the stacktrace of the original exception if only giving the >> message to the IO exception. >> >> Kind regards, >> Andreas >> >> On Thu, Mar 22, 2012 at 16:38, <[email protected]> wrote: >>> Author: jgoodyear >>> Date: Thu Mar 22 15:38:38 2012 >>> New Revision: 1303843 >>> >>> URL: http://svn.apache.org/viewvc?rev=1303843&view=rev >>> Log: >>> [KARAF-1279] IOExceptions used in an incompatible way with Java 5. >>> >>> Changing IOException call to IOException(String) signature. >>> >>> >>> Modified: >>> >>> karaf/branches/karaf-2.2.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java >>> >>> karaf/branches/karaf-2.2.x/shell/config/src/main/java/org/apache/karaf/shell/config/ConfigCommandSupport.java >>> >>> Modified: >>> karaf/branches/karaf-2.2.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java >>> URL: >>> http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java?rev=1303843&r1=1303842&r2=1303843&view=diff >>> ============================================================================== >>> --- >>> karaf/branches/karaf-2.2.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java >>> (original) >>> +++ >>> karaf/branches/karaf-2.2.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java >>> Thu Mar 22 15:38:38 2012 >>> @@ -187,7 +187,7 @@ public class ConfigMBeanImpl extends Sta >>> storageFile = new File(new URL((String) >>> val).toURI()); >>> } >>> } catch (Exception e) { >>> - throw new IOException(e); >>> + throw new IOException(e.getMessage()); >>> } >>> } >>> Properties p = new Properties(storageFile); >>> >>> Modified: >>> karaf/branches/karaf-2.2.x/shell/config/src/main/java/org/apache/karaf/shell/config/ConfigCommandSupport.java >>> URL: >>> http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/shell/config/src/main/java/org/apache/karaf/shell/config/ConfigCommandSupport.java?rev=1303843&r1=1303842&r2=1303843&view=diff >>> ============================================================================== >>> --- >>> karaf/branches/karaf-2.2.x/shell/config/src/main/java/org/apache/karaf/shell/config/ConfigCommandSupport.java >>> (original) >>> +++ >>> karaf/branches/karaf-2.2.x/shell/config/src/main/java/org/apache/karaf/shell/config/ConfigCommandSupport.java >>> Thu Mar 22 15:38:38 2012 >>> @@ -162,7 +162,7 @@ public abstract class ConfigCommandSuppo >>> storageFile = new File(new URL((String) val).toURI()); >>> } >>> } catch (Exception e) { >>> - throw new IOException(e); >>> + throw new IOException(e.getMessage()); >>> } >>> } >>> Properties p = new Properties(storageFile); >>> >>> > > > > -- > Claus Ibsen > ----------------- > CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com > FuseSource > Email: [email protected] > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/
