Loading graphics/java/android/graphics/text/MeasuredText.java +13 −3 Original line number Diff line number Diff line Loading @@ -232,9 +232,7 @@ public class MeasuredText { * @throws IllegalStateException if this Builder is reused. */ public MeasuredText build() { if (mNativePtr == 0) { throw new IllegalStateException("Builder can not be reused."); } ensureNativePtrNoReuse(); try { long ptr = nBuildMeasuredText(mNativePtr, mText, mComputeHyphenation, mComputeLayout); Loading @@ -247,6 +245,18 @@ public class MeasuredText { } } /** * Ensures {@link #mNativePtr} is not reused. * * <p/> This is a method by itself to help increase testability - eg. Robolectric might want * to override the validation behavior in test environment. */ private void ensureNativePtrNoReuse() { if (mNativePtr == 0) { throw new IllegalStateException("Builder can not be reused."); } } private static native /* Non Zero */ long nInitBuilder(); /** Loading Loading
graphics/java/android/graphics/text/MeasuredText.java +13 −3 Original line number Diff line number Diff line Loading @@ -232,9 +232,7 @@ public class MeasuredText { * @throws IllegalStateException if this Builder is reused. */ public MeasuredText build() { if (mNativePtr == 0) { throw new IllegalStateException("Builder can not be reused."); } ensureNativePtrNoReuse(); try { long ptr = nBuildMeasuredText(mNativePtr, mText, mComputeHyphenation, mComputeLayout); Loading @@ -247,6 +245,18 @@ public class MeasuredText { } } /** * Ensures {@link #mNativePtr} is not reused. * * <p/> This is a method by itself to help increase testability - eg. Robolectric might want * to override the validation behavior in test environment. */ private void ensureNativePtrNoReuse() { if (mNativePtr == 0) { throw new IllegalStateException("Builder can not be reused."); } } private static native /* Non Zero */ long nInitBuilder(); /** Loading