You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <qp...@incubator.apache.org> on 2008/10/09 12:40:44 UTC

[jira] Commented: (QPID-1329) ant compile fails

    [ https://issues.apache.org/jira/browse/QPID-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638251#action_12638251 ] 

Rob Godfrey commented on QPID-1329:
-----------------------------------

Hi Lahiru

Thanks for working on this...

a couple of comments on your commit r702745

Firstly, in your commit message, if you quote the full id of the jira (e.g. "resolving jira QPID-1329" rather than "resolving jira 1329".)  the commits are automatically picked up by the JIRA system and can be seen on the "Subversion Commits" tab on this screen.

Secondly can you ensure that any IDE you use is set to the coding standards for the project (which are not the same as the Sun Java coding standards - in particular our coding standard is for { to be on a new line not at the end of the previous line).  Unfortunately in your checkin it seems like you reformatted the entire file to use an incorrect style.  What I do is to always  review diffs before I checkin to make sure only the lines that I intended to change are actually changed.

Now, the actual underlying problem described by QPID-1329 is that there is a bug in the JDK1.5 compiler (which is fixed in 1.6).  The issue is that there is a class which uses generics for denoting the type of Exception thrown by some methods.  The idea being that in some cases this will be a checked Exception and in other cases a runtime exception.

The code compiles fine with JDK 1.6; or if you simply run the 1.5 compiler twice (!).

The real fix is probably to change how the code which is generating checked exception so that it no longer does so (the situation in which this occurs - being unable to retrieve message data from the message store - is probably unrecoverable anyway).  however this is not a small change and so I don't want to make it this close to the M4 freeze.

Simply catching the exceptions and then doing printStackTrace() is not really a good solution as all this does is hide the errors and lets the broker carry on processing unaware that an error has occurred.  We need the callers of these functions to be aware of the error, so we need to make sure the correct exception is thrown.

For the moment I would suggest that we rollback this change and live with the "compile twice or use JDK1.6" issue; and then fix properly for M5.

Let me know if you have any questions

-- Rob

> ant compile fails
> -----------------
>
>                 Key: QPID-1329
>                 URL: https://issues.apache.org/jira/browse/QPID-1329
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: M3
>         Environment: Ubuntu 8.04
>            Reporter: Lahiru Gunathilake
>            Assignee: Lahiru Gunathilake
>            Priority: Minor
>             Fix For: M3
>
>
> When I'm trying to compile using ant it gives me this error,
> compile:
>      [echo] Targeting : 1.5
>     [javac] Compiling 267 source files to /home/lahiru/qpid/java/build/broker/classes
>     [javac] /home/lahiru/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java:81: unreported exception java.lang.Exception; must be caught or declared to be thrown
>     [javac]             Object object = evaluate(message);
>     [javac]                                     ^
>     [javac] /home/lahiru/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java:216: unreported exception java.lang.Exception; must be caught or declared to be thrown
>     [javac]             Object rvalue = right.evaluate(message);
>     [javac]                                           ^
>     [javac] /home/lahiru/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java:251: unreported exception java.lang.Exception; must be caught or declared to be thrown
>     [javac]             Object rvalue = right.evaluate(message);
>     [javac]                                           ^
>     [javac] /home/lahiru/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java:321: unreported exception java.lang.Exception; must be caught or declared to be thrown
>     [javac]             Boolean lvalue = (Boolean) right.evaluate(message);
>     [javac]                                                      ^
>     [javac] /home/lahiru/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java:345: unreported exception java.lang.Exception; must be caught or declared to be thrown
>     [javac]             Object rvalue = right.evaluate(message);
>     [javac]                                           ^
>     [javac] Note: Some input files use or override a deprecated API.
>     [javac] Note: Recompile with -Xlint:deprecation for details.
>     [javac] Note: Some input files use unchecked or unsafe operations.
>     [javac] Note: Recompile with -Xlint:unchecked for details.
>     [javac] 5 errors

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.