From 79f6d15ea1f2d0626e826c54a0fbb0c73225f0ba Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Wed, 19 Jul 2023 09:32:33 -0700 Subject: [PATCH] Revert "Add Throwable.getCause and getLocalizedMessage() library models (#717)" This reverts commit c4c7c4bbb0f874127a74c0d28111eaf9137e5783. --- .../java/com/uber/nullaway/handlers/LibraryModelsHandler.java | 2 -- .../com/uber/nullaway/testdata/NullAwayNativeModels.java | 4 ---- 2 files changed, 6 deletions(-) diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java index 91879bf60f..3f12a03475 100644 --- a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java +++ b/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java @@ -620,8 +620,6 @@ private static class DefaultLibraryModels implements LibraryModels { new ImmutableSet.Builder() .add(methodRef("com.sun.source.tree.CompilationUnitTree", "getPackageName()")) .add(methodRef("java.lang.Throwable", "getMessage()")) - .add(methodRef("java.lang.Throwable", "getLocalizedMessage()")) - .add(methodRef("java.lang.Throwable", "getCause()")) .add(methodRef("java.lang.ref.Reference", "get()")) .add(methodRef("java.lang.ref.PhantomReference", "get()")) .add(methodRef("java.lang.ref.SoftReference", "get()")) diff --git a/nullaway/src/test/resources/com/uber/nullaway/testdata/NullAwayNativeModels.java b/nullaway/src/test/resources/com/uber/nullaway/testdata/NullAwayNativeModels.java index 8c337e9d6c..be70a6b30d 100644 --- a/nullaway/src/test/resources/com/uber/nullaway/testdata/NullAwayNativeModels.java +++ b/nullaway/src/test/resources/com/uber/nullaway/testdata/NullAwayNativeModels.java @@ -58,10 +58,6 @@ public static void referenceStuff() { Exception e = new RuntimeException(); // BUG: Diagnostic contains: dereferenced expression e.getMessage().hashCode(); - // BUG: Diagnostic contains: dereferenced expression - e.getLocalizedMessage().hashCode(); - // BUG: Diagnostic contains: dereferenced expression - e.getCause().toString(); } // we will add bug annotations when we have full support for maps