From 590bd5c0841f240586a5d8e249688e0826933650 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 28 Apr 2016 16:50:03 -0700 Subject: [PATCH] Fixup warnings --- .../export/MetricCopyExporterTests.java | 19 ++++++++++++------- .../AbstractViewResolverProperties.java | 2 +- .../thymeleaf/ThymeleafAutoConfiguration.java | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java index 4a12433da8..2bdc160b52 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java @@ -60,15 +60,20 @@ public class MetricCopyExporterTests { } @Test - public void counterWithGaugeWriter() { + public void counterWithGaugeWriter() throws Exception { SimpleGaugeWriter writer = new SimpleGaugeWriter(); MetricCopyExporter exporter = new MetricCopyExporter(this.reader, writer); - this.reader.increment(new Delta("counter.foo", 2)); - exporter.export(); - this.reader.increment(new Delta("counter.foo", 3)); - exporter.export(); - exporter.flush(); - assertThat(writer.getValue().getValue()).isEqualTo(5L); + try { + this.reader.increment(new Delta("counter.foo", 2)); + exporter.export(); + this.reader.increment(new Delta("counter.foo", 3)); + exporter.export(); + exporter.flush(); + assertThat(writer.getValue().getValue()).isEqualTo(5L); + } + finally { + exporter.close(); + } } @Test diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java index 54ad7fab55..7c5ac54c38 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java @@ -101,7 +101,7 @@ public abstract class AbstractViewResolverProperties { } public MimeType getContentType() { - if (this.contentType.getCharSet() == null) { + if (this.contentType.getCharset() == null) { Map parameters = new LinkedHashMap(); parameters.put("charset", this.charset.name()); parameters.putAll(this.contentType.getParameters()); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index 42833b68c2..f89c066030 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -253,7 +253,7 @@ public class ThymeleafAutoConfiguration { } private String appendCharset(MimeType type, String charset) { - if (type.getCharSet() != null) { + if (type.getCharset() != null) { return type.toString(); } LinkedHashMap parameters = new LinkedHashMap();