Skip to content

Commit 2bccd7c

Browse files
committed
Clean up Realm constructor parameters order
1 parent c487755 commit 2bccd7c

File tree

1 file changed

+43
-10
lines changed
  • client/src/main/java/org/asynchttpclient

1 file changed

+43
-10
lines changed

client/src/main/java/org/asynchttpclient/Realm.java

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
import org.asynchttpclient.util.StringUtils;
3232

3333
/**
34-
* This class is required when authentication is needed. The class support
35-
* DIGEST and BASIC.
34+
* This class is required when authentication is needed. The class support BASIC, DIGEST, NTLM, SPNEGO and KERBEROS.
3635
*/
3736
public class Realm {
3837

@@ -64,16 +63,33 @@ public enum AuthScheme {
6463
BASIC, DIGEST, NTLM, SPNEGO, KERBEROS;
6564
}
6665

67-
private Realm(AuthScheme scheme, String principal, String password, String realmName, String nonce, String algorithm, String response, String qop, String nc, String cnonce,
68-
Uri uri, String method, boolean usePreemptiveAuth, String ntlmDomain, Charset charset, String host, String opaque, boolean useAbsoluteURI, boolean omitQuery) {
66+
private Realm(AuthScheme scheme,//
67+
String principal,//
68+
String password,//
69+
String realmName,//
70+
String nonce,//
71+
String algorithm,//
72+
String response,//
73+
String opaque,//
74+
String qop,//
75+
String nc,//
76+
String cnonce,//
77+
Uri uri,//
78+
String methodName,//
79+
boolean usePreemptiveAuth,//
80+
Charset charset,//
81+
String ntlmDomain,//
82+
String ntlmHost,//
83+
boolean useAbsoluteURI,//
84+
boolean omitQuery) {
6985

7086
assertNotNull(scheme, "scheme");
7187
assertNotNull(principal, "principal");
7288
assertNotNull(password, "password");
7389

90+
this.scheme = scheme;
7491
this.principal = principal;
7592
this.password = password;
76-
this.scheme = scheme;
7793
this.realmName = realmName;
7894
this.nonce = nonce;
7995
this.algorithm = algorithm;
@@ -83,11 +99,11 @@ private Realm(AuthScheme scheme, String principal, String password, String realm
8399
this.nc = nc;
84100
this.cnonce = cnonce;
85101
this.uri = uri;
86-
this.methodName = method;
102+
this.methodName = methodName;
87103
this.usePreemptiveAuth = usePreemptiveAuth;
88-
this.ntlmDomain = ntlmDomain;
89-
this.ntlmHost = host;
90104
this.charset = charset;
105+
this.ntlmDomain = ntlmDomain;
106+
this.ntlmHost = ntlmHost;
91107
this.useAbsoluteURI = useAbsoluteURI;
92108
this.omitQuery = omitQuery;
93109
}
@@ -493,8 +509,25 @@ public Realm build() {
493509
newResponse(md);
494510
}
495511

496-
return new Realm(scheme, principal, password, realmName, nonce, algorithm, response, qop, nc, cnonce, uri, methodName, usePreemptive, ntlmDomain, charset, ntlmHost,
497-
opaque, useAbsoluteURI, omitQuery);
512+
return new Realm(scheme,//
513+
principal,//
514+
password,//
515+
realmName,//
516+
nonce, //
517+
algorithm, //
518+
response,//
519+
opaque, //
520+
qop, //
521+
nc, //
522+
cnonce, //
523+
uri, //
524+
methodName, //
525+
usePreemptive, //
526+
charset, //
527+
ntlmDomain,//
528+
ntlmHost, //
529+
useAbsoluteURI, //
530+
omitQuery);
498531
}
499532
}
500533
}

0 commit comments

Comments
 (0)