Projects >> platform_dalvik >>f68b2253877b64eb53f2d37ddd1494753973af06

Chunk
Conflicting content
 */
public class Main {
    /**
<<<<<<< HEAD
=======
     * {@code non-null;} Error message for too many method/field/type ids.
     */
    public static final String TO_MANY_ID_ERROR_MESSAGE =
        "Dex limit exceeded. You may try option " + Arguments.MULTI_DEX_OPTION;

    /**
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
     * File extension of a {@code .dex} file.
     */
    private static final String DEX_EXTENSION = ".dex";
Solution content
 */
public class Main {
    /**
     * File extension of a {@code .dex} file.
     */
    private static final String DEX_EXTENSION = ".dex";
File
Main.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
        }
    }

<<<<<<< HEAD
    /**
     * {@code non-null;} Error message for too many method/field/type ids.
     */
    public static String getTooManyIdsErrorMessage() {
        if (args.multiDex) {
            return "The list of classes given in " + Arguments.MAIN_DEX_LIST_OPTION +
                   " is too big and does not fit in the main dex.";
        } else {
            return "You may try using " + Arguments.MULTI_DEX_OPTION + " option.";
        }
    }

=======
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
    private static int runMonoDex() throws IOException {

        File incrementalOutFile = null;
Solution content
        }
    }

    /**
     * {@code non-null;} Error message for too many method/field/type ids.
     */
    public static String getTooManyIdsErrorMessage() {
        if (args.multiDex) {
            return "The list of classes given in " + Arguments.MAIN_DEX_LIST_OPTION +
                   " is too big and does not fit in the main dex.";
        } else {
            return "You may try using " + Arguments.MULTI_DEX_OPTION + " option.";
        }
    }

    private static int runMonoDex() throws IOException {

        File incrementalOutFile = null;
File
Main.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
                        }
                    }
                }
<<<<<<< HEAD
                return false;
            } else {
                return true;
            }
=======
            }
            return false;
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
        }

        private static String getSimpleName(String path) {
Solution content
                        }
                    }
                }
                return false;
            } else {
                return true;
            }
        }

        private static String getSimpleName(String path) {
File
Main.java
Developer's decision
Version 1
Kind of conflict
Return statement
Chunk
Conflicting content
import com.android.dex.DexException;
import com.android.dex.DexFormat;
import com.android.dx.command.dexer.Main;
<<<<<<< HEAD

import java.util.Formatter;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
=======
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9

/**
 * Member (field or method) refs list section of a {@code .dex} file.
Solution content
import com.android.dex.DexException;
import com.android.dex.DexFormat;
import com.android.dx.command.dexer.Main;

import java.util.Formatter;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Member (field or method) refs list section of a {@code .dex} file.
File
MemberIdsSection.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
        int idx = 0;

        if (items().size() > DexFormat.MAX_MEMBER_IDX + 1) {
<<<<<<< HEAD
            throw new DexException(getTooManyMembersMessage());
=======
            throw new DexException(Main.TO_MANY_ID_ERROR_MESSAGE);
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
        }

        for (Object i : items()) {
Solution content
        int idx = 0;

        if (items().size() > DexFormat.MAX_MEMBER_IDX + 1) {
            throw new DexException(getTooManyMembersMessage());
        }

        for (Object i : items()) {
File
MemberIdsSection.java
Developer's decision
Version 1
Kind of conflict
Throw statement
Chunk
Conflicting content
            idx++;
        }
    }
<<<<<<< HEAD

    private String getTooManyMembersMessage() {
        Map membersByPackage = new TreeMap();
        for (Object member : items()) {
            String packageName = ((MemberIdItem) member).getDefiningClass().getPackageName();
            AtomicInteger count = membersByPackage.get(packageName);
            if (count == null) {
                count = new AtomicInteger();
                membersByPackage.put(packageName, count);
            }
            count.incrementAndGet();
        }

        Formatter formatter = new Formatter();
        try {
            String memberType = this instanceof MethodIdsSection ? "method" : "field";
            formatter.format("Too many %s references: %d; max is %d.%n" +
                    Main.getTooManyIdsErrorMessage() + "%n" +
                    "References by package:",
                    memberType, items().size(), DexFormat.MAX_MEMBER_IDX + 1);
            for (Map.Entry entry : membersByPackage.entrySet()) {
                formatter.format("%n%6d %s", entry.getValue().get(), entry.getKey());
            }
            return formatter.toString();
        } finally {
            formatter.close();
        }
    }

=======
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
}
Solution content
            idx++;
        }
    }

    private String getTooManyMembersMessage() {
        Map membersByPackage = new TreeMap();
        for (Object member : items()) {
            String packageName = ((MemberIdItem) member).getDefiningClass().getPackageName();
            AtomicInteger count = membersByPackage.get(packageName);
            if (count == null) {
                count = new AtomicInteger();
                membersByPackage.put(packageName, count);
            }
            count.incrementAndGet();
        }

        Formatter formatter = new Formatter();
        try {
            String memberType = this instanceof MethodIdsSection ? "method" : "field";
            formatter.format("Too many %s references: %d; max is %d.%n" +
                    Main.getTooManyIdsErrorMessage() + "%n" +
                    "References by package:",
                    memberType, items().size(), DexFormat.MAX_MEMBER_IDX + 1);
            for (Map.Entry entry : membersByPackage.entrySet()) {
                formatter.format("%n%6d %s", entry.getValue().get(), entry.getKey());
            }
            return formatter.toString();
        } finally {
            formatter.close();
        }
    }

}
File
MemberIdsSection.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
        int offset = (sz == 0) ? 0 : getFileOffset();

        if (sz > DexFormat.MAX_TYPE_IDX + 1) {
<<<<<<< HEAD
            throw new DexException("Too many type references: " + sz +
                    "; max is " + (DexFormat.MAX_TYPE_IDX + 1) + ".\n" +
                    Main.getTooManyIdsErrorMessage());
=======
            throw new DexException(Main.TO_MANY_ID_ERROR_MESSAGE);
>>>>>>> 9eade7883d38900998babbf1ced20a40eadd00e9
        }

        if (out.annotates()) {
Solution content
        int offset = (sz == 0) ? 0 : getFileOffset();

        if (sz > DexFormat.MAX_TYPE_IDX + 1) {
            throw new DexException("Too many type references: " + sz +
                    "; max is " + (DexFormat.MAX_TYPE_IDX + 1) + ".\n" +
                    Main.getTooManyIdsErrorMessage());
        }

        if (out.annotates()) {
File
TypeIdsSection.java
Developer's decision
Version 1
Kind of conflict
Throw statement