package com.trywildcard.pair;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by michaelgarate on 7/2/14.
 */
public class Pair {
    private static volatile Pair instance = null;
    private static Properties properties = new Properties();

    private Pair() {
        InputStream input = null;

        try {
            input = Pair.class.getClassLoader().getResourceAsStream("config.properties");

            if (input != null){
                properties.load(input);
            } else {
                throw new IOException();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Pair getInstance(){
        if (instance == null) {
            synchronized (Pair.class) {
                if (instance == null) {
                    instance = new Pair();
                }
            }
        }

        return instance;
    }


    public String getVersion(){
        return properties.getProperty("pairVersion");
    }

    public boolean getStrictValidation(){
        return Boolean.valueOf(properties.getProperty("strictValidation"));
    }

    public void setStrictValidation(boolean b){
        properties.setProperty("strictValidation", String.valueOf(b));
    }
}

@@ -200,17 +200,8 @@
 tic 
-volatile 
 Pair
@@ -695,72 +695,8 @@
 tic 
-Pair getInstance()%7B%0A        if (instance == null) %7B%0A            
 sync
@@ -708,31 +708,28 @@
 zed 
-(
 Pair
-.class) %7B%0A        
+ getInstance()%7B%0A
     
@@ -752,32 +752,24 @@
  == null) %7B%0A
-        
             
@@ -795,40 +795,8 @@
 ();%0A
-                %7D%0A            %7D%0A
     

simplify pair singleton strategy