diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lombok/core/LombokConfiguration.java | 54 |
1 files changed, 6 insertions, 48 deletions
diff --git a/src/core/lombok/core/LombokConfiguration.java b/src/core/lombok/core/LombokConfiguration.java index 40c4a67c..0c391bf4 100644 --- a/src/core/lombok/core/LombokConfiguration.java +++ b/src/core/lombok/core/LombokConfiguration.java @@ -21,62 +21,20 @@ */ package lombok.core; -import java.util.List; - -import javax.lang.model.SourceVersion; - +import lombok.core.configuration.BubblingConfigurationResolver; +import lombok.core.configuration.ConfigurationErrorReporterFactory; import lombok.core.configuration.ConfigurationKey; +import lombok.core.configuration.FileSystemSourceCache; public class LombokConfiguration { + private static FileSystemSourceCache cache = new FileSystemSourceCache(); + private LombokConfiguration() { // prevent instantiation } - static <T> T read(ConfigurationKey<T> key, AST<?, ?, ?> ast) { -// if (key.keyName.equals("lombok.log.varName")) return (T)"loggertje"; -// if (key.keyName.equals("lombok.log.static")) return (T)Boolean.FALSE; - return null; - } - - @SuppressWarnings("rawtypes") - public static void main(String[] args) { - try { new ConfigurationKey<List<String>>("List<String>") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Integer>("Integer") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Class<?>>("Class<?>") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<SourceVersion>("SourceVersion") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Class>("Class") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Class<Number>>("Class<Number>") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Class<? extends Number>>("Class<? extends Number>") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Class<? super String>>("Class<? super String>") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Number>("Number") {}; } catch (Exception e) { e.printStackTrace();} - try { class Between extends ConfigurationKey<String> { - public Between() { - super("between"); - } - }; - new Between(){}; - } catch (Exception e) { e.printStackTrace();} - - try { new ConfigurationKey<String>("more than once") {}; } catch (Exception e) { e.printStackTrace();} - try { new ConfigurationKey<Integer>("more than once") {}; } catch (Exception e) { e.printStackTrace();} - - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - - ConfigurationKey<?> first = null; - try { first = new ConfigurationKey<Integer>("anint") {}; } catch (Exception e) { e.printStackTrace();} - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - - ConfigurationKey<?> second = null; - try { second = new ConfigurationKey<Integer>("anint") {}; } catch (Exception e) { e.printStackTrace();} - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - System.out.println(System.identityHashCode(ConfigurationKey.registeredKeys())); - - System.out.println(first == second); - System.out.println(first.getClass() == second.getClass()); - System.out.println(first.equals(second)); + return new BubblingConfigurationResolver(cache.sourcesForJavaFile(ast.getAbsoluteFileLocation(), ConfigurationErrorReporterFactory.CONSOLE)).resolve(key); } } |