geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PurelyApplied <...@git.apache.org>
Subject [GitHub] geode pull request #578: GEODE-1958: Removing/deprecating PasswordUtil
Date Tue, 13 Jun 2017 21:22:43 GMT
Github user PurelyApplied commented on a diff in the pull request:

    https://github.com/apache/geode/pull/578#discussion_r121798399
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/util/PasswordUtil.java ---
    @@ -44,72 +42,29 @@
       private static byte[] init = "string".getBytes();
     
       /**
    -   * Encrypts a password string
    -   * 
    -   * @param password String to be encrypted.
    -   * @return String encrypted String
    -   */
    -  public static String encrypt(String password) {
    -    return encrypt(password, true);
    -  }
    -
    -  /**
    -   * 
    -   * @param password String to be encrypted
    -   * @param echo if true prints result to system.out
    -   * @return String encrypted String
    +   * Decrypts an encrypted password string.
    +   *
    +   * @param password String to be decrypted
    +   * @return String decrypted String
        */
    -  public static String encrypt(String password, boolean echo) {
    -    String encryptedString = null;
    +  @Deprecated
    +  public static String decrypt(String password) {
    +    String toDecrypt;
    +    if (password.startsWith("encrypted(") && password.endsWith(")"))
    --- End diff --
    
    I don't think it gets caught by spotless, but officially we prefer to wrap every `if`
and `else` in curly braces, even when they're just one-liners.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message