fixed sonar findings
This commit is contained in:
@ -4,6 +4,7 @@ import java.net.Authenticator;
|
||||
import java.net.URL;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
@ -50,13 +51,13 @@ public class SPContext {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(
|
||||
java.security.cert.X509Certificate[] certs, String authType) {
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {
|
||||
// trust all SSLs, do not check
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(
|
||||
java.security.cert.X509Certificate[] certs, String authType) {
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {
|
||||
// trust all SSLs, do not check
|
||||
}
|
||||
}};
|
||||
// Install the all-trusting trust manager
|
||||
|
||||
@ -9,36 +9,14 @@ import java.util.Date;
|
||||
*/
|
||||
public class SPHelper {
|
||||
|
||||
private static final SimpleDateFormat dateOnlyFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// private static final SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||
|
||||
/* -- Format for Date Only Field -- */
|
||||
public static String toSPDate(Date d) {
|
||||
public static synchronized String toSPDate(Date d) {
|
||||
SimpleDateFormat dateOnlyFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (d == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String result;
|
||||
synchronized (dateOnlyFormat) {
|
||||
result = dateOnlyFormat.format(d);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/* -- Format for DateTime Field -- */
|
||||
/*
|
||||
private static String toSPDateAndTime(Date d) {
|
||||
if (d == null) {
|
||||
return "";
|
||||
}
|
||||
String result;
|
||||
|
||||
synchronized (dateTimeFormat) {
|
||||
result = dateTimeFormat.format(d);
|
||||
}
|
||||
return result;
|
||||
return dateOnlyFormat.format(d);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ public abstract class SPJaxbObject<T> extends AbstractSpJaxbObject {
|
||||
+ ":de.muehlencord.shared.sharepoint.api.usergroup"; //
|
||||
|
||||
/** the JAX-B context to use */
|
||||
private static JAXBContext jaxbContext = null;
|
||||
private static volatile JAXBContext jaxbContext = null;
|
||||
|
||||
/** the value object */
|
||||
protected T value;
|
||||
|
||||
@ -35,10 +35,8 @@ public class SPValidationEventHandler implements ValidationEventHandler {
|
||||
switch (event.getSeverity()) {
|
||||
case ValidationEvent.WARNING:
|
||||
return true; // continue after warinings
|
||||
case ValidationEvent.ERROR:
|
||||
return false; // terminate after errors
|
||||
case ValidationEvent.FATAL_ERROR:
|
||||
return false; // terminate after fatal errors
|
||||
case ValidationEvent.ERROR: // terminate after errors
|
||||
case ValidationEvent.FATAL_ERROR: // terminate after fatal errors
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -38,10 +38,8 @@ public class SPUser extends SPJaxbObject<User> {
|
||||
returnValue = getValue().login;
|
||||
}
|
||||
|
||||
if (returnValue == null) {
|
||||
return null;
|
||||
} else if (returnValue.equals("")) {
|
||||
return null;
|
||||
if ((returnValue == null) || (returnValue.equals (""))) {
|
||||
return null;
|
||||
} else {
|
||||
return returnValue.substring(7); // drop [i:0#.w|
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user