Is this a method call or variable declaration ???
I am looking at some ksoap-2-android then I saw this
http://stackoverflow.com/questions/3...oid-with-https
Is this a method call or a variable declaration ?
private TrustManager[] trustAllCerts = new TrustManager[]{
}
private TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
Re: Is this a method call or variable declaration ???
Re: Is this a method call or variable declaration ???
Re: Is this a method call or variable declaration ???
My confusion is this:
private TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
Re: Is this a method call or variable declaration ???
ups I mean this:
private TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
How this should be understood ?
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
Re: Is this a method call or variable declaration ???
Code :
public java.security.cert.X509Certificate[] getAcceptedIssuers()
That looks like a method definition.
Your code would be more readable if you would Edit your post and wrap your code with[code=java]<YOUR CODE HERE>[/code] to get highlighting
Re: Is this a method call or variable declaration ???
Norm: it is not my code I am trying to understand
soap - KSOAP 2 Android with HTTPS - Stack Overflow
when you click on the link you will see this
private TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
I abosolutely don't understand and Array with so many method call, the is idea of doing this ?
Re: Is this a method call or variable declaration ???
TrustManager[] trustAllCerts = new TrustManager[]
That code defines an array named trustAllCerts of type TrustManager
If you had properly formatted the code you would see.
Code :
private TrustManager[] trustAllCerts = new TrustManager[]{ //define array
new X509TrustManager() { // Define a class as element in the array
// add methods to the class
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}
} // end of class
}; //end of array definition
Re: Is this a method call or variable declaration ???