Skip to content

Commit

Permalink
with checkNotNull] fbandroid/libraries/components/litho-editor-flippe…
Browse files Browse the repository at this point in the history
…r/src/main/java/com/facebook/litho/editor/flipper/DebugComponentDescriptor.java

Reviewed By: jocelynluizzi13

Differential Revision: D66322952

fbshipit-source-id: c5989aad1ae4b8cda44320efa050222242efa734
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Nov 22, 2024
1 parent 31540d7 commit 78d0836
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.facebook.yoga.YogaJustify;
import com.facebook.yoga.YogaPositionType;
import com.facebook.yoga.YogaValue;
import com.google.common.base.Preconditions;
import java.lang.reflect.Field;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -141,10 +142,8 @@ public String getId(DebugComponent node) {
@Override
public String getName(DebugComponent node) throws Exception {
NodeDescriptor componentDescriptor = descriptorForClass(node.getComponent().getClass());
// NULLSAFE_FIXME[Nullable Dereference]
if (componentDescriptor.getClass() != ObjectDescriptor.class) {
// NULLSAFE_FIXME[Nullable Dereference]
return componentDescriptor.getName(node.getComponent());
if (Preconditions.checkNotNull(componentDescriptor).getClass() != ObjectDescriptor.class) {
return Preconditions.checkNotNull(componentDescriptor).getName(node.getComponent());
}
return node.getComponent().getSimpleName();
}
Expand Down Expand Up @@ -175,10 +174,8 @@ public Object getChildAt(DebugComponent node, int index) {
@Override
public List<Named<FlipperObject>> getData(DebugComponent node) throws Exception {
NodeDescriptor componentDescriptor = descriptorForClass(node.getComponent().getClass());
// NULLSAFE_FIXME[Nullable Dereference]
if (componentDescriptor.getClass() != ObjectDescriptor.class) {
// NULLSAFE_FIXME[Nullable Dereference]
return componentDescriptor.getData(node.getComponent());
if (Preconditions.checkNotNull(componentDescriptor).getClass() != ObjectDescriptor.class) {
return Preconditions.checkNotNull(componentDescriptor).getData(node.getComponent());
}

final List<Named<FlipperObject>> data = new ArrayList<>();
Expand Down Expand Up @@ -528,10 +525,8 @@ public void hitTest(DebugComponent node, Touch touch) {
public String getDecoration(DebugComponent node) throws Exception {
if (node.getComponent() != null) {
NodeDescriptor componentDescriptor = descriptorForClass(node.getComponent().getClass());
// NULLSAFE_FIXME[Nullable Dereference]
if (componentDescriptor.getClass() != ObjectDescriptor.class) {
// NULLSAFE_FIXME[Nullable Dereference]
return componentDescriptor.getDecoration(node.getComponent());
if (Preconditions.checkNotNull(componentDescriptor).getClass() != ObjectDescriptor.class) {
return Preconditions.checkNotNull(componentDescriptor).getDecoration(node.getComponent());
}
}
return "litho";
Expand Down

0 comments on commit 78d0836

Please sign in to comment.