Skip to content

Commit 22e0d96

Browse files
Updates note for suppressed warnings
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
1 parent 50b17f9 commit 22e0d96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sample-resource-plugin/src/main/java/org/opensearch/sample/resource/actions/rest/create/CreateResourceRestAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private RestChannelConsumer createResource(Map<String, Object> source, NodeClien
9292
);
9393
}
9494

95-
// NOTE: Suppressing warnings should be avoided as it may lead to loosing important information for while root-causing an issue
95+
// NOTE: Do NOT use @SuppressWarnings("unchecked") on untrusted data in production code. This is used here only to keep the code simple
9696
@SuppressWarnings("unchecked")
9797
private Map<String, String> getAttributes(Map<String, Object> source) {
9898
return source.containsKey("attributes") ? (Map<String, String>) source.get("attributes") : null;

sample-resource-plugin/src/main/java/org/opensearch/sample/resource/actions/rest/share/ShareResourceRestAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public String getName() {
4545
return "share_sample_resource";
4646
}
4747

48-
// NOTE: Suppressing warnings should be avoided as it may lead to loosing important information for while root-causing an issue
48+
// NOTE: Do NOT use @SuppressWarnings("unchecked") on untrusted data in production code. This is used here only to keep the code simple
4949
@SuppressWarnings("unchecked")
5050
@Override
5151
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {

0 commit comments

Comments
 (0)