Decreasing DataSourceInfo verbosity

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Apr 08 2007 - 15:09:58 EDT

  • Next message: Michael Gentry: "Re: Decreasing DataSourceInfo verbosity"

    A question for Michael Gentry ...

    I am nitpicking here, but with the new password encoder feature, on
    startup Cayenne prints encoder class, password location and other
    related information. Would it be ok to make this output conditional
    on encoder class being not PlainTextPasswordEncoder per patch below?

    What do you think?

    Thanks
    Andrus

    Index: framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/
    cayenne/conn/DataSourceInfo.java
    ===================================================================
    --- framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/
    cayenne/conn/DataSourceInfo.java (revision 525813)
    +++ framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/
    cayenne/conn/DataSourceInfo.java (working copy)
    ..-23,6 +23,7 @@
    import java.io.Serializable;
    import org.apache.cayenne.conf.PasswordEncoding;
    +import org.apache.cayenne.conf.PlainTextPasswordEncoder;
    import org.apache.cayenne.util.Util;
    /**
    ..-133,16 +134,16 @@
                            .append("\n min. connections: ")
                            .append(minConnections)
                            .append("\n max. connections: ")
    - .append(maxConnections)
    - .append("\n encoder class: ")
    - .append(passwordEncoderClass)
    - .append("\n encoder salt: ")
    - .append(passwordEncoderSalt)
    - .append("\n password location: ")
    - .append(passwordLocation)
    - .append("\n password source: ")
    - .append(getPasswordSource())
    - .append("\n]");
    + .append(maxConnections);
    +
    + if (!PlainTextPasswordEncoder.class.getName().equals
    (this.passwordEncoderClass)) {
    + buf.append("\n encoder class: ").append
    (passwordEncoderClass).append(
    + "\n encoder salt: ").append
    (passwordEncoderSalt).append(
    + "\n password location: ").append
    (passwordLocation).append(
    + "\n password source: ").append
    (getPasswordSource());
    + }
    +
    + buf.append("\n]");
                    return buf.toString();
            }



    This archive was generated by hypermail 2.0.0 : Sun Apr 08 2007 - 15:10:44 EDT