From fd40c7ee20b547573193ef7bf80625a991e04a05 Mon Sep 17 00:00:00 2001 From: Matt Jacobs Date: Tue, 10 Nov 2015 14:15:38 -0800 Subject: [PATCH] Added defaultSetter() methods to properties classes as a workaround for GROOVY-6286 --- .../com/netflix/hystrix/HystrixCollapserProperties.java | 9 +++++++++ .../com/netflix/hystrix/HystrixCommandProperties.java | 9 +++++++++ .../com/netflix/hystrix/HystrixThreadPoolProperties.java | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java index 00704f08d..388134e77 100644 --- a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java +++ b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java @@ -190,6 +190,15 @@ public static Setter Setter() { return new Setter(); } + /** + * Factory method to retrieve the default Setter. + * Groovy has a bug (GROOVY-6286) which does not allow method names and inner classes to have the same name + * This method fixes Issue #967 and allows Groovy consumers to choose this method and not trigger the bug + */ + public static Setter defaultSetter() { + return Setter(); + } + /** * Fluent interface that allows chained setting of properties that can be passed into a {@link HystrixCollapser} constructor to inject instance specific property overrides. *

diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java index 3c45dddf0..bfcda8fbb 100644 --- a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java +++ b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java @@ -491,6 +491,15 @@ public static Setter Setter() { return new Setter(); } + /** + * Factory method to retrieve the default Setter. + * Groovy has a bug (GROOVY-6286) which does not allow method names and inner classes to have the same name + * This method fixes Issue #967 and allows Groovy consumers to choose this method and not trigger the bug + */ + public static Setter defaultSetter() { + return Setter(); + } + /** * Fluent interface that allows chained setting of properties that can be passed into a {@link HystrixCommand} constructor to inject instance specific property overrides. *

diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java index a66202839..8cc5d7a8d 100644 --- a/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java +++ b/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java @@ -154,6 +154,15 @@ public static Setter Setter() { return new Setter(); } + /** + * Factory method to retrieve the default Setter. + * Groovy has a bug (GROOVY-6286) which does not allow method names and inner classes to have the same name + * This method fixes Issue #967 and allows Groovy consumers to choose this method and not trigger the bug + */ + public static Setter defaultSetter() { + return Setter(); + } + /** * Fluent interface that allows chained setting of properties that can be passed into a {@link HystrixThreadPool} via a {@link HystrixCommand} constructor to inject instance specific property * overrides.