Skip to content

Commit d2c642a

Browse files
authored
Enforce & fix license headers (#1027) (#1028)
* Enforce license headers Signed-off-by: Thomas Farr <[email protected]> * spotlessApply Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Thomas Farr <[email protected]> (cherry picked from commit 5d5c6b5)
1 parent 0402e8a commit d2c642a

File tree

149 files changed

+1141
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1141
-145
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ gradle-app.setting
2222

2323
.ci/output
2424
java-client/bin
25-
samples/bin
25+
samples/bin
26+
27+
.DS_Store

LICENSE_HEADER.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+

LICENSE_HEADER_FORKED.txt

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+

java-client/build.gradle.kts

+18-9
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,28 @@ tasks.withType<Jar> {
286286
}
287287

288288
spotless {
289-
java {
289+
java {
290+
target("**/*.java")
290291

291-
target("**/*.java")
292+
licenseHeaderFile("../LICENSE_HEADER.txt")
293+
.named("PrimaryLicenseHeader")
294+
.onlyIfContentMatches("^((?!Licensed to Elasticsearch)[\\s\\S])*$")
295+
.delimiter("(package |//-----)")
292296

293-
// Use the default importOrder configuration
294-
importOrder()
295-
removeUnusedImports()
297+
licenseHeaderFile("../LICENSE_HEADER_FORKED.txt")
298+
.named("ForkedLicenseHeader")
299+
.onlyIfContentMatches("Licensed to Elasticsearch")
300+
.delimiter("(package |//-----)")
296301

297-
eclipse().configFile("../buildSrc/formatterConfig.xml")
302+
// Use the default importOrder configuration
303+
importOrder()
304+
removeUnusedImports()
298305

299-
trimTrailingWhitespace()
300-
endWithNewline()
301-
}
306+
eclipse().configFile("../buildSrc/formatterConfig.xml")
307+
308+
trimTrailingWhitespace()
309+
endWithNewline()
310+
}
302311
}
303312

304313
publishing {

java-client/src/main/java/org/opensearch/client/opensearch/_types/aggregations/CompositeValuesSource.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
package org.opensearch.client.opensearch._types.aggregations;
210

311
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
13-
149
package org.opensearch.client.opensearch._types.analysis;
1510

1611
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SmartcnAnalyzer.java

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
13-
149
package org.opensearch.client.opensearch._types.analysis;
1510

1611
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SmartcnStopTokenFilter.java

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
13-
149
package org.opensearch.client.opensearch._types.analysis;
1510

1611
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SmartcnTokenizer.java

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
13-
149
package org.opensearch.client.opensearch._types.analysis;
1510

1611
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/HybridQuery.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
package org.opensearch.client.opensearch._types.query_dsl;
210

311
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/core/bulk/UpdateOperation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* not use this file except in compliance with the License.
1616
* You may obtain a copy of the License at
1717
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
18+
* http://www.apache.org/licenses/LICENSE-2.0
1919
*
2020
* Unless required by applicable law or agreed to in writing,
2121
* software distributed under the License is distributed on an

java-client/src/main/java/org/opensearch/client/opensearch/core/search/CompletionSuggest.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
*/
88

99
/*
10-
* Licensed to Elasticsearch B.V. under one or more contributor
11-
* license agreements. See the NOTICE file distributed with
12-
* this work for additional information regarding copyright
13-
* ownership. Elasticsearch B.V. licenses this file to you under
14-
* the Apache License, Version 2.0 (the "License"); you may
15-
* not use this file except in compliance with the License.
16-
* You may obtain a copy of the License at
17-
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
19-
*
20-
* Unless required by applicable law or agreed to in writing,
21-
* software distributed under the License is distributed on an
22-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23-
* KIND, either express or implied. See the License for the
24-
* specific language governing permissions and limitations
25-
* under the License.
26-
*/
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
2727

2828
/*
2929
* Modifications Copyright OpenSearch Contributors. See

java-client/src/main/java/org/opensearch/client/opensearch/core/search/PhraseSuggest.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
*/
88

99
/*
10-
* Licensed to Elasticsearch B.V. under one or more contributor
11-
* license agreements. See the NOTICE file distributed with
12-
* this work for additional information regarding copyright
13-
* ownership. Elasticsearch B.V. licenses this file to you under
14-
* the Apache License, Version 2.0 (the "License"); you may
15-
* not use this file except in compliance with the License.
16-
* You may obtain a copy of the License at
17-
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
19-
*
20-
* Unless required by applicable law or agreed to in writing,
21-
* software distributed under the License is distributed on an
22-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23-
* KIND, either express or implied. See the License for the
24-
* specific language governing permissions and limitations
25-
* under the License.
26-
*/
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
2727

2828
/*
2929
* Modifications Copyright OpenSearch Contributors. See

java-client/src/main/java/org/opensearch/client/opensearch/core/search/SearchResult.java

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
139
package org.opensearch.client.opensearch.core.search;
1410

1511
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/opensearch/core/search/SuggestVariant.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
*/
88

99
/*
10-
* Licensed to Elasticsearch B.V. under one or more contributor
11-
* license agreements. See the NOTICE file distributed with
12-
* this work for additional information regarding copyright
13-
* ownership. Elasticsearch B.V. licenses this file to you under
14-
* the Apache License, Version 2.0 (the "License"); you may
15-
* not use this file except in compliance with the License.
16-
* You may obtain a copy of the License at
17-
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
19-
*
20-
* Unless required by applicable law or agreed to in writing,
21-
* software distributed under the License is distributed on an
22-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23-
* KIND, either express or implied. See the License for the
24-
* specific language governing permissions and limitations
25-
* under the License.
26-
*/
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
2727

2828
/*
2929
* Modifications Copyright OpenSearch Contributors. See

java-client/src/main/java/org/opensearch/client/opensearch/core/search/TermSuggest.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
*/
88

99
/*
10-
* Licensed to Elasticsearch B.V. under one or more contributor
11-
* license agreements. See the NOTICE file distributed with
12-
* this work for additional information regarding copyright
13-
* ownership. Elasticsearch B.V. licenses this file to you under
14-
* the Apache License, Version 2.0 (the "License"); you may
15-
* not use this file except in compliance with the License.
16-
* You may obtain a copy of the License at
17-
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
19-
*
20-
* Unless required by applicable law or agreed to in writing,
21-
* software distributed under the License is distributed on an
22-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23-
* KIND, either express or implied. See the License for the
24-
* specific language governing permissions and limitations
25-
* under the License.
26-
*/
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
2727

2828
/*
2929
* Modifications Copyright OpenSearch Contributors. See

java-client/src/main/java/org/opensearch/client/opensearch/generic/Requests.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
package org.opensearch.client.opensearch.generic;
210

311
import jakarta.json.JsonObject;

java-client/src/main/java/org/opensearch/client/opensearch/ingest/TextEmbeddingProcessor.java

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
/*
10-
* Modifications Copyright OpenSearch Contributors. See
11-
* GitHub history for details.
12-
*/
13-
149
package org.opensearch.client.opensearch.ingest;
1510

1611
import jakarta.json.stream.JsonGenerator;

java-client/src/main/java/org/opensearch/client/transport/httpclient5/DeadHostState.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
*/
88

99
/*
10-
* Licensed to Elasticsearch under one or more contributor
10+
* Licensed to Elasticsearch B.V. under one or more contributor
1111
* license agreements. See the NOTICE file distributed with
1212
* this work for additional information regarding copyright
13-
* ownership. Elasticsearch licenses this file to you under
13+
* ownership. Elasticsearch B.V. licenses this file to you under
1414
* the Apache License, Version 2.0 (the "License"); you may
1515
* not use this file except in compliance with the License.
1616
* You may obtain a copy of the License at
1717
*
18-
* http://www.apache.org/licenses/LICENSE-2.0
18+
* http://www.apache.org/licenses/LICENSE-2.0
1919
*
2020
* Unless required by applicable law or agreed to in writing,
2121
* software distributed under the License is distributed on an

0 commit comments

Comments
 (0)