Projects >> realm-java >>2393dc04fd21df80b9cb0ab990799c2b933de4ef

Chunk
Conflicting content
import java.io.InputStream;

import java.io.InputStreamReader;
<<<<<<< HEAD
import java.util.Random;
=======
import java.nio.charset.Charset;
>>>>>>> b3d480aee9bf6c9faa7ec737cfe1088e16015d55

public class TestHelper {
Solution content
import java.io.InputStream;

import java.io.InputStreamReader;
import java.util.Random;
import java.nio.charset.Charset;

public class TestHelper {
File
TestHelper.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
    private static final int REALM_CHANGED = 14930352; // Hopefully it won't clash with other message IDs.
    protected static final Map handlers = new ConcurrentHashMap();

<<<<<<< HEAD
    private static RealmConfiguration defaultConfiguration;

    private static final String INCORRECT_THREAD_MESSAGE = "Realm access from incorrect thread. Realm objects can only be accessed on the thread they where created.";
=======
    // Maps ids to a boolean set to true if the Realm is open. This is only needed by deleteRealmFile
    private static final Map openRealms = new ConcurrentHashMap();
    private static final String INCORRECT_THREAD_MESSAGE = "Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created.";
>>>>>>> b3d480aee9bf6c9faa7ec737cfe1088e16015d55
    private static final String CLOSED_REALM_MESSAGE = "This Realm instance has already been closed, making it unusable.";
    private static final String DIFFERENT_KEY_MESSAGE = "Wrong key used to decrypt Realm.";
Solution content
    private static final int REALM_CHANGED = 14930352; // Hopefully it won't clash with other message IDs.
    protected static final Map handlers = new ConcurrentHashMap();

    private static RealmConfiguration defaultConfiguration;

    private static final String INCORRECT_THREAD_MESSAGE = "Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created.";
    private static final String CLOSED_REALM_MESSAGE = "This Realm instance has already been closed, making it unusable.";
    private static final String DIFFERENT_KEY_MESSAGE = "Wrong key used to decrypt Realm.";
File
Realm.java
Developer's decision
Combination
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
    private SharedGroup sharedGroup;
    private final ImplicitTransaction transaction;

<<<<<<< HEAD
    private final List> changeListeners = new ArrayList>();
    protected RealmProxyMediator proxyMediator;
=======
    private final List> changeListeners =
            new CopyOnWriteArrayList>();
    private static RealmProxyMediator proxyMediator = getDefaultMediator();
>>>>>>> b3d480aee9bf6c9faa7ec737cfe1088e16015d55

    private static final long UNVERSIONED = -1;
Solution content
    private SharedGroup sharedGroup;
    private final ImplicitTransaction transaction;

    private final List> changeListeners =
            new CopyOnWriteArrayList>();
    protected RealmProxyMediator proxyMediator;

    private static final long UNVERSIONED = -1;
File
Realm.java
Developer's decision
Combination
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
            // For all other threads, use the Handler
            if (
<<<<<<< HEAD
                realmPath.equals(canonicalPath)                       // It's the right realm
                && !handler.hasMessages(REALM_CHANGED)       // The right message
                && handler.getLooper().getThread().isAlive() // The receiving thread is alive
                && !handler.equals(this.handler)             // Don't notify yourself
=======
                    realmPath.equals(canonicalPath)              // It's the right realm
                    && !handler.hasMessages(REALM_CHANGED)       // The right message
                    && handler.getLooper().getThread().isAlive() // The receiving thread is alive
>>>>>>> b3d480aee9bf6c9faa7ec737cfe1088e16015d55
            ) {
                handler.sendEmptyMessage(REALM_CHANGED);
            }
Solution content
            // For all other threads, use the Handler
            if (
                    realmPath.equals(canonicalPath)              // It's the right realm
                    && !handler.hasMessages(REALM_CHANGED)       // The right message
                    && handler.getLooper().getThread().isAlive() // The receiving thread is alive
            ) {
                handler.sendEmptyMessage(REALM_CHANGED);
            }
File
Realm.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
        return canonicalPath;
    }

<<<<<<< HEAD
    // Get the canonical path for a given file
=======
    /**
     * Override the standard behavior of all classes extended RealmObject being part of the schema.
     * Use this method to define the schema as only the classes given here.
     *
     * This class must be called before calling {@link #getInstance(android.content.Context)}
     *
     * If {@code null} is given as parameter, the Schema is reset to use all known classes.
     *
     */
    @SafeVarargs
    static void setSchema(Class... schemaClass) {
        if (schemaClass != null) {
            // Filter default schema
            proxyMediator = new FilterableMediator(getDefaultMediator(), Arrays.asList(schemaClass));
        } else if (proxyMediator instanceof FilterableMediator) {
            // else reset filter if needed
            proxyMediator = ((FilterableMediator) proxyMediator).getOriginalMediator();
        }
    }

>>>>>>> b3d480aee9bf6c9faa7ec737cfe1088e16015d55
    static String getCanonicalPath(File realmFile) {
        try {
            return realmFile.getCanonicalPath();
Solution content
        return canonicalPath;
    }

    // Get the canonical path for a given file
    static String getCanonicalPath(File realmFile) {
        try {
            return realmFile.getCanonicalPath();
File
Realm.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration