ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1170

Fix compiler (eclipse) warnings: unused imports, unused variables, missing generics

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Tags:
      cleanup, cleancode

      Description

      IDE warnings get useless if there are too many of them. This issue + patch fixes nearly the rest of them.

        Activity

        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1709/
        -----------------------------------------------------------

        Review request for zookeeper.

        Summary
        -------

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1709/ ----------------------------------------------------------- Review request for zookeeper. Summary -------
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12492794/ZOOKEEPER-1170.patch
        against trunk revision 1164632.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12492794/ZOOKEEPER-1170.patch against trunk revision 1164632. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/490//console This message is automatically generated.
        Hide
        Thomas Koch added a comment -

        The eclipse compiler can also be included in builds to just produce its warnings. But it would make sense to make the maven migration first before thinking about including it.

        See http://thecoderlounge.blogspot.com/2010/05/ecj-eclipse-java-compiler.html
        The maven info is

        <groupId>org.eclipse.jdt.core.compiler</groupId>
        <artifactId>ecj</artifactId>
        <version>3.7</version>

        And there's a plugin to show the warnings in jenkins: https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin

        Show
        Thomas Koch added a comment - The eclipse compiler can also be included in builds to just produce its warnings. But it would make sense to make the maven migration first before thinking about including it. See http://thecoderlounge.blogspot.com/2010/05/ecj-eclipse-java-compiler.html The maven info is <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>3.7</version> And there's a plugin to show the warnings in jenkins: https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin
        Hide
        Patrick Hunt added a comment -

        Thomas, consider tacking that onto ZOOKEEPER-1078, that patch will get some additional oversight as a result.

        Show
        Patrick Hunt added a comment - Thomas, consider tacking that onto ZOOKEEPER-1078 , that patch will get some additional oversight as a result.
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1709/#review1738
        -----------------------------------------------------------

        Ship it!

        lgtm

        • Patrick

        On 2011-09-02 19:43:36, Thomas Koch wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/1709/

        -----------------------------------------------------------

        (Updated 2011-09-02 19:43:36)

        Review request for zookeeper.

        Summary

        -------

        .

        This addresses bug ZOOKEEPER-1170.

        https://issues.apache.org/jira/browse/ZOOKEEPER-1170

        Diffs

        -----

        src/java/main/org/apache/jute/BinaryOutputArchive.java 213e203

        src/java/main/org/apache/jute/CsvInputArchive.java 3eb40ec

        src/java/main/org/apache/jute/CsvOutputArchive.java f6d60d8

        src/java/main/org/apache/jute/OutputArchive.java 4e084e8

        src/java/main/org/apache/jute/RecordReader.java 2977d3f

        src/java/main/org/apache/jute/RecordWriter.java 0adbd56

        src/java/main/org/apache/jute/XmlOutputArchive.java b65e9a0

        src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java 626da04

        src/java/main/org/apache/zookeeper/Environment.java 9a66743

        src/java/main/org/apache/zookeeper/MultiResponse.java 70f7623

        src/java/main/org/apache/zookeeper/MultiTransactionRecord.java 801969a

        src/java/main/org/apache/zookeeper/ServerAdminClient.java da17fcf

        src/java/main/org/apache/zookeeper/Shell.java 789c481

        src/java/main/org/apache/zookeeper/server/DataTree.java 0690ce9

        src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java b690817

        src/java/main/org/apache/zookeeper/server/LogFormatter.java cd1347d

        src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java 30ebf68

        src/java/main/org/apache/zookeeper/server/PurgeTxnLog.java 185c1e1

        src/java/main/org/apache/zookeeper/server/Request.java 80d2b99

        src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java c085bfb

        src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java 05d8431

        src/java/main/org/apache/zookeeper/server/quorum/AuthFastLeaderElection.java cac7140

        src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java a584adc

        src/java/main/org/apache/zookeeper/server/quorum/Follower.java ab3f288

        src/java/main/org/apache/zookeeper/server/quorum/Leader.java fb9dbde

        src/java/main/org/apache/zookeeper/server/quorum/LeaderElection.java 77c27e7

        src/java/main/org/apache/zookeeper/server/quorum/Observer.java ee61a90

        src/java/main/org/apache/zookeeper/server/quorum/ProposalRequestProcessor.java 17ca8fb

        src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 1b9c409

        src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 61f1f70

        src/java/main/org/apache/zookeeper/server/quorum/flexible/QuorumHierarchical.java d37881f

        src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java e3d0633

        src/java/main/org/apache/zookeeper/server/upgrade/UpgradeSnapShotV1.java aecc4d2

        Diff: https://reviews.apache.org/r/1709/diff

        Testing

        -------

        Thanks,

        Thomas

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1709/#review1738 ----------------------------------------------------------- Ship it! lgtm Patrick On 2011-09-02 19:43:36, Thomas Koch wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1709/ ----------------------------------------------------------- (Updated 2011-09-02 19:43:36) Review request for zookeeper. Summary ------- . This addresses bug ZOOKEEPER-1170 . https://issues.apache.org/jira/browse/ZOOKEEPER-1170 Diffs ----- src/java/main/org/apache/jute/BinaryOutputArchive.java 213e203 src/java/main/org/apache/jute/CsvInputArchive.java 3eb40ec src/java/main/org/apache/jute/CsvOutputArchive.java f6d60d8 src/java/main/org/apache/jute/OutputArchive.java 4e084e8 src/java/main/org/apache/jute/RecordReader.java 2977d3f src/java/main/org/apache/jute/RecordWriter.java 0adbd56 src/java/main/org/apache/jute/XmlOutputArchive.java b65e9a0 src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java 626da04 src/java/main/org/apache/zookeeper/Environment.java 9a66743 src/java/main/org/apache/zookeeper/MultiResponse.java 70f7623 src/java/main/org/apache/zookeeper/MultiTransactionRecord.java 801969a src/java/main/org/apache/zookeeper/ServerAdminClient.java da17fcf src/java/main/org/apache/zookeeper/Shell.java 789c481 src/java/main/org/apache/zookeeper/server/DataTree.java 0690ce9 src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java b690817 src/java/main/org/apache/zookeeper/server/LogFormatter.java cd1347d src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java 30ebf68 src/java/main/org/apache/zookeeper/server/PurgeTxnLog.java 185c1e1 src/java/main/org/apache/zookeeper/server/Request.java 80d2b99 src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java c085bfb src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java 05d8431 src/java/main/org/apache/zookeeper/server/quorum/AuthFastLeaderElection.java cac7140 src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java a584adc src/java/main/org/apache/zookeeper/server/quorum/Follower.java ab3f288 src/java/main/org/apache/zookeeper/server/quorum/Leader.java fb9dbde src/java/main/org/apache/zookeeper/server/quorum/LeaderElection.java 77c27e7 src/java/main/org/apache/zookeeper/server/quorum/Observer.java ee61a90 src/java/main/org/apache/zookeeper/server/quorum/ProposalRequestProcessor.java 17ca8fb src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 1b9c409 src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 61f1f70 src/java/main/org/apache/zookeeper/server/quorum/flexible/QuorumHierarchical.java d37881f src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java e3d0633 src/java/main/org/apache/zookeeper/server/upgrade/UpgradeSnapShotV1.java aecc4d2 Diff: https://reviews.apache.org/r/1709/diff Testing ------- Thanks, Thomas
        Hide
        Patrick Hunt added a comment -

        I think we can get this into 3.4.0, but I want to wait rather than possibly disrupt the blocker bug activity (4 PAs for blockers in 3.4.0 currently).

        Show
        Patrick Hunt added a comment - I think we can get this into 3.4.0, but I want to wait rather than possibly disrupt the blocker bug activity (4 PAs for blockers in 3.4.0 currently).
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1709/
        -----------------------------------------------------------

        (Updated 2011-09-14 22:18:42.184921)

        Review request for zookeeper.

        Summary (updated)
        -------

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1709/ ----------------------------------------------------------- (Updated 2011-09-14 22:18:42.184921) Review request for zookeeper. Summary (updated) -------
        Hide
        Patrick Hunt added a comment -

        Committed to trunk (3.5.0) thanks Thomas!

        Show
        Patrick Hunt added a comment - Committed to trunk (3.5.0) thanks Thomas!
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1304 (See https://builds.apache.org/job/ZooKeeper-trunk/1304/)
        ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports, unused variables, missing generics (Thomas Koch via phunt)

        phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170870
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/java/main/org/apache/jute/BinaryOutputArchive.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/CsvOutputArchive.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/OutputArchive.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/RecordReader.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/RecordWriter.java
        • /zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/Environment.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/MultiResponse.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/MultiTransactionRecord.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/ServerAdminClient.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/Shell.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/LogFormatter.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PurgeTxnLog.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/AuthFastLeaderElection.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderElection.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/ProposalRequestProcessor.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/flexible/QuorumHierarchical.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/UpgradeSnapShotV1.java
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1304 (See https://builds.apache.org/job/ZooKeeper-trunk/1304/ ) ZOOKEEPER-1170 . Fix compiler (eclipse) warnings: unused imports, unused variables, missing generics (Thomas Koch via phunt) phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170870 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/java/main/org/apache/jute/BinaryOutputArchive.java /zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java /zookeeper/trunk/src/java/main/org/apache/jute/CsvOutputArchive.java /zookeeper/trunk/src/java/main/org/apache/jute/OutputArchive.java /zookeeper/trunk/src/java/main/org/apache/jute/RecordReader.java /zookeeper/trunk/src/java/main/org/apache/jute/RecordWriter.java /zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/Environment.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/MultiResponse.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/MultiTransactionRecord.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/ServerAdminClient.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/Shell.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/LogFormatter.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PurgeTxnLog.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/AuthFastLeaderElection.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderElection.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/ProposalRequestProcessor.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/flexible/QuorumHierarchical.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/UpgradeSnapShotV1.java

          People

          • Assignee:
            Thomas Koch
            Reporter:
            Thomas Koch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development