Skip to content
This repository was archived by the owner on Sep 10, 2019. It is now read-only.

Commit 7ebbf69

Browse files
committed
Adding TypeChecked where possible and CompileStatic where possible. CompileStatic was removed from AbstractClientExtensions due to the sketchy way that the compiler was allowing it to continue use DefaultGroovyMethods.with, which is an extension method.
1 parent 5e336ce commit 7ebbf69

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

src/main/groovy/org/elasticsearch/groovy/ClosureExtensions.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
*/
1919
package org.elasticsearch.groovy
2020

21+
import groovy.transform.CompileStatic
22+
import groovy.transform.TypeChecked
23+
2124
/**
2225
* {@code ClosureExtensions} adds convenient behaviors to Groovy's {@link Closure} class, such as the ability to convert
2326
* a {@code Closure} into a {@link Map} with {@link String} keys and {@link Object} values.
2427
*/
28+
@CompileStatic
29+
@TypeChecked
2530
class ClosureExtensions {
2631
/**
2732
* Convert the self-referenced {@link Closure} into a {@link Map} with {@link String} keys as {@link Object} values.

src/main/groovy/org/elasticsearch/groovy/client/AbstractClientExtensions.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
package org.elasticsearch.groovy.client
2020

21-
import groovy.transform.CompileStatic
2221
import groovy.transform.TypeChecked
2322

2423
import org.elasticsearch.action.ActionRequest
@@ -30,7 +29,6 @@ import org.elasticsearch.client.ElasticsearchClient
3029
* {@code AbstractClientExtensions} provides convenience operations for {@link org.elasticsearch.client.Client}
3130
* extensions.
3231
*/
33-
@CompileStatic
3432
@TypeChecked
3533
abstract class AbstractClientExtensions {
3634
/**

src/main/groovy/org/elasticsearch/groovy/common/settings/SettingsStaticExtensions.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.elasticsearch.groovy.common.settings
2020

21+
import groovy.transform.TypeChecked
22+
2123
import org.elasticsearch.ElasticsearchGenerationException
2224
import org.elasticsearch.common.settings.Settings
2325

@@ -27,6 +29,7 @@ import org.elasticsearch.common.settings.Settings
2729
* In particular, this adds the ability to specify settings in the form of a {@link Closure} when creating a
2830
* new {@link Settings#settingsBuilder() Builder}.
2931
*/
32+
@TypeChecked
3033
class SettingsStaticExtensions {
3134
/**
3235
* Explicit settings to set.

src/main/groovy/org/elasticsearch/groovy/node/NodeBuilderExtensions.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.elasticsearch.groovy.node
2020

21+
import groovy.transform.TypeChecked
22+
2123
import org.elasticsearch.ElasticsearchGenerationException
2224
import org.elasticsearch.common.settings.Settings
2325
import org.elasticsearch.node.NodeBuilder
@@ -26,6 +28,7 @@ import org.elasticsearch.node.NodeBuilder
2628
* {@code NodeBuilderExtensions} provides convenience methods to standard Elasticsearch {@link NodeBuilder}s to make
2729
* them more Groovy friendly.
2830
*/
31+
@TypeChecked
2932
class NodeBuilderExtensions {
3033
/**
3134
* Set any addition settings by working directly against the internally used settings builder.

src/main/groovy/org/elasticsearch/groovy/node/NodeExtensions.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
package org.elasticsearch.groovy.node
2020

21+
import groovy.transform.CompileStatic
22+
import groovy.transform.TypeChecked
23+
2124
import org.elasticsearch.client.Client
2225
import org.elasticsearch.common.settings.Settings
2326
import org.elasticsearch.node.Node
@@ -26,6 +29,8 @@ import org.elasticsearch.node.Node
2629
* {@code NodeExtensions} provides convenience methods to standard Elasticsearch {@link Node}s to make them more Groovy
2730
* friendly.
2831
*/
32+
@CompileStatic
33+
@TypeChecked
2934
class NodeExtensions {
3035
/**
3136
* Get the {@link Settings} used to create the {@link Node}.

0 commit comments

Comments
 (0)