Skip to content

Commit fb272f8

Browse files
cketchamafohrman
authored andcommitted
Remove cloneable from corner treatments since ShapeAppearance and CornerTreatments are now immutable
PiperOrigin-RevId: 266422300
1 parent fcef3c1 commit fb272f8

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

lib/java/com/google/android/material/shape/CornerTreatment.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* setting `android:clipChildren="false"` in xml. `clipToPadding` may also need to be false if there
3333
* is any padding on the parent that could intersect the shadow.
3434
*/
35-
public class CornerTreatment implements Cloneable {
35+
public class CornerTreatment {
3636

3737
private static final String TAG = "CornerTreatment";
3838

@@ -70,17 +70,6 @@ public float getCornerSize() {
7070
return cornerSize;
7171
}
7272

73-
@NonNull
74-
@Override
75-
public CornerTreatment clone() {
76-
try {
77-
return (CornerTreatment) super.clone();
78-
} catch (CloneNotSupportedException e) {
79-
throw new AssertionError(e); // This should never happen, because CornerTreatment handles the
80-
// cloning, so all subclasses of CornerTreatment will support cloning.
81-
}
82-
}
83-
8473
/**
8574
* Returns a new instance of this {@link CornerTreatment} for the given cornerSize. Extending
8675
* classes should override this method to return an instance of their custom class. This is used

lib/java/com/google/android/material/shape/CutCornerTreatment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import androidx.annotation.NonNull;
2020

2121
/** A corner treatment which cuts or clips the original corner of a shape with a straight line. */
22-
public class CutCornerTreatment extends CornerTreatment implements Cloneable {
22+
public class CutCornerTreatment extends CornerTreatment {
2323

2424
/**
2525
* Instantiates a cut corner treatment of a given size. A cut corner treatment introduces two new

lib/java/com/google/android/material/shape/RoundedCornerTreatment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import androidx.annotation.NonNull;
2020

2121
/** A corner treatment which rounds a corner of a shape. */
22-
public class RoundedCornerTreatment extends CornerTreatment implements Cloneable {
22+
public class RoundedCornerTreatment extends CornerTreatment {
2323

2424
/**
2525
* Instantiates a rounded corner treatment.

0 commit comments

Comments
 (0)