Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add removed constructor to restore backward compatibility #22589

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ public final class AuthenticationInfo {
private final char[] password;

/**
* The only way to construct the instances of this class.
* @param user the user name for the connection
* @param password the clear text password for the connection
*/
public AuthenticationInfo(String user, String password) {
this(user, password.toCharArray());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 I've seen many recommendations to avoid using String for password passing, none in favour of it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is adding in a previously removed constructor which IntelliJ uses changing to char[] would again break IntelliJ. So the question is should we fix IntelliJ support or should IntelliJ fix the plugin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marc reported

From IntelliJ IDEA 2018.2.4 build 18 Sept. 2018, did NOT encounter the problem anymore.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is still reproducing with any version of IntelliJ IDEA. But backward compatibility was restored in Payara (payara/Payara#2328).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is still reproducing with any version of IntelliJ IDEA.

Yet Marc' comment for IDEA-194181 remains uncorrected.

But backward compatibility was restored in Payara (payara/Payara#2328).

IMO - it's bad idea to have this Ctor back just for testability. Should be fixed in Intelli-J or other clients.
It is class in com.sun package, and some, first example from @BalusC recommend:

It's preferable to not use those classes directly in your code as it would make your code tight coupled to the implementation.

Thus - developers shall follow changes in API used.

}

/**
* @param user the user name for the connection
* @param password the clear text password for the connection
*/
Expand Down