// Path: src/main/java/tr/com/serkanozal/mysafe/config/AllocationPointConfig.java
// public class AllocationPointConfig {
// 
//     public static final int DEFAULT_SIZE_PARAMETER_ORDER = 1;
//     
//     public final int sizeParameterOrder;
//     
//     public AllocationPointConfig() {
//         this.sizeParameterOrder = DEFAULT_SIZE_PARAMETER_ORDER;
//     }
//     
//     public AllocationPointConfig(int sizeParameterOrder) {
//         this.sizeParameterOrder = sizeParameterOrder;
//     }
// 
// }
// 
// Path: src/main/java/tr/com/serkanozal/mysafe/config/FreePointConfig.java
// public class FreePointConfig {
// 
//     public static final int DEFAULT_ADDRESS_PARAMETER_ORDER = 1;
//     
//     public final int addressParameterOrder;
//     
//     public FreePointConfig() {
//         this.addressParameterOrder = DEFAULT_ADDRESS_PARAMETER_ORDER;
//     }
//     
//     public FreePointConfig(int addressParameterOrder) {
//         this.addressParameterOrder = addressParameterOrder;
//     }
//     
// }
// 
// Path: src/main/java/tr/com/serkanozal/mysafe/config/ReallocationPointConfig.java
// public class ReallocationPointConfig {
// 
//     public static final int DEFAULT_OLD_ADDRESS_PARAMETER_ORDER = 1;
//     public static final int DEFAULT_NEW_SIZE_PARAMETER_ORDER = 2;
//     
//     public final int oldAddressParameterOrder;
//     public final int newSizeParameterOrder;
//     
//     public ReallocationPointConfig() {
//         this.oldAddressParameterOrder = DEFAULT_OLD_ADDRESS_PARAMETER_ORDER;
//         this.newSizeParameterOrder = DEFAULT_NEW_SIZE_PARAMETER_ORDER;
//     }
//     
//     public ReallocationPointConfig(int oldAddressParameterOrder) {
//         this.oldAddressParameterOrder = oldAddressParameterOrder;
//         this.newSizeParameterOrder = DEFAULT_NEW_SIZE_PARAMETER_ORDER;
//     }
//     
//     public ReallocationPointConfig(int oldAddressParameterOrder, int newSizeParameterOrder) {
//         this.oldAddressParameterOrder = oldAddressParameterOrder;
//         this.newSizeParameterOrder = newSizeParameterOrder;
//     }
// 
// }


import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
import static tr.com.serkanozal.mysafe.AllocatedMemoryStorage.INVALID;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import tr.com.serkanozal.mysafe.config.AllocationPoint;
import tr.com.serkanozal.mysafe.config.AllocationPointConfig;
import tr.com.serkanozal.mysafe.config.FreePoint;
import tr.com.serkanozal.mysafe.config.FreePointConfig;
import tr.com.serkanozal.mysafe.config.ReallocationPoint;
import tr.com.serkanozal.mysafe.config.ReallocationPointConfig;
            if (mySafeConfigInputStream != null) {
                Properties mySafeConfigProps = new Properties();
                mySafeConfigProps.load(mySafeConfigInputStream);
                for (String propName : mySafeConfigProps.stringPropertyNames()) {
                    String propValue = mySafeConfigProps.getProperty(propName);
                    String[] propNameParts = propName.split("#");
                    if (propNameParts.length < 2) {
                        System.err.println("Invalid memory management point name: " + propName + 
                                           ". It must be in the form of \"<class_name>#<method_name>(#<optional-config>)*\".");
                        continue;
                    }
                    String className = propNameParts[0];
                    String methodName = propNameParts[1];
                    if ("ALLOCATION_POINT".equals(propValue)) {
                        if (propNameParts.length > 3) {
                            System.err.println("Invalid allocation point definition: " + propName + 
                                               ". It must be in the form of \"<class_name>#<method_name>(#<size_parameter_order>)?\".");
                            continue;
                        }
                        AllocationPointConfig allocationPointConfig = null;
                        if (propNameParts.length == 2) {
                            allocationPointConfig = new AllocationPointConfig();
                        } else {
                            allocationPointConfig = new AllocationPointConfig(Integer.parseInt(propNameParts[2]));
                        }
                        if (configuredAllocationPoints == null) {
                            configuredAllocationPoints = new HashMap<String, AllocationPointConfig>();
                        }
                        configuredAllocationPoints.put(className + "#" + methodName, allocationPointConfig);
                        System.out.println("Custom memory allocation point: " + 
// Path: src/main/java/tr/com/serkanozal/mysafe/config/AllocationPointConfig.java
// public class AllocationPointConfig {
// 
//     public static final int DEFAULT_SIZE_PARAMETER_ORDER = 1;
//     
//     public final int sizeParameterOrder;
//     
//     public AllocationPointConfig() {
//         this.sizeParameterOrder = DEFAULT_SIZE_PARAMETER_ORDER;
//     }
//     
//     public AllocationPointConfig(int sizeParameterOrder) {
//         this.sizeParameterOrder = sizeParameterOrder;
//     }
// 
// }
// 
// Path: src/main/java/tr/com/serkanozal/mysafe/config/FreePointConfig.java
// public class FreePointConfig {
// 
//     public static final int DEFAULT_ADDRESS_PARAMETER_ORDER = 1;
//     
//     public final int addressParameterOrder;
//     
//     public FreePointConfig() {
//         this.addressParameterOrder = DEFAULT_ADDRESS_PARAMETER_ORDER;
//     }
//     
//     public FreePointConfig(int addressParameterOrder) {
//         this.addressParameterOrder = addressParameterOrder;
//     }
//     
// }
// 
// Path: src/main/java/tr/com/serkanozal/mysafe/config/ReallocationPointConfig.java
// public class ReallocationPointConfig {
// 
//     public static final int DEFAULT_OLD_ADDRESS_PARAMETER_ORDER = 1;
//     public static final int DEFAULT_NEW_SIZE_PARAMETER_ORDER = 2;
//     
//     public final int oldAddressParameterOrder;
//     public final int newSizeParameterOrder;
//     
//     public ReallocationPointConfig() {
//         this.oldAddressParameterOrder = DEFAULT_OLD_ADDRESS_PARAMETER_ORDER;
//         this.newSizeParameterOrder = DEFAULT_NEW_SIZE_PARAMETER_ORDER;
//     }
//     
//     public ReallocationPointConfig(int oldAddressParameterOrder) {
//         this.oldAddressParameterOrder = oldAddressParameterOrder;
//         this.newSizeParameterOrder = DEFAULT_NEW_SIZE_PARAMETER_ORDER;
//     }
//     
//     public ReallocationPointConfig(int oldAddressParameterOrder, int newSizeParameterOrder) {
//         this.oldAddressParameterOrder = oldAddressParameterOrder;
//         this.newSizeParameterOrder = newSizeParameterOrder;
//     }
// 
// }


// Path: src/main/java/tr/com/serkanozal/mysafe/impl/instrument/CustomMemoryManagementInstrumenter.java
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
import static tr.com.serkanozal.mysafe.AllocatedMemoryStorage.INVALID;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import tr.com.serkanozal.mysafe.config.AllocationPoint;
import tr.com.serkanozal.mysafe.config.AllocationPointConfig;
import tr.com.serkanozal.mysafe.config.FreePoint;
import tr.com.serkanozal.mysafe.config.FreePointConfig;
import tr.com.serkanozal.mysafe.config.ReallocationPoint;
import tr.com.serkanozal.mysafe.config.ReallocationPointConfig;

            if (mySafeConfigInputStream != null) {
                Properties mySafeConfigProps = new Properties();
                mySafeConfigProps.load(mySafeConfigInputStream);
                for (String propName : mySafeConfigProps.stringPropertyNames()) {
                    String propValue = mySafeConfigProps.getProperty(propName);
                    String[] propNameParts = propName.split("#");
                    if (propNameParts.length < 2) {
                        System.err.println("Invalid memory management point name: " + propName + 
                                           ". It must be in the form of \"<class_name>#<method_name>(#<optional-config>)*\".");
                        continue;
                    }
                    String className = propNameParts[0];
                    String methodName = propNameParts[1];
                    if ("ALLOCATION_POINT".equals(propValue)) {
                        if (propNameParts.length > 3) {
                            System.err.println("Invalid allocation point definition: " + propName + 
                                               ". It must be in the form of \"<class_name>#<method_name>(#<size_parameter_order>)?\".");
                            continue;
                        }
                        AllocationPointConfig allocationPointConfig = null;
                        if (propNameParts.length == 2) {
                            allocationPointConfig = new AllocationPointConfig();
                        } else {
                            allocationPointConfig = new AllocationPointConfig(Integer.parseInt(propNameParts[2]));
                        }
                        if (configuredAllocationPoints == null) {
                            configuredAllocationPoints = new HashMap<String, AllocationPointConfig>();
                        }
                        configuredAllocationPoints.put(className + "#" + methodName, allocationPointConfig);
                        System.out.println("Custom memory allocation point: " + 
                                           "className=" + className + ", methodName=" + methodName);