MCPcopy Index your code
hub / github.com/antlr/codebuff / safeContains

Method safeContains

output/java_guava/1.4.17/Collections2.java:105–114  ·  view source on GitHub ↗

Delegates to Collection#contains. Returns false if the contains method throws a ClassCastException or NullPointerException.

(Collection<?> collection, @Nullable Object object)

Source from the content-addressed store, hash-verified

103 */
104
105 static boolean safeContains(Collection<?> collection, @Nullable Object object) {
106 checkNotNull(collection);
107 try {
108 return collection.contains(object);
109 } catch (ClassCastException e) {
110 return false;
111 } catch (NullPointerException e) {
112 return false;
113 }
114 }
115
116 /**
117 * Delegates to {@link Collection#remove}. Returns {@code false} if the

Callers 9

containsMethod · 0.95
getMethod · 0.95
getMethod · 0.95
containsMethod · 0.95
containsMethod · 0.95
containsMethod · 0.95
containsMethod · 0.95
containsMethod · 0.95
containsMethod · 0.45

Calls 2

containsMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected