From 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 15 Nov 2005 23:20:01 +0000 Subject: Imported GNU Classpath 0.19 + gcj-import-20051115. * sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/gnu/CORBA/Version.java | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'libjava/classpath/gnu/CORBA/Version.java') diff --git a/libjava/classpath/gnu/CORBA/Version.java b/libjava/classpath/gnu/CORBA/Version.java index 84f40bf4f39..efc27c22081 100644 --- a/libjava/classpath/gnu/CORBA/Version.java +++ b/libjava/classpath/gnu/CORBA/Version.java @@ -70,8 +70,8 @@ public class Version /** * Create the version with the given version numbers. * - * @param major major number (0..255) - * @param minor minor number (0..255) + * @param _major major number (0..255) + * @param _minor minor number (0..255) */ public Version(int _major, int _minor) { @@ -99,6 +99,15 @@ public class Version Version that = (Version) other; return same(that); } + + /** + * Get the hashcode, higher 8 bits being the major version and lower 8 bits + * the minor version. + */ + public int hashCode() + { + return major << 8 | minor; + } /** * Read from the input stream, major number first. @@ -114,7 +123,10 @@ public class Version } catch (IOException ex) { - throw new MARSHAL("IOException while reading message header"); + MARSHAL m = new MARSHAL("IOException while reading message header"); + m.initCause(ex); + m.minor = Minor.Header; + throw m; } } @@ -166,7 +178,7 @@ public class Version * Returs true if the given version is lower or equal to the * version, specified by the provided minor and major version * number. This means, the version, specified by these two numbers, - * should be supported by teh current version. + * should be supported by the current version. * * @param a_major a major version number. * @param a_minor a minor version number. @@ -200,7 +212,11 @@ public class Version } catch (IOException ex) { - throw new MARSHAL("IOException while writing message header"); + MARSHAL m = new MARSHAL("IOException while writing message header"); + m.minor = Minor.Header; + m.initCause(ex); + throw m; } } + } -- cgit v1.2.3