Projects >> platform_frameworks_base >>071206b4b50ce94416042e6f5a0c838de43aace4

Chunk
Conflicting content
    private final String[] mIncludeGlobs;
    /** The set of classes to exclude.*/
    private final Set mExcludedClasses;
<<<<<<< HEAD
    /** Glob patterns of files to keep as is. */
    private final String[] mIncludeFileGlobs;
    /** Copy these files into the output as is. */
=======
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d

    /**
     * Creates a new analyzer.
Solution content
    private final String[] mIncludeGlobs;
    /** The set of classes to exclude.*/
    private final Set mExcludedClasses;
    /** Glob patterns of files to keep as is. */
    private final String[] mIncludeFileGlobs;
    /** Copy these files into the output as is. */

    /**
     * Creates a new analyzer.
File
AsmAnalyzer.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
     *        not ending in .class.
     */
    public AsmAnalyzer(Log log, List osJarPath, AsmGenerator gen,
<<<<<<< HEAD
            String[] deriveFrom, String[] includeGlobs, Set excludeClasses,
            String[] includeFileGlobs) {
=======
            String[] deriveFrom, String[] includeGlobs, Set excludeClasses) {
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        mLog = log;
        mGen = gen;
        mOsSourceJar = osJarPath != null ? osJarPath : new ArrayList();
Solution content
     *        not ending in .class.
     */
    public AsmAnalyzer(Log log, List osJarPath, AsmGenerator gen,
            String[] deriveFrom, String[] includeGlobs, Set excludeClasses,
            String[] includeFileGlobs) {
        mLog = log;
        mGen = gen;
        mOsSourceJar = osJarPath != null ? osJarPath : new ArrayList();
File
AsmAnalyzer.java
Developer's decision
Version 1
Kind of conflict
Variable
Chunk
Conflicting content
        mDeriveFrom = deriveFrom != null ? deriveFrom : new String[0];
        mIncludeGlobs = includeGlobs != null ? includeGlobs : new String[0];
        mExcludedClasses = excludeClasses;
<<<<<<< HEAD
        mIncludeFileGlobs = includeFileGlobs != null ? includeFileGlobs : new String[0];
=======
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
    }

    /**
Solution content
        mDeriveFrom = deriveFrom != null ? deriveFrom : new String[0];
        mIncludeGlobs = includeGlobs != null ? includeGlobs : new String[0];
        mExcludedClasses = excludeClasses;
        mIncludeFileGlobs = includeFileGlobs != null ? includeFileGlobs : new String[0];
    }

    /**
File
AsmAnalyzer.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Variable
Chunk
Conflicting content
     * Fills the generator with classes & dependencies found.
     */
    public void analyze() throws IOException, LogAbortException {
<<<<<<< HEAD

        TreeMap zipClasses = new TreeMap();
        Map filesFound = new TreeMap();

        parseZip(mOsSourceJar, zipClasses, filesFound);
=======
        Map zipClasses = parseZip(mOsSourceJar);
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        mLog.info("Found %d classes in input JAR%s.", zipClasses.size(),
                mOsSourceJar.size() > 1 ? "s" : "");
Solution content
     * Fills the generator with classes & dependencies found.
     */
    public void analyze() throws IOException, LogAbortException {

        TreeMap zipClasses = new TreeMap();
        Map filesFound = new TreeMap();

        parseZip(mOsSourceJar, zipClasses, filesFound);
        mLog.info("Found %d classes in input JAR%s.", zipClasses.size(),
                mOsSourceJar.size() > 1 ? "s" : "");
File
AsmAnalyzer.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
import com.android.tools.layoutlib.java.AutoCloseable;
<<<<<<< HEAD
import com.android.tools.layoutlib.java.Charsets;
import com.android.tools.layoutlib.java.IntegralToString;
import com.android.tools.layoutlib.java.Objects;
=======
import com.android.tools.layoutlib.java.ModifiedUtf8;
import com.android.tools.layoutlib.java.IntegralToString;
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
import com.android.tools.layoutlib.java.UnsafeByteSequence;

/**
Solution content
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
import com.android.tools.layoutlib.java.AutoCloseable;
import com.android.tools.layoutlib.java.Charsets;
import com.android.tools.layoutlib.java.IntegralToString;
import com.android.tools.layoutlib.java.Objects;
import com.android.tools.layoutlib.java.UnsafeByteSequence;

/**
File
CreateInfo.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
            LayoutlibDelegate.class,
            /* Java package classes */
            AutoCloseable.class,
<<<<<<< HEAD
            Objects.class,
            IntegralToString.class,
            UnsafeByteSequence.class,
            Charsets.class,
=======
            IntegralToString.class,
            UnsafeByteSequence.class,
            ModifiedUtf8.class,
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        };

    /**
Solution content
            LayoutlibDelegate.class,
            /* Java package classes */
            AutoCloseable.class,
            Objects.class,
            IntegralToString.class,
            UnsafeByteSequence.class,
            Charsets.class,
        };

    /**
File
CreateInfo.java
Developer's decision
Version 1
Kind of conflict
Other
Chunk
Conflicting content
    private final static String[] JAVA_PKG_CLASSES =
        new String[] {
            "java.lang.AutoCloseable",                         "com.android.tools.layoutlib.java.AutoCloseable",
<<<<<<< HEAD
            "java.util.Objects",                               "com.android.tools.layoutlib.java.Objects",
            "java.nio.charset.Charsets",                       "com.android.tools.layoutlib.java.Charsets",
=======
            "java.nio.charset.ModifiedUtf8",                   "com.android.tools.layoutlib.java.ModifiedUtf8",
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
            "java.lang.IntegralToString",                      "com.android.tools.layoutlib.java.IntegralToString",
            "java.lang.UnsafeByteSequence",                    "com.android.tools.layoutlib.java.UnsafeByteSequence",
        };
Solution content
    private final static String[] JAVA_PKG_CLASSES =
        new String[] {
            "java.lang.AutoCloseable",                         "com.android.tools.layoutlib.java.AutoCloseable",
            "java.util.Objects",                               "com.android.tools.layoutlib.java.Objects",
            "java.nio.charset.Charsets",                       "com.android.tools.layoutlib.java.Charsets",
            "java.lang.IntegralToString",                      "com.android.tools.layoutlib.java.IntegralToString",
            "java.lang.UnsafeByteSequence",                    "com.android.tools.layoutlib.java.UnsafeByteSequence",
        };
File
CreateInfo.java
Developer's decision
Version 1
Kind of conflict
Other
Chunk
Conflicting content
                        "android.pim.*", // for datepicker
                        "android.os.*",  // for android.os.Handler
                        "android.database.ContentObserver", // for Digital clock
<<<<<<< HEAD
                        "com.android.i18n.phonenumbers.*",  // for TextView with autolink attribute
                        "com.android.internal.view.menu.ActionMenu",
                    },
                    excludeClasses,
                    new String[] {
                        "com/android/i18n/phonenumbers/data/*",
                    });
=======
                    },
                    excludeClasses);
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
            aa.analyze();
            agen.generate();
Solution content
                        "android.pim.*", // for datepicker
                        "android.os.*",  // for android.os.Handler
                        "android.database.ContentObserver", // for Digital clock
                        "com.android.i18n.phonenumbers.*",  // for TextView with autolink attribute
                        "com.android.internal.view.menu.ActionMenu",
                    },
                    excludeClasses,
                    new String[] {
                        "com/android/i18n/phonenumbers/data/*",
                    });
            aa.analyze();
            agen.generate();
File
Main.java
Developer's decision
Version 1
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
        Set excludeClasses = new HashSet(1);
        excludeClasses.add("java.lang.JavaClass");
<<<<<<< HEAD

        String[] includeFiles = new String[]{"mock_android/data/data*"};
        mAa = new AsmAnalyzer(mLog, mOsJarPath, null /* gen */, null /* deriveFrom */,
                null /* includeGlobs */, excludeClasses, includeFiles);
=======
        mAa = new AsmAnalyzer(mLog, mOsJarPath, null /* gen */,
                null /* deriveFrom */, null /* includeGlobs */, excludeClasses);
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
    }

    @After
Solution content
        Set excludeClasses = new HashSet(1);
        excludeClasses.add("java.lang.JavaClass");

        String[] includeFiles = new String[]{"mock_android/data/data*"};
        mAa = new AsmAnalyzer(mLog, mOsJarPath, null /* gen */, null /* deriveFrom */,
                null /* includeGlobs */, excludeClasses, includeFiles);
    }

    @After
File
AsmAnalyzerTest.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Variable
Chunk
Conflicting content
        assertArrayEquals(new String[] { }, out_deps.keySet().toArray());
        assertArrayEquals(new String[] {
<<<<<<< HEAD
                "mock_android.widget.LinearLayout",
=======
                "mock_android.widget.TableLayout",
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        }, keep.keySet().toArray());
    }
}
Solution content
    }

        assertArrayEquals(new String[] { }, out_deps.keySet().toArray());
        assertArrayEquals(new String[] {
                "mock_android.widget.LinearLayout",
        }, keep.keySet().toArray());
}
File
AsmAnalyzerTest.java
Developer's decision
Version 1
Kind of conflict
Other
Chunk
Conflicting content
                new String[] {        // include classes
                    "**"
                },
<<<<<<< HEAD
                new HashSet(0) /* excluded classes */,
                new String[]{} /* include files */);
=======
                new HashSet(0) /* excluded classes */);
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        aa.analyze();
        agen.generate();
Solution content
                new String[] {        // include classes
                    "**"
                },
                new HashSet(0) /* excluded classes */,
                new String[]{} /* include files */);
        aa.analyze();
        agen.generate();
File
AsmGeneratorTest.java
Developer's decision
Version 1
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
<<<<<<< HEAD
                new String[] {        // include classes
                    "**"
                },
                new HashSet(1),
                new String[] {        /* include files */
                    "mock_android/data/data*"
                });
        aa.analyze();
        agen.generate();
        Map output = new TreeMap();
        Map filesFound = new TreeMap();
        parseZip(mOsDestJar, output, filesFound);
=======
                new HashSet(1));
        aa.analyze();
        agen.generate();
        Map output = parseZip(mOsDestJar);
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
        boolean injectedClassFound = false;
        for (ClassReader cr: output.values()) {
            TestClassVisitor cv = new TestClassVisitor();
Solution content
                });
        aa.analyze();
        agen.generate();
                new String[] {        // include classes
                    "**"
                },
                new HashSet(1),
                new String[] {        /* include files */
                    "mock_android/data/data*"
        Map output = new TreeMap();
        Map filesFound = new TreeMap();
        parseZip(mOsDestJar, output, filesFound);
        boolean injectedClassFound = false;
        for (ClassReader cr: output.values()) {
            TestClassVisitor cv = new TestClassVisitor();
File
AsmGeneratorTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
            injectedClassFound |= cv.mInjectedClassFound;
        }
        assertTrue(injectedClassFound);
<<<<<<< HEAD
        assertArrayEquals(new String[] {"mock_android/data/dataFile"},
                filesFound.keySet().toArray());
    }

    private void parseZip(String jarPath,
            Map classes,
            Map filesFound) throws IOException {
=======
    }

    private Map parseZip(String jarPath) throws IOException {
        TreeMap classes = new TreeMap();
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d

            ZipFile zip = new ZipFile(jarPath);
            Enumeration entries = zip.entries();
Solution content
            injectedClassFound |= cv.mInjectedClassFound;
        }
        assertTrue(injectedClassFound);
        assertArrayEquals(new String[] {"mock_android/data/dataFile"},
                filesFound.keySet().toArray());
    }

    private void parseZip(String jarPath,
            Map classes,
            Map filesFound) throws IOException {

            ZipFile zip = new ZipFile(jarPath);
            Enumeration entries = zip.entries();
File
AsmGeneratorTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Variable
Chunk
Conflicting content
                    ClassReader cr = new ClassReader(zip.getInputStream(entry));
                    String className = classReaderToClassName(cr);
                    classes.put(className, cr);
<<<<<<< HEAD
                } else {
                    filesFound.put(entry.getName(), zip.getInputStream(entry));
                }
            }

=======
                }
            }

        return classes;
>>>>>>> aab9d9a75cac9f1ed8291a5820d676c2eadc8b4d
    }

    private String classReaderToClassName(ClassReader classReader) {
Solution content
                    ClassReader cr = new ClassReader(zip.getInputStream(entry));
                    String className = classReaderToClassName(cr);
                    classes.put(className, cr);
                } else {
                    filesFound.put(entry.getName(), zip.getInputStream(entry));
                }
            }

    }

    private String classReaderToClassName(ClassReader classReader) {
File
AsmGeneratorTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Return statement
Variable