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

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

I understood that, I just wanted to say that some warnings will reappear with 
my patch, because I removed lots of generated code. Thats all I wanted to say 
:-)

Sorry, I don't want to nitpick - this issue is somehow about different opinions 
on code style and warnings - e.g. i totally aggree with renaming private vars 
that hide protected ones and so on. I also want to fix generics (I am the 
"official generics police" *g*). But i simply want something in the code that 
explains the code better and prevents *future* errors, even if it is a cast too 
much. :-) I also applied the unused variable fixes, although in test I think 
its better to just add a "fake" local variable and place a 
@SupressWarning("unchecked") before it (you cannot apply this annotation to 
simple statements). So your compiler complains about unused variables - but how 
to fix that without placing the SuppressWarnings before the method? Which is 
bad, as I want to only place it before one code line. In TestVirtualMethod, I 
fixed this by splitting the bigger test method into two smaller ones, only one 
with SuppressWarnings. But I still prefer to assign to a local unused var to be 
able to place the annotation before (maybe thats a bug in Java5, that you 
cannot add annotations to single statements). Maybe do some "fake" operation on 
the variable like an assertion to mark it "used" *g*.

> 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.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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to