Maintain clean, professional code by removing development artifacts and improving readability:

  1. Remove debug code before committing:
    // Bad:
    System.out.println("Functrace on: " + funcTrace);
       
    // Bad:
    // ptrDataBuffer.closeBuffer();
    // if(pointer != null && !pointer.isNull())
    //     pointer.close();
       
    // If really necessary:
    // TODO: Re-enable this after fixing JIRA-1234
    // ptrDataBuffer.closeBuffer();
    
  2. Replace magic numbers with named constants:
    // Bad:
    if (edgeCount - lastEdgeCount > 10000) {
      // ...
    }
       
    // Good:
    private static final int EDGE_COUNT_REPORT_THRESHOLD = 10000;
       
    if (edgeCount - lastEdgeCount > EDGE_COUNT_REPORT_THRESHOLD) {
      // ...
    }
    
  3. Format precondition checks properly:
    // Bad:
    Preconditions.checkArgument(data >= 0,
            "Values for " + paramName + " must be >= 0, got: " + data);
       
    // Good:
    Preconditions.checkArgument(data >= 0, "Values for %s must be >= 0, got %s", paramName, data);
    
  4. Add private constructors to utility classes:
    // Good:
    public class ValidationUtils {
        private ValidationUtils() {
            // Private constructor to prevent instantiation
        }
           
        // Static utility methods...
    }