// Path: src/main/java/info/gianlucacosta/easypmd/system/SystemPropertiesService.java
// public interface SystemPropertiesService {
// 
//     String getJavaVersion();
// 
//     Path getUserHomeDirectory();
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/ide/Injector.java
// public class Injector {
// 
//     @ServiceProvider(service = TestService.class)
//     public static class TestService {
//     }
// 
//     private static final Lookup lookup = Lookup.getDefault();
// 
//     private static Lookup getLookup() {
//         return lookup;
//     }
// 
//     public static <T> T lookup(Class<T> serviceClass) {
//         T result = getLookup().lookup(serviceClass);
// 
//         validateLookupResult(serviceClass, result);
// 
//         return result;
//     }
// 
//     public static <T> Collection<? extends T> lookupAll(Class<T> serviceClass) {
//         Collection<? extends T> result = getLookup().lookupAll(serviceClass);
// 
//         validateLookupResult(serviceClass, result);
// 
//         return result;
//     }
// 
//     private static void validateLookupResult(Class<?> serviceClass, Object lookupResult) {
//         if (lookupResult == null) {
//             if (shouldThrowLookupExceptions(serviceClass)) {
//                 throw new IllegalArgumentException(String.format("Service '%s' not registered!", serviceClass.getSimpleName()));
//             }
//         }
//     }
// 
//     //This code prevents exceptions in the visual form editors within NetBeans
//     private static boolean shouldThrowLookupExceptions(Class<?> serviceClass) {
//         if (serviceClass != TestService.class) {
//             TestService testService = lookup.lookup(TestService.class);
//             if (testService == null) {
//                 return false;
//             }
//         }
// 
//         return true;
//     }
// 
//     private Injector() {
//     }
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/pmdcatalogs/LanguageVersionParser.java
// public interface LanguageVersionParser {
// 
//     LanguageVersion parse(String versionString);
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/pmdcatalogs/StandardRuleSetsCatalog.java
// public interface StandardRuleSetsCatalog {
// 
//     boolean containsFileName(String ruleSetFileName);
// 
//     Collection<RuleSetWrapper> getRuleSetWrappers();
// }


import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import info.gianlucacosta.easypmd.system.SystemPropertiesService;
import info.gianlucacosta.easypmd.ide.Injector;
import info.gianlucacosta.easypmd.pmdscanner.pmdcatalogs.LanguageVersionParser;
import info.gianlucacosta.easypmd.pmdscanner.pmdcatalogs.StandardRuleSetsCatalog;
import info.gianlucacosta.helios.regex.OsSpecificPathCompositeRegex;
import net.sourceforge.pmd.RulePriority;
import org.openide.util.lookup.ServiceProvider;
import java.util.ArrayList;
/*
 * ==========================================================================%%#
 * EasyPmd
 * ===========================================================================%%
 * Copyright (C) 2009 - 2017 Gianluca Costa
 * ===========================================================================%%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * ==========================================================================%##
 */
package info.gianlucacosta.easypmd.ide.options;



/**
 * Default implementation of OptionsFactory
 */
@ServiceProvider(service = OptionsFactory.class)
public class DefaultOptionsFactory implements OptionsFactory {

    private static final Logger logger = Logger.getLogger(DefaultOptionsFactory.class.getName());
    private static final String fallbackJavaLanguageVersion = "1.8";

    private final StandardRuleSetsCatalog standardRulesetsCatalog;
    private final SystemPropertiesService systemPropertiesService;
    private final LanguageVersionParser languageVersionParser;

    public DefaultOptionsFactory() {
// Path: src/main/java/info/gianlucacosta/easypmd/system/SystemPropertiesService.java
// public interface SystemPropertiesService {
// 
//     String getJavaVersion();
// 
//     Path getUserHomeDirectory();
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/ide/Injector.java
// public class Injector {
// 
//     @ServiceProvider(service = TestService.class)
//     public static class TestService {
//     }
// 
//     private static final Lookup lookup = Lookup.getDefault();
// 
//     private static Lookup getLookup() {
//         return lookup;
//     }
// 
//     public static <T> T lookup(Class<T> serviceClass) {
//         T result = getLookup().lookup(serviceClass);
// 
//         validateLookupResult(serviceClass, result);
// 
//         return result;
//     }
// 
//     public static <T> Collection<? extends T> lookupAll(Class<T> serviceClass) {
//         Collection<? extends T> result = getLookup().lookupAll(serviceClass);
// 
//         validateLookupResult(serviceClass, result);
// 
//         return result;
//     }
// 
//     private static void validateLookupResult(Class<?> serviceClass, Object lookupResult) {
//         if (lookupResult == null) {
//             if (shouldThrowLookupExceptions(serviceClass)) {
//                 throw new IllegalArgumentException(String.format("Service '%s' not registered!", serviceClass.getSimpleName()));
//             }
//         }
//     }
// 
//     //This code prevents exceptions in the visual form editors within NetBeans
//     private static boolean shouldThrowLookupExceptions(Class<?> serviceClass) {
//         if (serviceClass != TestService.class) {
//             TestService testService = lookup.lookup(TestService.class);
//             if (testService == null) {
//                 return false;
//             }
//         }
// 
//         return true;
//     }
// 
//     private Injector() {
//     }
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/pmdcatalogs/LanguageVersionParser.java
// public interface LanguageVersionParser {
// 
//     LanguageVersion parse(String versionString);
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/pmdcatalogs/StandardRuleSetsCatalog.java
// public interface StandardRuleSetsCatalog {
// 
//     boolean containsFileName(String ruleSetFileName);
// 
//     Collection<RuleSetWrapper> getRuleSetWrappers();
// }


// Path: src/main/java/info/gianlucacosta/easypmd/ide/options/DefaultOptionsFactory.java
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import info.gianlucacosta.easypmd.system.SystemPropertiesService;
import info.gianlucacosta.easypmd.ide.Injector;
import info.gianlucacosta.easypmd.pmdscanner.pmdcatalogs.LanguageVersionParser;
import info.gianlucacosta.easypmd.pmdscanner.pmdcatalogs.StandardRuleSetsCatalog;
import info.gianlucacosta.helios.regex.OsSpecificPathCompositeRegex;
import net.sourceforge.pmd.RulePriority;
import org.openide.util.lookup.ServiceProvider;
import java.util.ArrayList;

/*
 * ==========================================================================%%#
 * EasyPmd
 * ===========================================================================%%
 * Copyright (C) 2009 - 2017 Gianluca Costa
 * ===========================================================================%%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * ==========================================================================%##
 */
package info.gianlucacosta.easypmd.ide.options;



/**
 * Default implementation of OptionsFactory
 */
@ServiceProvider(service = OptionsFactory.class)
public class DefaultOptionsFactory implements OptionsFactory {

    private static final Logger logger = Logger.getLogger(DefaultOptionsFactory.class.getName());
    private static final String fallbackJavaLanguageVersion = "1.8";

    private final StandardRuleSetsCatalog standardRulesetsCatalog;
    private final SystemPropertiesService systemPropertiesService;
    private final LanguageVersionParser languageVersionParser;

    public DefaultOptionsFactory() {
        standardRulesetsCatalog = Injector.lookup(StandardRuleSetsCatalog.class);