Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-383

Lots of warnings in Java generated code.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Auto Closed
    • None
    • None
    • Java - Compiler
    • None

    Description

      I'm using Thrift from 03/19/09, commit 87e73b073889fec8d105cbf3b66bcbf48b4e71e2

      Looking through some Thrift generated Java code for an HBase server under Eclipse I see a lot of warnings. I'll attach the thrift IDL separately. I can also post some of my Eclipse settings to see all these warnings if need be.

      There's many occurances of these types of warnings. Here's some examples:

      • The import java.util.ArrayList is never used
      • The serializable class AlreadyExists does not declare a static final serialVersionUID field of type long
      • Redundant superinterface Serializable for the type AlreadyExists, already defined by Throwable
      • The field AlreadyExists.__isset is never read locally
      • The method getMessage() of type AlreadyExists should be tagged with @Override since it actually overrides a superclass method
      • The local variable first is never read
      • The declared exception TException is not actually thrown by the method validate() from type AlreadyExists
      • Duplicate javadoc tags
      • Access to enclosing constructor AlreadyExists.Isset() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance
      • FindBugs: [H C DMI] Invocation of toString on an array [DMI_INVOKING_TOSTRING_ON_ARRAY]
      • FindBugs: [M P Bx] Method invokes inefficient Number constructor; use static valueOf instead [DM_NUMBER_CTOR]
      • FindBugs: [M B CN] clone method does not call super.clone() [CN_IDIOM_NO_SUPER_CALL]

      The second batch is particularly important because it has potential performance issues. The first batch are would be nice to fix things.

      Attachments

        1. Hbase.thrift
          17 kB
          Nitay Joffe
        2. THRIFT-383.diff
          4 kB
          Cees de Groot

        Issue Links

          Activity

            People

              jking3 James E. King III
              nitay Nitay Joffe
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: