lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2285) Code cleanup from all sorts of (trivial) warnings
Date Sun, 28 Feb 2010 11:18:05 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839409#action_12839409
] 

Uwe Schindler commented on LUCENE-2285:
---------------------------------------

bq. I thought that it's not recommended to compile code w/ 1.5 and run it w/ 1.4, even if
the source level is 1.4. I remember a couple of issues with that, especially using Java 5.0
methods such as Class.getSimpleName() (I remember because I introduced these problems ). So
I'm not sure that I buy this argument ...

This affects code merged into the 2.9 branch. The release artifacts of Lucene 2.9 are compiled
with Java 1.5, as else some contribs would not compile (need 1.5). So we had to take care,
that we dont use methods from 1.5. This is tested by the release manager by a compile using
JDK 1.4 (core only). -- I did this.

The problem is now that in my above example without the cast when calling Character.toUpperCase
using an non-casted int, the rt.jar of javac leads the compiler to using the int version of
the method, even if it is not available in 1.4. By using a explicit cast we are fine here.
I tested this during my 2.9 release builds: I used the artifacts from the bin-zip and was
able to run the tests using JDK 1.4. When I remove some of the int -> char casts, it breaks.
Thats all. This is one reason why i prefer to be explicit about the invoked method. A commented
out cast would not help, so I am -1 on just adding casts as comment.

So please tell me a @SuppressWarnings that I can add to make your IDE happy.

> Code cleanup from all sorts of (trivial) warnings
> -------------------------------------------------
>
>                 Key: LUCENE-2285
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2285
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Shai Erera
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2285-remaining+generated.patch, LUCENE-2285-remaining.patch,
LUCENE-2285.patch, LUCENE-2285.patch, LUCENE-2285.patch
>
>
> I would like to do some code cleanup and remove all sorts of trivial warnings, like unnecessary
casts, problems w/ javadocs, unused variables, redundant null checks, unnecessary semicolon
etc. These are all very trivial and should not pose any problem.
> I'll create another issue for getting rid of deprecated code usage, like LuceneTestCase
and all sorts of deprecated constructors. That's also trivial because it only affects Lucene
code, but it's a different type of change.
> Another issue I'd like to create is about introducing more generics in the code, where
it's missing today - not changing existing API. There are many places in the code like that.
> So, with you permission, I'll start with the trivial ones first, and then move on to
the others.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message