Skip to content

Commit

Permalink
Annotate NullSafe(LOCAL) for classes in java/com/facebook/react/text
Browse files Browse the repository at this point in the history
Summary:
Nullsafety scripts and analysis determine it's safe to annotate these classes as NullSafe(LOCAL)

changelog: [internal] internal

Differential Revision: D70464133
  • Loading branch information
mdvacca committed Mar 2, 2025
1 parent 8cbecdf commit 83773f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ internal class DebuggingOverlay(context: Context) : View(context) {
for (traceUpdate in traceUpdates) {
val traceUpdateId = traceUpdate.id
if (traceUpdateIdToCleanupRunnableMap.containsKey(traceUpdateId)) {
UiThreadUtil.removeOnUiThread(traceUpdateIdToCleanupRunnableMap[traceUpdateId])
traceUpdateIdToCleanupRunnableMap.remove(traceUpdateId)
traceUpdateIdToCleanupRunnableMap[traceUpdateId]?.also { runnable ->
UiThreadUtil.removeOnUiThread(runnable)
traceUpdateIdToCleanupRunnableMap.remove(traceUpdateId)
}
}

traceUpdatesToDisplayMap[traceUpdateId] = traceUpdate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.facebook.react.views.text;

import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.uimanager.ReactShadowNode;
import com.facebook.react.uimanager.ReactShadowNodeImpl;
Expand All @@ -17,6 +18,7 @@
* {@link ReactShadowNode} class for pure raw text node (aka {@code textContent} in terms of DOM).
* Raw text node can only have simple string value without any attributes, properties or state.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactRawTextShadowNode extends ReactShadowNodeImpl {

@VisibleForTesting public static final String PROP_TEXT = "text";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import androidx.annotation.NonNull;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ViewDefaults;
Expand All @@ -20,6 +21,7 @@
* the rendered aka effective value. For example, to figure out the rendered/effective font size,
* you need to take into account the fontSize, maxFontSizeMultiplier, and allowFontScaling props.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class TextAttributes {
// Setting the default to 0 indicates that there is no max.
public static final float DEFAULT_MAX_FONT_SIZE_MULTIPLIER = 0.0f;
Expand Down

0 comments on commit 83773f4

Please sign in to comment.