// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/Log.java
// public static void debug(String message) {
//     if(DEBUG) {
//         log.log(status(Status.INFO, "[DEBUG] " + message));
//     }
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/IDEAndroidProject.java
// public interface IDEAndroidProject {
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public IProject getProject();
// 
//     public void setAndroidProject(boolean androidProject);
// 
//     public void setLibrary(boolean isLibrary);
// 
//     public void setLibraryDependencies(List<IDEAndroidProject> dependencies);
// 
//     public void fixProject();
// 
//     public boolean isMavenised();
// 
//     public IFile getPom();
// 
//     public void setAssetsDirectory(File file);
//  
//     public void setResourceFolder(File resourceDirectory);
//     
//     public void setAndroidManifest(File androidManifestFile);
// 
//     public Classpath getClasspath();
//     
//     public boolean shouldResolveWorkspaceProjects();
// 
//     public String getPath();
// 
//     public void orderBuilders();
// 
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/MavenAndroidProject.java
// public interface MavenAndroidProject {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public List<Dependency> getNonRuntimeDependencies();
// 
//     public List<Dependency> getLibraryDependencies();
// 
//     public File getAssetsDirectory();
// 
//     public File getResourceFolder();
// 
//     public File getAndroidManifestFile();
//     
//     public File getDestinationManifestFile();
// 
//     public List<String> getPlatformProvidedDependencies();
// 
//     public List<String> getSourcePaths();
//     
//     public String getOutputDirectory();
// 
//     public boolean isIgnoreOptionalWarningsInGenFolder();
// 
//     public List<String> getTestSourcePaths();
// 
//     public List<String> getResourcePaths();
// 
//     public List<String> getTestResourcePaths();
// 
// }


import static com.google.common.collect.Lists.newArrayList;
import static me.gladwell.eclipse.m2e.android.Log.debug;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;
import me.gladwell.eclipse.m2e.android.project.IDEAndroidProject;
import me.gladwell.eclipse.m2e.android.project.MavenAndroidProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import com.google.inject.Inject;
import com.google.inject.Singleton;
                    } else if (o instanceof IClasspathAttribute) {
                        return new ClasspathAttributeReplace((IClasspathAttribute) o);
                    } else if (o instanceof IAccessRule) {
                        return new AccessRuleReplace((IAccessRule) o);
                    } else if (o instanceof IPath) {
                        return new PathReplace((IPath) o);
                    }
                    return super.replaceObject(o);
                }
            };
            os.writeObject(newArrayList(classpath));
            os.flush();
        } catch (IOException e) {
            throw new ProjectConfigurationException(e);
        } finally {
            if (os != null) {
                try {
                    os.close();
                } catch (IOException e) {
                    throw new ProjectConfigurationException(e);
                }
            }
        }
    }

    public List<IClasspathEntry> load(IJavaProject project) throws FileNotFoundException {
        List<IClasspathEntry> classpath = null;
        ObjectInputStream is = null;
        try {
            File file = new File(stateLocation, project.getProject().getName());
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/Log.java
// public static void debug(String message) {
//     if(DEBUG) {
//         log.log(status(Status.INFO, "[DEBUG] " + message));
//     }
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/IDEAndroidProject.java
// public interface IDEAndroidProject {
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public IProject getProject();
// 
//     public void setAndroidProject(boolean androidProject);
// 
//     public void setLibrary(boolean isLibrary);
// 
//     public void setLibraryDependencies(List<IDEAndroidProject> dependencies);
// 
//     public void fixProject();
// 
//     public boolean isMavenised();
// 
//     public IFile getPom();
// 
//     public void setAssetsDirectory(File file);
//  
//     public void setResourceFolder(File resourceDirectory);
//     
//     public void setAndroidManifest(File androidManifestFile);
// 
//     public Classpath getClasspath();
//     
//     public boolean shouldResolveWorkspaceProjects();
// 
//     public String getPath();
// 
//     public void orderBuilders();
// 
// }
// 
// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/MavenAndroidProject.java
// public interface MavenAndroidProject {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public List<Dependency> getNonRuntimeDependencies();
// 
//     public List<Dependency> getLibraryDependencies();
// 
//     public File getAssetsDirectory();
// 
//     public File getResourceFolder();
// 
//     public File getAndroidManifestFile();
//     
//     public File getDestinationManifestFile();
// 
//     public List<String> getPlatformProvidedDependencies();
// 
//     public List<String> getSourcePaths();
//     
//     public String getOutputDirectory();
// 
//     public boolean isIgnoreOptionalWarningsInGenFolder();
// 
//     public List<String> getTestSourcePaths();
// 
//     public List<String> getResourcePaths();
// 
//     public List<String> getTestResourcePaths();
// 
// }


// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/configuration/ObjectSerializationClasspathPersister.java
import static com.google.common.collect.Lists.newArrayList;
import static me.gladwell.eclipse.m2e.android.Log.debug;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;
import me.gladwell.eclipse.m2e.android.project.IDEAndroidProject;
import me.gladwell.eclipse.m2e.android.project.MavenAndroidProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import com.google.inject.Inject;
import com.google.inject.Singleton;

                    } else if (o instanceof IClasspathAttribute) {
                        return new ClasspathAttributeReplace((IClasspathAttribute) o);
                    } else if (o instanceof IAccessRule) {
                        return new AccessRuleReplace((IAccessRule) o);
                    } else if (o instanceof IPath) {
                        return new PathReplace((IPath) o);
                    }
                    return super.replaceObject(o);
                }
            };
            os.writeObject(newArrayList(classpath));
            os.flush();
        } catch (IOException e) {
            throw new ProjectConfigurationException(e);
        } finally {
            if (os != null) {
                try {
                    os.close();
                } catch (IOException e) {
                    throw new ProjectConfigurationException(e);
                }
            }
        }
    }

    public List<IClasspathEntry> load(IJavaProject project) throws FileNotFoundException {
        List<IClasspathEntry> classpath = null;
        ObjectInputStream is = null;
        try {
            File file = new File(stateLocation, project.getProject().getName());
            debug("loading classpath from file=[" + file + "]");