[jira] Created: (LUCENE-507) CLONE -[PATCH] remove unused variables

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
CLONE -[PATCH] remove unused variables
--------------------------------------

         Key: LUCENE-507
         URL: http://issues.apache.org/jira/browse/LUCENE-507
     Project: Lucene - Java
        Type: Improvement
  Components: Search  
    Versions: unspecified    
 Environment: Operating System: other
Platform: Other
    Reporter: Steven Tamm
 Assigned to: Lucene Developers
    Priority: Minor


Seems I'm the only person who has the "unused variable" warning turned on in
Eclipse :-) This patch removes those unused variables and imports (for now
only in the "search" package). This doesn't introduce changes in
functionality, but it should be reviewed anyway: there might be cases where
the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
    [ http://issues.apache.org/jira/browse/LUCENE-507?page=comments#action_12368403 ]

Steven Tamm commented on LUCENE-507:
------------------------------------

In Lucene 1.9, there are a lot of local variable and unused import warnings.

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor

>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
    [ http://issues.apache.org/jira/browse/LUCENE-507?page=comments#action_12369101 ]

Otis Gospodnetic commented on LUCENE-507:
-----------------------------------------

I haven't looked at the patch, but I know that I've removed unused imports before and got burnt, because classes in imports were referenced from javadoc.... so something to keep in mind.

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor

>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
    [ http://issues.apache.org/jira/browse/LUCENE-507?page=comments#action_12369106 ]

Steven Tamm commented on LUCENE-507:
------------------------------------

I haven't included a patch, although I can generate one easily.

As a matter of course, javadoc references that aren't included in an import shouldn't be qualified.  I'll turn off javadoc processing in eclipse and fix any bad javadoc references.

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor

>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
     [ http://issues.apache.org/jira/browse/LUCENE-507?page=all ]

Steven Tamm updated LUCENE-507:
-------------------------------

    Attachment: Unused.patch

This fixes unnecessary casts, unused imports, unused private methods, and unused private variables.  Most of the changes were in the JavaCC grammar files, which usually happens, so you can't really fix it.  In java1.5, I'd normally just add @SuppressWarnings("unused"), but I ifgure that wouldn't solve it.

I only fixed demo, tools, and src.  There's one problem import that said it was required for GCJ, which i think I fixed by changing the inner class references to be explicit.

Javadoc compiles with warnings only in contrib.

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor
>  Attachments: Unused.patch
>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
    [ http://issues.apache.org/jira/browse/LUCENE-507?page=comments#action_12369262 ]

Doug Cutting commented on LUCENE-507:
-------------------------------------

I don't see the point in patching code that's automatically generated by JavaCC.  It will just get overwritten the next time someone changes the grammer, no?

Also, GCJ-related changes are best verified.  Andi?

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor
>  Attachments: Unused.patch
>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-507) CLONE -[PATCH] remove unused variables

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
    [ http://issues.apache.org/jira/browse/LUCENE-507?page=comments#action_12376874 ]

Andi Vajda commented on LUCENE-507:
-----------------------------------

My apologies, I didn't notice this until it was mentioned today.

The "//required by gcj" comment is not something I added or need.
The few patches for gcj support that were added at my request are listed as such in the Lucene sources. The main one has to do with gcj's bug 15411 in Searcher.java, the other with naming a method 'delete'.
In general, it is easier to use javac or jikes to compile the .java sources to .class files and then use gcj on the resulting .class (or .jar) files to produce native binaries. Thus, one runs around a number of bugs in the gcj java compiler front-end.
Still, there are some patches I need to apply to Lucene in order for it to run when compiled with gcj. Some are in QueryParser.java and the first of those could be applied to the actual .jj file instead, see here: http://svn.osafoundation.org/pylucene/trunk/patches.lucene

The next patches in the file above are because of limitations in gcjh (the Java to C++ header file generator) or because exception catching doesn't seem to work well with gcj on Windows. Throwing and catching exceptions in Java is not such an efficient coding practice when there isn't an actual error, maybe the code in FieldInfos.java could be changed then (see patch file above) ?
As for the last patch, well, the java runtime that comes with gcj 3.x doesn't implement regex, so PyLucene calls into python's regex support instead.

> CLONE -[PATCH] remove unused variables
> --------------------------------------
>
>          Key: LUCENE-507
>          URL: http://issues.apache.org/jira/browse/LUCENE-507
>      Project: Lucene - Java
>         Type: Improvement

>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Steven Tamm
>     Assignee: Lucene Developers
>     Priority: Minor
>  Attachments: Unused.patch
>
> Seems I'm the only person who has the "unused variable" warning turned on in
> Eclipse :-) This patch removes those unused variables and imports (for now
> only in the "search" package). This doesn't introduce changes in
> functionality, but it should be reviewed anyway: there might be cases where
> the variables *should* be used, but they are not because of a bug.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]