Skip to content
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

Removed methods and variables with unused annotation #1154

Merged
merged 2 commits into from
Mar 21, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public HystrixGeneratedCacheKey generateCacheKey(CacheInvocationContext<? extend
MethodExecutionAction cacheKeyMethod = cacheInvocationContext.getCacheKeyMethod();
if (cacheKeyMethod != null) {
try {
HystrixGeneratedCacheKey cacheKey = new DefaultHystrixGeneratedCacheKey((String) cacheKeyMethod.execute(cacheInvocationContext.getExecutionType()));
return cacheKey;
return new DefaultHystrixGeneratedCacheKey((String) cacheKeyMethod.execute(cacheInvocationContext.getExecutionType()));
} catch (Throwable throwable) {
throw new HystrixCacheKeyGenerationException(throwable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ public boolean isRunning() {
/**
* Used to protect against leaking ExecutorServices and threads if this class is abandoned for GC without shutting down.
*/
@SuppressWarnings("unused")
private final Object finalizerGuardian = new Object() {
protected void finalize() throws Throwable {
if (!executor.isShutdown()) {
logger.warn(HystrixMetricsPoller.class.getSimpleName() + " was not shutdown. Caught in Finalize Guardian and shutting down.");
try {
shutdown();
} catch (Exception e) {
logger.error("Failed to shutdown " + HystrixMetricsPoller.class.getSimpleName(), e);
}
}
};
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one does get called, just not within the Hystrix library. See http://stackoverflow.com/questions/6872857/how-does-a-finalizer-guardian-work-in-java for a full explanation of how this works. This one should stay.

public static interface MetricsAsJsonPollerListener {
public void handleJsonMetric(String json);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
*/
public class HystrixThreadPoolMetrics extends HystrixMetrics {

@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(HystrixThreadPoolMetrics.class);

private static final HystrixEventType[] ALL_COMMAND_EVENT_TYPES = HystrixEventType.values();
private static final HystrixEventType.ThreadPool[] ALL_THREADPOOL_EVENT_TYPES = HystrixEventType.ThreadPool.values();
private static final int NUMBER_THREADPOOL_EVENT_TYPES = ALL_THREADPOOL_EVENT_TYPES.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ private static HystrixProperty<Integer> getProperty(String propertyPrefix, Hystr
.build();
}

@SuppressWarnings("unused")
private static HystrixProperty<Boolean> getProperty(String propertyPrefix, HystrixThreadPoolKey key, String instanceProperty, Boolean builderOverrideValue, Boolean defaultValue) {
return forBoolean()
.add(propertyPrefix + ".threadpool." + key.name() + "." + instanceProperty, builderOverrideValue)
.add(propertyPrefix + ".threadpool.default." + instanceProperty, defaultValue)
.build();
}

@SuppressWarnings("unused")
private static HystrixProperty<String> getProperty(String propertyPrefix, HystrixThreadPoolKey key, String instanceProperty, String builderOverrideValue, String defaultValue) {
return forString()
.add(propertyPrefix + ".threadpool." + key.name() + "." + instanceProperty, builderOverrideValue)
.add(propertyPrefix + ".threadpool.default." + instanceProperty, defaultValue)
.build();
}

/**
* Core thread-pool size that gets passed to {@link ThreadPoolExecutor#setCorePoolSize(int)}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
* @ThreadSafe
*/
public class HystrixRollingNumber {
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(HystrixRollingNumber.class);

private static final Time ACTUAL_TIME = new ActualTime();
private final Time time;
Expand Down