У меня следующая структура кода
Код: Выделить всё
public interface MqJMSException {
//....
}
public class MqJMSExceptionImpl extends JMSException implements MqJMSException {
//....
}
public interface MqMark {
MqMark receive(..,..) throws MqJMSException;
}
I'm trying to have a common type of exception(MqJMSException) abstracting away from which Implementation class the methods get invoked.
I tried making MqJMSException an abstract class but even that doesn't help in this case. I'm expecting that I only have one common type of exception which is MqJMSException and it can either be javax.jms.JMSException or jakarta.jms.JMSException.
Источник: https://stackoverflow.com/questions/781 ... t-be-a-sub