package org.domainrobot.adapter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * 
 * @author thomasproll
 * @copyright Copyright (C) 2017 InterNetX GmbH. All rights reserved.
 * @license MIT license; see LICENSE
 */
public class RFCDateTimeAdapter extends XmlAdapter<String, Date> {

	private final DateFormat df;

	private final Object lock = new Object();

	public RFCDateTimeAdapter() {
		df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
		df.setTimeZone(TimeZone.getTimeZone("UTC"));
	}

	@Override
	public Date unmarshal(String v) throws Exception {
		synchronized(lock) {
			return df.parse(v);
		}
	}

	@Override
	public String marshal(Date v) throws Exception {
		synchronized(lock) {
			return df.format(v);
		}
	}

}

@@ -680,32 +680,83 @@
 ows Exception %7B%0A
+%09%09if(v == null %7C%7C v.length() == 0)%0A%09%09%09return null;%0A
 %09%09synchronized(l
@@ -854,16 +854,48 @@
 ption %7B%0A
+%09%09if(v == null)%0A%09%09%09return null;%0A
 %09%09synchr

Update RFCDateTimeAdapter.java