-
Notifications
You must be signed in to change notification settings - Fork 340
Misc changes #2902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc changes #2902
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,9 +40,6 @@ | |
| import com.fasterxml.jackson.databind.JsonNode; | ||
|
|
||
| import org.opensearch.ExceptionsHelper; | ||
| import org.opensearch.common.bytes.BytesReference; | ||
| import org.opensearch.common.xcontent.XContentHelper; | ||
| import org.opensearch.common.xcontent.XContentType; | ||
| import org.opensearch.core.xcontent.ToXContent; | ||
| import org.opensearch.core.xcontent.XContentBuilder; | ||
| import org.opensearch.security.DefaultObjectMapper; | ||
|
|
@@ -216,11 +213,6 @@ public boolean exists(String key) { | |
| return centries.containsKey(key); | ||
| } | ||
|
|
||
| @JsonIgnore | ||
| public BytesReference toBytesReference() throws IOException { | ||
| return XContentHelper.toXContent(this, XContentType.JSON, false); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "SecurityDynamicConfiguration [seqNo=" | ||
|
|
@@ -322,7 +314,19 @@ public boolean containsAny(SecurityDynamicConfiguration other) { | |
|
|
||
| public boolean isHidden(String resourceName) { | ||
| final Object o = centries.get(resourceName); | ||
| return o != null && o instanceof Hideable && ((Hideable) o).isHidden(); | ||
| return o instanceof Hideable && ((Hideable) o).isHidden(); | ||
| } | ||
|
|
||
| @JsonIgnore | ||
| public boolean isStatic(final String resourceName) { | ||
| final Object o = centries.get(resourceName); | ||
| return o instanceof StaticDefinable && ((StaticDefinable) o).isStatic(); | ||
| } | ||
|
|
||
| @JsonIgnore | ||
| public boolean isReserved(final String resourceName) { | ||
| final Object o = centries.get(resourceName); | ||
| return o instanceof Hideable && ((Hideable) o).isReserved(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking into this method of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is the same in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let me try to ask the question this way:
May be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a very good question! :-) Because it is forbidden to change any |
||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that a nullcheck is redundant if calling instanceof immediately after because
null instanceof SomeClasswill always return false.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes