/*
* default value if property is not specified
+ * (selected VCF/VEP terms which have 'categorical' value ranges)
*/
private static final String CACHED_ATTS_DEFAULT = "AS_FilterStatus,clinical_significance,consequence_type,"
+ "CSQ:Consequence,CSQ:CLIN_SIG,CSQ:DOMAIN,CSQ:IMPACT";
*/
private static final String TERM_DELIMITERS = ",&";
+ /*
+ * defensive limit to number of attribute values cached per attribute
+ */
+ private static final int MAX_ATT_VALS = 30;
+
private static FeatureAttributes instance = new FeatureAttributes();
/*
{
terms = new HashSet<>();
}
+ int count = terms.size();
StringTokenizer st = new StringTokenizer(value, TERM_DELIMITERS);
- while (st.hasMoreTokens())
+ while (st.hasMoreTokens() && count < MAX_ATT_VALS)
{
terms.add(st.nextToken().trim());
+ count++;
}
}
*/
public static List<Pattern> getFieldMatchers(String key, String def)
{
- String pref = Cache.getDefault(key, def);
+ String pref = def;
+ try
+ {
+ // temporary for applet: handle class loading errors...
+ pref = Cache.getDefault(key, def);
+ } catch (Throwable t)
+ {
+ }
List<Pattern> patterns = new ArrayList<>();
String[] tokens = pref.split(",");
for (String token : tokens)