Skip to content

Commit ba91431

Browse files
committed
Address review comments
1 parent 06f7638 commit ba91431

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class Calendar implements ToXContentObject {
6565
*/
6666
public Calendar(String id, List<String> jobIds, @Nullable String description) {
6767
this.id = Objects.requireNonNull(id, ID.getPreferredName() + " must not be null");
68-
this.jobIds = Objects.requireNonNull(jobIds, JOB_IDS.getPreferredName() + " must not be null");
68+
this.jobIds = Collections.unmodifiableList(Objects.requireNonNull(jobIds, JOB_IDS.getPreferredName() + " must not be null"));
6969
this.description = description;
7070
}
7171

@@ -74,7 +74,7 @@ public String getId() {
7474
}
7575

7676
public List<String> getJobIds() {
77-
return Collections.unmodifiableList(jobIds);
77+
return jobIds;
7878
}
7979

8080
@Nullable
@@ -100,7 +100,7 @@ public boolean equals(Object obj) {
100100
return true;
101101
}
102102

103-
if (!(obj instanceof Calendar)) {
103+
if (obj == null || getClass() != obj.getClass()) {
104104
return false;
105105
}
106106

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/ScheduledEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public boolean equals(Object obj) {
107107
return true;
108108
}
109109

110-
if (!(obj instanceof ScheduledEvent)) {
110+
if (obj == null || getClass() != obj.getClass()) {
111111
return false;
112112
}
113113

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarRequestTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ protected PutCalendarRequest doParseInstance(XContentParser parser) throws IOExc
3939

4040
@Override
4141
protected boolean supportsUnknownFields() {
42-
return false;
42+
return true;
4343
}
4444
}

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarResponseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ protected PutCalendarResponse doParseInstance(XContentParser parser) throws IOEx
3838

3939
@Override
4040
protected boolean supportsUnknownFields() {
41-
return false;
41+
return true;
4242
}
4343
}

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/CalendarTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ protected Calendar doParseInstance(XContentParser parser) throws IOException {
5656

5757
@Override
5858
protected boolean supportsUnknownFields() {
59-
return false;
59+
return true;
6060
}
6161
}

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/ScheduledEventTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ protected ScheduledEvent doParseInstance(XContentParser parser) {
4646

4747
@Override
4848
protected boolean supportsUnknownFields() {
49-
return false;
49+
return true;
5050
}
5151
}

docs/java-rest/high-level/ml/get-buckets.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-buckets-l
112112
<1> `onResponse` is called back when the action is completed successfully
113113
<2> `onFailure` is called back when some unexpected error occurs
114114

115-
[[java-rest-high-snapshot-ml-get-buckets-response]]
115+
[[java-rest-high-x-pack-ml-get-buckets-response]]
116116
==== Get Buckets Response
117117

118118
The returned `GetBucketsResponse` contains the requested buckets:

docs/java-rest/high-level/ml/get-categories.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-categorie
7070
<1> `onResponse` is called back when the action is completed successfully
7171
<2> `onFailure` is called back when some unexpected error occurs
7272

73-
[[java-rest-high-snapshot-ml-get-categories-response]]
73+
[[java-rest-high-x-pack-ml-get-categories-response]]
7474
==== Get Categories Response
7575

7676
The returned `GetCategoriesResponse` contains the requested categories:

docs/java-rest/high-level/ml/get-influencers.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influence
9999
<1> `onResponse` is called back when the action is completed successfully
100100
<2> `onFailure` is called back when some unexpected error occurs
101101

102-
[[java-rest-high-snapshot-ml-get-influencers-response]]
102+
[[java-rest-high-x-pack-ml-get-influencers-response]]
103103
==== Get Influencers Response
104104

105105
The returned `GetInfluencersResponse` contains the requested influencers:

docs/java-rest/high-level/ml/get-overall-buckets.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-overall-b
9494
<1> `onResponse` is called back when the action is completed successfully
9595
<2> `onFailure` is called back when some unexpected error occurs
9696

97-
[[java-rest-high-snapshot-ml-get-overall-buckets-response]]
97+
[[java-rest-high-x-pack-ml-get-overall-buckets-response]]
9898
==== Get Overall Buckets Response
9999

100100
The returned `GetOverallBucketsResponse` contains the requested buckets:

0 commit comments

Comments
 (0)