i am implementing a custom version of the java.util.Map interface.
my custom version does some encryption stuff when making modifications to
the map via one of the 4 modification methods (put, putAll, remove, and
clear).
in doing this, i would like to also use one of my own exception objects...
so these 4 methods in the custom version should now also be defined with:
throws EncryptionExcep tion
because EncryptionExcep tion is not a subclass of RuntimeExceptio n.
this is a good thing, as i need it to be caught for proper error checking,
so making EncryptionExcep tion a subclass of RuntimeExceptio n is not an
acceptable solution.
the problem is, when i try to compile i get the error that my custom
methods cannot implement the defined versions in java.util.Map because the
defined versions don't specify that EncryptionExcep tion is thrown.
is it just me, or does this seem like a fairly large limitation in java?
is there an elegant way around this?
thanks,
murat
--
Murat Tasan
mxt6@po.cwru.ed u
tasan@eecs.cwru .edu
murat.tasan@cwr u.edu
my custom version does some encryption stuff when making modifications to
the map via one of the 4 modification methods (put, putAll, remove, and
clear).
in doing this, i would like to also use one of my own exception objects...
so these 4 methods in the custom version should now also be defined with:
throws EncryptionExcep tion
because EncryptionExcep tion is not a subclass of RuntimeExceptio n.
this is a good thing, as i need it to be caught for proper error checking,
so making EncryptionExcep tion a subclass of RuntimeExceptio n is not an
acceptable solution.
the problem is, when i try to compile i get the error that my custom
methods cannot implement the defined versions in java.util.Map because the
defined versions don't specify that EncryptionExcep tion is thrown.
is it just me, or does this seem like a fairly large limitation in java?
is there an elegant way around this?
thanks,
murat
--
Murat Tasan
mxt6@po.cwru.ed u
tasan@eecs.cwru .edu
murat.tasan@cwr u.edu
Comment