commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: byte b = 'a'; not allowed
Date Sat, 05 Jan 2002 04:22:51 GMT
On Fri, Jan 04, 2002 at 07:53:28PM -0800, otisg@ivillage.com wrote:
> Interesting, I never saw this, even though I used jikes (1.15).

Ah.. when I try to "exploit" the bug with an 8-bit character, javac throws an
error:

Test.java:3: possible loss of precision
found   : char
required: byte
                byte x = '';
                         ^
1 error

So it looks like it's my old version of jikes (1.13). I'll upgrade and try
again. 

> However, I do get this warning below.  It is just a warning, but...
> 
> 
> compile:
>     [javac] Compiling 29 source files to /home/otis/cvs-repositories/jakarta/jakarta-commons/httpclient/target/classes
>     [javac] 
>     [javac] Issued 1 semantic warning compiling "/home/otis/cvs-repositories/jakarta/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/log/SimpleLog.java":
>     [javac] 
>     [javac]    103.         } catch(Throwable t) {
>     [javac]                         <--------->
>     [javac] *** Caution: This try block cannot throw a "checked exception" (JLS section
14.7) that can be caught here. You may have intended to catch a RuntimeException instead of
an Exception.
>      [copy] Copying 3 files to /home/otis/cvs-repositories/jakarta/jakarta-commons/httpclient/target/classes

Yes, that's from a block of code:

       try {
        } catch(Throwable t) {
            // ignored
        }

Looks like the "try {" is misplaced. 


--Jeff

> BUILD SUCCESSFUL
> 
> 
> Otis
> 
> 

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message