package com.google.sitebricks.options;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.sitebricks.conversion.MvelTypeConverter;
import com.google.sitebricks.conversion.TypeConverter;

import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * Hacky wrapper of MvelTypeConverter to support sets.
 *
 * @author jochen@pedesis.org (Jochen Bekmann)
 */
public class OptionTypeConverter implements TypeConverter {
  @Inject
  MvelTypeConverter converter;

  @Override
  @SuppressWarnings("unchecked")
  public <T> T convert(Object source, Type type) {
    if (Set.class == type && String.class == source.getClass()) {
      Set<String> set = Sets.newHashSet();
      for (String s : ((String) source).split(","))
        set.add(s.trim());
      return (T) set;
    }
    return converter.convert(source, type);
  }
}

@@ -44,40 +44,54 @@
 ort 
-com.google.common.collect.Lists;
+java.lang.reflect.Type;%0Aimport java.util.Set;%0A
 %0Aimp
@@ -278,113 +278,8 @@
 r;%0A%0A
-import java.lang.reflect.Type;%0Aimport java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 /**%0A
@@ -811,16 +811,20 @@
   return
+ (T)
  convert

Fix compilation issue due to bug in 'old' jdk 'Inference fails for type variable return constraint'