Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2507165 authored by Raph Levien's avatar Raph Levien
Browse files

Fix bug 6688060: breakage in AndroidCharacter.mirror

A code cleanup inadvertently changed the semantics of the function,
causing it to return immediately when the first character is mirrored.
This causes CTS test breakage (in
android.text.cts.AndroidCharacterTest). This change restores the earlier
behavior and causes the test to pass.

Change-Id: I68cfb75f1db16eaa72e569dc48fbd0dee06f2de8
parent 81f58c20
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -157,6 +157,7 @@ static jboolean mirror(JNIEnv* env, jobject obj, jcharArray charArray, int start
        return false;
        return false;
    }
    }


    bool ret = false;
    for (int i = start; i < start + count; i++) {
    for (int i = start; i < start + count; i++) {
        // XXX this thinks it knows that surrogates are never mirrored
        // XXX this thinks it knows that surrogates are never mirrored


@@ -165,10 +166,10 @@ static jboolean mirror(JNIEnv* env, jobject obj, jcharArray charArray, int start


        if (c1 != c2) {
        if (c1 != c2) {
            data[i] = c2;
            data[i] = c2;
            return true;
            ret = true;
        }
        }
    }
    }
    return false;
    return ret;
}
}


static jchar getMirror(JNIEnv* env, jobject obj, jchar c)
static jchar getMirror(JNIEnv* env, jobject obj, jchar c)