Clean up warnings across code base

This commit is contained in:
Sam Brannen
2017-01-07 01:44:55 +01:00
parent 055da43e30
commit 9ed66bf2eb
51 changed files with 167 additions and 214 deletions

View File

@@ -23,6 +23,7 @@ import org.aspectj.lang.annotation.SuppressAjWarnings;
*/
public aspect CodeStyleAspect {
@SuppressWarnings("unused")
private String foo;
pointcut somePC() : call(* someMethod());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,22 +16,25 @@
package org.springframework.beans.factory.aspectj;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
/**
* @author Chris Beams
*/
public class XmlBeanConfigurerTests {
@Test
public void testInjection() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"org/springframework/beans/factory/aspectj/beanConfigurerTests.xml");
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
Assert.assertEquals("Rod", myObject.getName());
public void injection() {
try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"org/springframework/beans/factory/aspectj/beanConfigurerTests.xml")) {
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
assertEquals("Rod", myObject.getName());
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
package org.springframework.context.annotation.aspectj;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.aspectj.ShouldBeConfiguredBySpring;
@@ -24,6 +23,8 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import static org.junit.Assert.*;
/**
* Tests that @EnableSpringConfigured properly registers an
* {@link org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect},
@@ -35,10 +36,11 @@ import org.springframework.context.annotation.ImportResource;
public class AnnotationBeanConfigurerTests {
@Test
public void testInjection() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
Assert.assertEquals("Rod", myObject.getName());
public void injection() {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class)) {
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
assertEquals("Rod", myObject.getName());
}
}