Skip to content
Merged
Show file tree
Hide file tree
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 @@ -61,7 +61,7 @@ public byte[] authentication(@Nullable CharSequence password, byte[] salt, CharC

@Override
public MySqlAuthProvider next() {
return CachingSha2FullAuthProvider.INSTANCE;
return CachingSha2FullAuthProvider.getInstance();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
*/
final class CachingSha2FullAuthProvider implements MySqlAuthProvider {

static final CachingSha2FullAuthProvider INSTANCE = new CachingSha2FullAuthProvider();
static CachingSha2FullAuthProvider getInstance() {
return LazyHolder.INSTANCE;
}

@Override
public boolean isSslNecessary() {
Expand Down Expand Up @@ -60,4 +62,8 @@ public String getType() {
}

private CachingSha2FullAuthProvider() { }

private static class LazyHolder {
private static final CachingSha2FullAuthProvider INSTANCE = new CachingSha2FullAuthProvider();
}
}