Skip to content

Commit

Permalink
[GH] Simple changes to fix AbstractMethodError from issue b/204328129
Browse files Browse the repository at this point in the history
Please see [b/204328129](https://issuetracker.google.com/issues/204328129) for more details on the issue.

Basically this is something necessary to help prevent weird compilation errors that happen with the Buck/Redex build toolchains that Meta uses. Not something meaningful, but since the change is dead simple I guess it shall pass.

Test: This has been something that was patched on Meta source and we've been testing it for multiple prod releases of Threads, we're only now porting the change to Google because it seems appropriate.

Fixes: b/204328129

This is an imported pull request from androidx#625.

Resolves #625
Github-Pr-Head-Sha: 0568741
GitOrigin-RevId: 023a53d
(cherry picked from https://android-review.googlesource.com/q/commit:ca6fa30821e365ed3976bbcd0202c38b9da2c842)
Merged-In: I5b3fe39e54ffd4f97234c0ff23e54f9b790b2f0f
Change-Id: I5b3fe39e54ffd4f97234c0ff23e54f9b790b2f0f
  • Loading branch information
hick209 authored and Android Build Coastguard Worker committed Nov 15, 2023
1 parent d103e69 commit 3e66d42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package androidx.compose.ui.text.android

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith

@SmallTest
@RunWith(AndroidJUnit4::class)
class CharSequenceCharacterIteratorTest {
@Test
fun canClone() {
val subject = CharSequenceCharacterIterator("", 0, 0)
val cloned = subject.clone()
assertThat(subject).isNotSameInstanceAs(cloned)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ import java.text.CharacterIterator
* @param start The index of the beginning of the range.
* @param end The index of the end of the range.
*/
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
internal class CharSequenceCharacterIterator(
private val charSequence: CharSequence,
private val start: Int,
private val end: Int
) : CharacterIterator {
) : Object() /* see b/204328129 */, CharacterIterator {
private var index: Int = start

/**
Expand Down Expand Up @@ -173,7 +174,6 @@ internal class CharSequenceCharacterIterator(
*/
override fun clone(): Any {
return try {
@Suppress("ABSTRACT_SUPER_CALL")
super.clone()
} catch (e: CloneNotSupportedException) {
throw InternalError()
Expand Down

0 comments on commit 3e66d42

Please sign in to comment.