You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Darren Sargent (JIRA)" <ji...@apache.org> on 2013/03/08 20:52:14 UTC
[jira] [Created] (KAFKA-796) Kafka Scala classes should declare
thrown checked exceptions to be Java friendly
Darren Sargent created KAFKA-796:
------------------------------------
Summary: Kafka Scala classes should declare thrown checked exceptions to be Java friendly
Key: KAFKA-796
URL: https://issues.apache.org/jira/browse/KAFKA-796
Project: Kafka
Issue Type: Bug
Components: core
Reporter: Darren Sargent
Priority: Minor
For example, ConsumerIterator makeNext() method calls BlockingQueue.take() which declares it throws InterruptedException. However, since makeNext() fails to redeclare this exception, Java client code will be unable to catch it -- javac will complain that InterruptedException cannot be thrown.
Workaround - in the Java client code, catch Exception then check if instanceof InterruptedException and respond accordingly. But really the Scala method should redeclare checked exceptions for Java's benefit, even though it's not required for Scala since there are no checked exceptions.
There may be other classes where this needs to be done as well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira