Project

General

Profile

« Previous | Next » 

Revision 49711

fixed bug on resolver

View differences:

DLIResolvedObject.java
7 7
import eu.dnetlib.pid.resolver.model.*;
8 8
import org.apache.commons.lang3.StringEscapeUtils;
9 9
import org.apache.commons.lang3.StringUtils;
10
import org.apache.commons.logging.Log;
11
import org.apache.commons.logging.LogFactory;
10 12

  
11 13
import java.util.ArrayList;
12 14
import java.util.List;
......
16 18
 * The Class DLIObject.
17 19
 */
18 20
public class DLIResolvedObject extends AbstractResolvedObject {
21
	private static final Log log = LogFactory.getLog(DLIResolvedObject.class);
19 22

  
20 23
	/**
21 24
	 * The titles.
......
71 74
	 * Instantiates a new DLI object.
72 75
	 */
73 76

  
74

  
75 77
	private static final DLIResolvedObjectDeserializer deserializer = new DLIResolvedObjectDeserializer();
76 78

  
77 79
	public static DLIResolvedObject fromJson(final String json) {
78
		return new GsonBuilder().registerTypeAdapter(DLIResolvedObject.class,deserializer ).create().fromJson(json, DLIResolvedObject.class);
79

  
80
		try {
81
			return new GsonBuilder().registerTypeAdapter(DLIResolvedObject.class,deserializer ).create().fromJson(json, DLIResolvedObject.class);
82
		} catch (Throwable e) {
83
			log.error("ERROR on parsing "+json);
84
			return null;
85
		}
80 86
	}
81 87

  
82 88
	public DLIResolvedObject() {

Also available in: Unified diff