Revision 47938
Added by Claudio Atzori almost 7 years ago
SarasvatiJobNode.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import javax.annotation.Resource; |
10 | 10 |
|
11 |
import com.google.gson.JsonSyntaxException; |
|
11 | 12 |
import org.apache.commons.logging.Log; |
12 | 13 |
import org.apache.commons.logging.LogFactory; |
13 | 14 |
import org.springframework.beans.factory.BeanNameAware; |
... | ... | |
96 | 97 |
|
97 | 98 |
@SuppressWarnings("unchecked") |
98 | 99 |
private Set<Map.Entry<?, ?>> asMapEntries(final String s) { |
99 |
return isSet(s) ? new Gson().fromJson(s, Map.class).entrySet() : new HashSet<Map.Entry<?, ?>>(); |
|
100 |
try { |
|
101 |
return isSet(s) ? new Gson().fromJson(s, Map.class).entrySet() : new HashSet<>(); |
|
102 |
} catch(JsonSyntaxException e) { |
|
103 |
log.error(String.format("invalid json: %s", s)); |
|
104 |
throw e; |
|
105 |
} |
|
100 | 106 |
} |
101 | 107 |
|
102 | 108 |
private boolean isSet(final String s) { |
Also available in: Unified diff
integrated latest changes from dnet40