language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/ResourceConverter.java
@@ -25,6 +25,7 @@ */ public class ResourceConverter implements Converter<String, Resource> { + @Override public Resource convert(String source) { return new FileSystemResource(source + ".xml"); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/Service.java
@@ -40,10 +40,12 @@ public class Service implements ApplicationContextAware, MessageSourceAware, Dis private boolean properlyDestroyed = false; + @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; } + @Override public void setMessageSource(MessageSource messageSource) { if (this.messageSource != null) { throw new IllegalArgumentException("MessageSource should not be set twice"); @@ -64,9 +66,11 @@ public Resource[] getResources() { } + @Override public void destroy() { this.properlyDestroyed = true; Thread thread = new Thread() { + @Override public void run() { Assert.isTrue(applicationContext.getBean("messageSource") instanceof StaticMessageSource); try {
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/SimpleThreadScopeTest.java
@@ -49,11 +49,13 @@ public void getFromScope() throws Exception { public void getMultipleInstances() throws Exception { final TestBean[] beans = new TestBean[2]; Thread thread1 = new Thread(new Runnable() { + @Override public void run() { beans[0] = applicationContext.getBean("threadScopedObject", TestBean.class); } }); Thread thread2 = new Thread(new Runnable() { + @Override public void run() { beans[1] = applicationContext.getBean("threadScopedObject", TestBean.class); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java
@@ -43,6 +43,7 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio protected StaticApplicationContext sac; /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext(); Map<String, String> m = new HashMap<String, String>(); @@ -73,10 +74,12 @@ protected ConfigurableApplicationContext createContext() throws Exception { } /** Overridden */ + @Override public void testCount() { assertCount(15); } + @Override public void testEvents() throws Exception { TestApplicationEventMulticaster.counter = 0; super.testEvents(); @@ -88,6 +91,7 @@ public static class TestApplicationEventMulticaster extends SimpleApplicationEve private static int counter = 0; + @Override public void multicastEvent(ApplicationEvent event) { super.multicastEvent(event); counter++;
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java
@@ -39,6 +39,7 @@ public class StaticApplicationContextTests extends AbstractApplicationContextTes protected StaticApplicationContext sac; /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext(); Map<String, String> m = new HashMap<String, String>(); @@ -66,6 +67,7 @@ protected ConfigurableApplicationContext createContext() throws Exception { } /** Overridden */ + @Override public void testCount() { assertCount(15); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java
@@ -49,11 +49,13 @@ public class StaticMessageSourceTests extends AbstractApplicationContextTests { protected StaticApplicationContext sac; /** Overridden */ + @Override public void testCount() { // These are only checked for current Ctx (not parent ctx) assertCount(15); } + @Override public void testMessageSource() throws NoSuchMessageException { // Do nothing here since super is looking for errorCodes we // do NOT have in the Context @@ -195,6 +197,7 @@ public void testMessageSourceResolvable() { } /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java
@@ -28,6 +28,7 @@ protected Object createMainInterceptor() { return new NoOpAdvice(); } + @Override public void setBeanFactory(BeanFactory beanFactory) { }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/core/task/NoOpRunnable.java
@@ -23,6 +23,7 @@ */ public class NoOpRunnable implements Runnable { + @Override public void run() { // explicit no-op System.out.println("Running");
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
@@ -57,6 +57,7 @@ public void testLookupFailure() throws Exception { final NamingException nex = new NamingException(); final String jndiName= "foobar"; JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { assertTrue(jndiName.equals(name)); throw nex; @@ -174,6 +175,7 @@ protected LocalSlsbInvokerInterceptor configuredInterceptor(final Context mockCt LocalSlsbInvokerInterceptor si = new LocalSlsbInvokerInterceptor(); si.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() throws NamingException { return mockCtx; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java
@@ -52,6 +52,7 @@ public void testInvokesMethod() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -85,6 +86,7 @@ public void testInvokesMethodOnEjb3StyleBean() throws Exception { replay(myEjb); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -117,6 +119,7 @@ public void testCreateException() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals(jndiName)); @@ -158,6 +161,7 @@ public void testNoBusinessInterfaceSpecified() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName));
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
@@ -63,6 +63,7 @@ private SimpleRemoteSlsbInvokerInterceptor configuredInterceptor( SimpleRemoteSlsbInvokerInterceptor si = createInterceptor(); si.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() { return mockCtx; } @@ -121,6 +122,7 @@ public void testLookupFailure() throws Exception { final NamingException nex = new NamingException(); final String jndiName = "foobar"; JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { assertTrue(jndiName.equals(name)); throw nex;
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java
@@ -38,10 +38,12 @@ */ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRemoteSlsbInvokerInterceptorTests { + @Override protected SimpleRemoteSlsbInvokerInterceptor createInterceptor() { return new SimpleRemoteStatelessSessionProxyFactoryBean(); } + @Override protected Object configuredProxy(SimpleRemoteSlsbInvokerInterceptor si, Class<?> ifc) throws NamingException { SimpleRemoteStatelessSessionProxyFactoryBean fb = (SimpleRemoteStatelessSessionProxyFactoryBean) si; fb.setBusinessInterface(ifc); @@ -64,6 +66,7 @@ public void testInvokesMethod() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -97,6 +100,7 @@ public void testInvokesMethodOnEjb3StyleBean() throws Exception { replay(myEjb); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -119,6 +123,7 @@ public Object lookup(String name) { verify(myEjb); } + @Override @Test public void testRemoteException() throws Exception { final RemoteException rex = new RemoteException(); @@ -136,6 +141,7 @@ public void testRemoteException() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -175,6 +181,7 @@ public void testCreateException() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals(jndiName)); @@ -216,6 +223,7 @@ public void testCreateExceptionWithLocalBusinessInterface() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals(jndiName)); @@ -257,6 +265,7 @@ public void testNoBusinessInterfaceSpecified() throws Exception { replay(home); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals(jndiName));
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/format/number/NumberFormattingTests.java
@@ -48,6 +48,7 @@ public class NumberFormattingTests { public void setUp() { DefaultConversionService.addDefaultConverters(conversionService); conversionService.setEmbeddedValueResolver(new StringValueResolver() { + @Override public String resolveStringValue(String strVal) { if ("${pattern}".equals(strVal)) { return "#,##.00";
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java
@@ -149,10 +149,12 @@ public void setSpecialInt(int field) { private static class TestBeanFormatter implements Formatter<TestBean> { + @Override public String print(TestBean object, Locale locale) { return String.valueOf(object.getSpecialInt()); } + @Override public TestBean parse(String text, Locale locale) throws ParseException { TestBean object = new TestBean(); object.setSpecialInt(Integer.parseInt(text)); @@ -169,20 +171,25 @@ public SpecialIntAnnotationFormatterFactory() { fieldTypes.add(Integer.class); } + @Override public Set<Class<?>> getFieldTypes() { return fieldTypes; } + @Override public Printer<?> getPrinter(SpecialInt annotation, Class<?> fieldType) { return new Printer<Integer>() { + @Override public String print(Integer object, Locale locale) { return ":" + object.toString(); } }; } + @Override public Parser<?> getParser(SpecialInt annotation, Class<?> fieldType) { return new Parser<Integer>() { + @Override public Integer parse(String text, Locale locale) throws ParseException { return Integer.parseInt(text.substring(1)); } @@ -192,6 +199,7 @@ public Integer parse(String text, Locale locale) throws ParseException { private static class TestFormatterRegistrar implements FormatterRegistrar { + @Override public void registerFormatters(FormatterRegistry registry) { registry.addFormatter(new TestBeanFormatter()); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java
@@ -86,6 +86,7 @@ public void testFormatFieldForTypeWithFormatter() throws ParseException { @Test public void testFormatFieldForTypeWithPrinterParserWithCoercion() throws ParseException { formattingService.addConverter(new Converter<DateTime, LocalDate>() { + @Override public LocalDate convert(DateTime source) { return source.toLocalDate(); } @@ -170,11 +171,13 @@ public void testFormatFieldForAnnotationWithPlaceholdersAndFactoryBean() throws @SuppressWarnings("unchecked") private void doTestFormatFieldForAnnotation(Class<?> modelClass, boolean directFieldAccess) throws Exception { formattingService.addConverter(new Converter<Date, Long>() { + @Override public Long convert(Date source) { return source.getTime(); } }); formattingService.addConverter(new Converter<DateTime, Date>() { + @Override public Date convert(DateTime source) { return source.toDate(); } @@ -277,17 +280,20 @@ public void testParseEmptyStringDefault() throws ParseException { @Test public void testFormatFieldForAnnotationWithSubclassAsFieldType() throws Exception { formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory() { + @Override public Printer<?> getPrinter(org.springframework.format.annotation.DateTimeFormat annotation, Class<?> fieldType) { assertEquals(MyDate.class, fieldType); return super.getPrinter(annotation, fieldType); } }); formattingService.addConverter(new Converter<MyDate, Long>() { + @Override public Long convert(MyDate source) { return source.getTime(); } }); formattingService.addConverter(new Converter<MyDate, Date>() { + @Override public Date convert(MyDate source) { return source; } @@ -364,10 +370,12 @@ public void setDates(List<Date> dates) { public static class NullReturningFormatter implements Formatter<Integer> { + @Override public String print(Integer object, Locale locale) { return null; } + @Override public Integer parse(String text, Locale locale) throws ParseException { return null; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaverTests.java
@@ -46,6 +46,7 @@ public void testCtorWithClassLoaderThatDoesNotExposeAGetThrowawayClassLoaderMeth JustAddTransformerClassLoader classLoader = new JustAddTransformerClassLoader(); ReflectiveLoadTimeWeaver weaver = new ReflectiveLoadTimeWeaver(classLoader); weaver.addTransformer(new ClassFileTransformer() { + @Override public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { return "CAFEDEAD".getBytes(); } @@ -97,6 +98,7 @@ public static final class TotallyCompliantClassLoader extends JustAddTransformer private int numTimesGetThrowawayClassLoaderCalled = 0; + @Override public int getNumTimesGetThrowawayClassLoaderCalled() { return this.numTimesGetThrowawayClassLoaderCalled; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/AbstractJmxTests.java
@@ -31,10 +31,12 @@ public abstract class AbstractJmxTests extends AbstractMBeanServerTests { private ConfigurableApplicationContext ctx; + @Override protected final void onSetUp() throws Exception { ctx = loadContext(getApplicationContextPath()); } + @Override protected final void onTearDown() throws Exception { if (ctx != null) { ctx.close();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java
@@ -45,6 +45,7 @@ public abstract class AbstractMBeanServerTests extends TestCase { protected MBeanServer server; + @Override public final void setUp() throws Exception { this.server = MBeanServerFactory.createMBeanServer(); try { @@ -63,6 +64,7 @@ protected ConfigurableApplicationContext loadContext(String configLocation) { return ctx; } + @Override protected void tearDown() throws Exception { releaseServer(); onTearDown();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java
@@ -43,17 +43,20 @@ public class JmxTestBean implements IJmxTestBean { * @@org.springframework.jmx.export.metadata.ManagedAttribute * (description="The Age Attribute", currencyTimeLimit=15) */ + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } /** * @@org.springframework.jmx.export.metadata.ManagedOperation(currencyTimeLimit=30) */ + @Override public long myOperation() { return 1L; } @@ -63,6 +66,7 @@ public long myOperation() { * (description="The Name Attribute", currencyTimeLimit=20, * defaultValue="bar", persistPolicy="OnUpdate") */ + @Override public void setName(String name) throws Exception { if ("Juergen".equals(name)) { throw new IllegalArgumentException("Juergen"); @@ -80,6 +84,7 @@ public void setName(String name) throws Exception { * @@org.springframework.jmx.export.metadata.ManagedAttribute * (defaultValue="foo", persistPeriod=300) */ + @Override public String getName() { return name; } @@ -117,13 +122,15 @@ public boolean isSuperman() { * @@org.springframework.jmx.export.metadata.ManagedOperationParameter(index=0, name="x", description="Left operand") * @@org.springframework.jmx.export.metadata.ManagedOperationParameter(index=1, name="y", description="Right operand") */ + @Override public int add(int x, int y) { return x + y; } /** * Test method that is not exposed by the MetadataAssembler. */ + @Override public void dontExposeMe() { throw new RuntimeException(); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java
@@ -50,6 +50,7 @@ public class MBeanClientInterceptorTests extends AbstractMBeanServerTests { protected boolean runTests = true; + @Override public void onSetUp() throws Exception { target = new JmxTestBean(); target.setAge(100); @@ -277,17 +278,20 @@ public void testMXBeanAttributeListAccess() throws Exception { private static class ProxyTestAssembler extends AbstractReflectiveMBeanInfoAssembler { + @Override protected boolean includeReadAttribute(Method method, String beanKey) { return true; } + @Override protected boolean includeWriteAttribute(Method method, String beanKey) { if ("setAge".equals(method.getName())) { return false; } return true; } + @Override protected boolean includeOperation(Method method, String beanKey) { if ("dontExposeMe".equals(method.getName())) { return false;
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java
@@ -46,6 +46,7 @@ public class RemoteMBeanClientInterceptorTestsIgnore extends MBeanClientIntercep private JMXConnector connector; + @Override public void onSetUp() throws Exception { super.onSetUp(); this.connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(getServiceUrl(), null, getServer()); @@ -61,11 +62,13 @@ private JMXServiceURL getServiceUrl() throws MalformedURLException { return new JMXServiceURL(SERVICE_URL); } + @Override protected MBeanServerConnection getServerConnection() throws Exception { this.connector = JMXConnectorFactory.connect(getServiceUrl()); return this.connector.getMBeanServerConnection(); } + @Override public void tearDown() throws Exception { if (this.connector != null) { this.connector.close();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java
@@ -31,6 +31,7 @@ public class CustomEditorConfigurerTests extends AbstractJmxTests { private final SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd"); + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/customConfigurer.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterOperationsTests.java
@@ -67,6 +67,7 @@ public void testRegisterManagedResourceWithGeneratedObjectName() throws Exceptio MBeanExporter exporter = new MBeanExporter(); exporter.setServer(getServer()); exporter.setNamingStrategy(new ObjectNamingStrategy() { + @Override public ObjectName getObjectName(Object managedBean, String beanKey) { return objectNameTemplate; } @@ -92,6 +93,7 @@ public void testRegisterManagedResourceWithGeneratedObjectNameWithoutUniqueness( exporter.setServer(getServer()); exporter.setEnsureUniqueRuntimeObjectNames(false); exporter.setNamingStrategy(new ObjectNamingStrategy() { + @Override public ObjectName getObjectName(Object managedBean, String beanKey) { return objectNameTemplate; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java
@@ -98,6 +98,7 @@ public void testRegisterNullNotificationListenerType() throws Exception { public void testRegisterNotificationListenerForNonExistentMBean() throws Exception { Map listeners = new HashMap(); NotificationListener dummyListener = new NotificationListener() { + @Override public void handleNotification(Notification notification, Object handback) { throw new UnsupportedOperationException(); } @@ -666,6 +667,7 @@ private static class InvokeDetectAssembler implements MBeanInfoAssembler { private boolean invoked = false; + @Override public ModelMBeanInfo getMBeanInfo(Object managedResource, String beanKey) throws JMException { invoked = true; return null; @@ -678,10 +680,12 @@ private static class MockMBeanExporterListener implements MBeanExporterListener private List<ObjectName> unregistered = new ArrayList<ObjectName>(); + @Override public void mbeanRegistered(ObjectName objectName) { registered.add(objectName); } + @Override public void mbeanUnregistered(ObjectName objectName) { unregistered.add(objectName); } @@ -703,6 +707,7 @@ public void setObjectName(ObjectName objectName) { this.objectName = objectName; } + @Override public ObjectName getObjectName() throws MalformedObjectNameException { return this.objectName; } @@ -717,6 +722,7 @@ public static class Person implements PersonMBean { private String name; + @Override public String getName() { return name; } @@ -730,6 +736,7 @@ public static final class StubNotificationListener implements NotificationListen private List<Notification> notifications = new ArrayList<Notification>(); + @Override public void handleNotification(Notification notification, Object handback) { this.notifications.add(notification); } @@ -756,6 +763,7 @@ public NamedBeanAutodetectCapableMBeanInfoAssemblerStub(String namedBean) { this.namedBean = namedBean; } + @Override public boolean includeBean(Class<?> beanClass, String beanName) { return this.namedBean.equals(beanName); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java
@@ -158,6 +158,7 @@ public void testRegisterNotificationListenerWithFilter() throws Exception { NotificationListenerBean listenerBean = new NotificationListenerBean(); listenerBean.setNotificationListener(listener); listenerBean.setNotificationFilter(new NotificationFilter() { + @Override public boolean isNotificationEnabled(Notification notification) { if (notification instanceof AttributeChangeNotification) { AttributeChangeNotification changeNotification = (AttributeChangeNotification) notification; @@ -434,6 +435,7 @@ private static class CountingAttributeChangeNotificationListener implements Noti private Map attributeHandbacks = new HashMap(); + @Override public void handleNotification(Notification notification, Object handback) { if (notification instanceof AttributeChangeNotification) { AttributeChangeNotification attNotification = (AttributeChangeNotification) notification; @@ -473,6 +475,7 @@ public void setObjectName(ObjectName objectName) { this.objectName = objectName; } + @Override public ObjectName getObjectName() throws MalformedObjectNameException { return this.objectName; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/NotificationPublisherTests.java
@@ -119,6 +119,7 @@ private static class CountingNotificationListener implements NotificationListene private Notification lastNotification; + @Override public void handleNotification(Notification notification, Object handback) { this.lastNotification = notification; this.count++; @@ -139,6 +140,7 @@ public static class MyNotificationPublisher implements NotificationPublisherAwar private NotificationPublisher notificationPublisher; + @Override public void setNotificationPublisher(NotificationPublisher notificationPublisher) { this.notificationPublisher = notificationPublisher; } @@ -158,28 +160,34 @@ public String getName() { public static class MyNotificationPublisherMBean extends NotificationBroadcasterSupport implements DynamicMBean { + @Override public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { return null; } + @Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { } + @Override public AttributeList getAttributes(String[] attributes) { return null; } + @Override public AttributeList setAttributes(AttributeList attributes) { return null; } + @Override public Object invoke(String actionName, Object params[], String signature[]) throws MBeanException, ReflectionException { return null; } + @Override public MBeanInfo getMBeanInfo() { return new MBeanInfo(MyNotificationPublisherMBean.class.getName(), "", new MBeanAttributeInfo[0], new MBeanConstructorInfo[0], new MBeanOperationInfo[0], new MBeanNotificationInfo[0]); @@ -192,6 +200,7 @@ public void sendNotification() { public static class MyNotificationPublisherStandardMBean extends NotificationBroadcasterSupport implements MyMBean { + @Override public void sendNotification() { sendNotification(new Notification("test", this, 1)); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java
@@ -26,6 +26,7 @@ */ public class PropertyPlaceholderConfigurerTests extends AbstractJmxTests { + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/propertyPlaceholderConfigurer.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/TestDynamicMBean.java
@@ -37,28 +37,34 @@ public void setFailOnInit(boolean failOnInit) { } } + @Override public Object getAttribute(String attribute) { if ("Name".equals(attribute)) { return "Rob Harrop"; } return null; } + @Override public void setAttribute(Attribute attribute) { } + @Override public AttributeList getAttributes(String[] attributes) { return null; } + @Override public AttributeList setAttributes(AttributeList attributes) { return null; } + @Override public Object invoke(String actionName, Object[] params, String[] signature) { return null; } + @Override public MBeanInfo getMBeanInfo() { MBeanAttributeInfo attr = new MBeanAttributeInfo("name", "java.lang.String", "", true, false, false); return new MBeanInfo(
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java
@@ -48,18 +48,22 @@ public void testOperationOnGetter() throws Exception { assertNotNull(op); } + @Override protected JmxAttributeSource getAttributeSource() { return new AnnotationJmxAttributeSource(); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected IJmxTestBean createJmxTestBean() { return new AnnotationTestSubBean(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/annotation/annotations.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java
@@ -40,20 +40,24 @@ public class AnnotationTestBean implements IJmxTestBean { private boolean isSuperman; + @Override @ManagedAttribute(description = "The Age Attribute", currencyTimeLimit = 15) public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } + @Override @ManagedOperation(currencyTimeLimit = 30) public long myOperation() { return 1L; } + @Override @ManagedAttribute(description = "The Name Attribute", currencyTimeLimit = 20, defaultValue = "bar", @@ -62,6 +66,7 @@ public void setName(String name) { this.name = name; } + @Override @ManagedAttribute(defaultValue = "foo", persistPeriod = 300) public String getName() { return name; @@ -85,6 +90,7 @@ public boolean isSuperman() { return isSuperman; } + @Override @org.springframework.jmx.export.annotation.ManagedOperation(description = "Add Two Numbers Together") @ManagedOperationParameters({@ManagedOperationParameter(name="x", description="Left operand"), @ManagedOperationParameter(name="y", description="Right operand")}) @@ -95,6 +101,7 @@ public int add(int x, int y) { /** * Test method that is not exposed by the MetadataAssembler. */ + @Override public void dontExposeMe() { throw new RuntimeException(); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBeanFactory.java
@@ -30,14 +30,17 @@ public AnnotationTestBeanFactory() { this.instance.setName("FACTORY"); } + @Override public FactoryCreatedAnnotationTestBean getObject() throws Exception { return this.instance; } + @Override public Class<? extends IJmxTestBean> getObjectType() { return FactoryCreatedAnnotationTestBean.class; } + @Override public boolean isSingleton() { return true; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestSubBean.java
@@ -38,17 +38,21 @@ public int getAge() { return super.getAge(); } + @Override public String getColour() { return this.colour; } + @Override public void setColour(String colour) { this.colour = colour; } + @Override public void fromInterface() { } + @Override public int getExpensiveToCalculate() { return Integer.MAX_VALUE; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java
@@ -54,6 +54,7 @@ public static interface FooNotMXBean { public static class FooNotX implements FooNotMXBean { + @Override public String getName() { return "Rob Harrop"; } @@ -69,6 +70,7 @@ public static interface FooIfc { public static class FooX implements FooIfc { + @Override public String getName() { return "Rob Harrop"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java
@@ -23,6 +23,7 @@ */ public abstract class AbstractMetadataAssemblerAutodetectTests extends AbstractAutodetectTests { + @Override protected AutodetectCapableMBeanInfoAssembler getAssembler() { MetadataMBeanInfoAssembler assembler = new MetadataMBeanInfoAssembler(); assembler.setAttributeSource(getAttributeSource());
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java
@@ -204,12 +204,15 @@ public void testMetricDescriptorDefaults() throws Exception { assertNull("Metric Category should not be populated", desc.getFieldValue("metricCategory")); } + @Override protected abstract String getObjectName(); + @Override protected int getExpectedAttributeCount() { return 6; } + @Override protected int getExpectedOperationCount() { return 9; } @@ -218,6 +221,7 @@ protected IJmxTestBean createJmxTestBean() { return new JmxTestBean(); } + @Override protected MBeanInfoAssembler getAssembler() { MetadataMBeanInfoAssembler assembler = new MetadataMBeanInfoAssembler(); assembler.setAttributeSource(getAttributeSource());
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java
@@ -26,18 +26,22 @@ public class InterfaceBasedMBeanInfoAssemblerCustomTests extends AbstractJmxAsse protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 5; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { InterfaceBasedMBeanInfoAssembler assembler = new InterfaceBasedMBeanInfoAssembler(); assembler.setManagedInterfaces(new Class<?>[] {ICustomJmxBean.class}); @@ -52,6 +56,7 @@ public void testGetAgeIsReadOnly() throws Exception { assertFalse(attr.isWritable()); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssemblerCustom.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java
@@ -75,24 +75,29 @@ public void testNickNameIsExposed() throws Exception { assertNickName(attr); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { return getWithMapping( "org.springframework.jmx.export.assembler.IAdditionalTestMethods, " + "org.springframework.jmx.export.assembler.ICustomJmxBean"); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssemblerMapped.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java
@@ -21,22 +21,27 @@ */ public class InterfaceBasedMBeanInfoAssemblerTests extends AbstractJmxAssemblerTests { + @Override protected String getObjectName() { return "bean:name=testBean4"; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { return new InterfaceBasedMBeanInfoAssembler(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssembler.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerComboTests.java
@@ -45,22 +45,27 @@ public void testNickNameIsExposed() throws Exception { assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerCombo.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerMappedTests.java
@@ -44,22 +44,27 @@ public void testNickNameIsExposed() throws Exception { assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerMapped.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerNotMappedTests.java
@@ -45,22 +45,27 @@ public void testNickNameIsExposed() throws Exception { assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 11; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerNotMapped.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java
@@ -33,22 +33,27 @@ public class MethodExclusionMBeanInfoAssemblerTests extends AbstractJmxAssembler private static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 9; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssembler.xml"; } + @Override protected MBeanInfoAssembler getAssembler() { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); assembler.setIgnoredMethods(new String[] {"dontExposeMe", "setSuperman"});
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java
@@ -54,22 +54,27 @@ public void testNickNameIsExposed() throws Exception { assertNickName(attr); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { return getWithMapping("getNickName,setNickName,add,myOperation,getName,setName,getAge"); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodNameAssemblerMapped.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java
@@ -26,18 +26,22 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 5; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { MethodNameBasedMBeanInfoAssembler assembler = new MethodNameBasedMBeanInfoAssembler(); assembler.setManagedMethods(new String[] {"add", "myOperation", "getName", "setName", "getAge"}); @@ -52,6 +56,7 @@ public void testGetAgeIsReadOnly() throws Exception { assertFalse(attr.isWritable()); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodNameAssembler.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java
@@ -26,22 +26,27 @@ public class ReflectiveAssemblerTests extends AbstractJmxAssemblerTests { protected static final String OBJECT_NAME = "bean:name=testBean1"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 11; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected MBeanInfoAssembler getAssembler() { return new SimpleReflectiveMBeanInfoAssembler(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/reflectiveAssembler.xml"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java
@@ -23,18 +23,22 @@ public class KeyNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "spring:name=test"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { return new KeyNamingStrategy(); } + @Override protected Object getManagedResource() { return new Object(); } + @Override protected String getKey() { return OBJECT_NAME; } + @Override protected String getCorrectObjectName() { return OBJECT_NAME; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java
@@ -23,6 +23,7 @@ */ public class PropertiesFileNamingStrategyTests extends PropertiesNamingStrategyTests { + @Override protected ObjectNamingStrategy getStrategy() throws Exception { KeyNamingStrategy strat = new KeyNamingStrategy(); strat.setMappingLocation(new ClassPathResource("jmx-names.properties", getClass()));
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java
@@ -26,6 +26,7 @@ public class PropertiesNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "bean:name=namingTest"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { KeyNamingStrategy strat = new KeyNamingStrategy(); Properties mappings = new Properties(); @@ -35,14 +36,17 @@ protected ObjectNamingStrategy getStrategy() throws Exception { return strat; } + @Override protected Object getManagedResource() { return new Object(); } + @Override protected String getKey() { return "namingTest"; } + @Override protected String getCorrectObjectName() { return OBJECT_NAME; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisherTests.java
@@ -113,10 +113,12 @@ public Notification getActualNotification() { return this.actualNotification; } + @Override public void sendNotification(Notification notification) throws RuntimeOperationsException { this.actualNotification = notification; } + @Override public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws RuntimeOperationsException { this.actualNotification = notification; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java
@@ -151,28 +151,35 @@ public StandardMBeanImpl() throws NotCompliantMBeanException { super(IJmxTestBean.class); } + @Override public int add(int x, int y) { return 0; } + @Override public long myOperation() { return 0; } + @Override public int getAge() { return 0; } + @Override public void setAge(int age) { } + @Override public void setName(String name) { } + @Override public String getName() { return null; } + @Override public void dontExposeMe() { } } @@ -186,6 +193,7 @@ public static interface FooMBean { public static class Foo implements FooMBean { + @Override public String getName() { return "Rob Harrop"; } @@ -200,6 +208,7 @@ public static interface FooMXBean { public static class FooX implements FooMXBean { + @Override public String getName() { return "Rob Harrop"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java
@@ -233,6 +233,7 @@ public void testLookupWithProxyInterfaceAndLazyLookup() throws Exception { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -259,6 +260,7 @@ public void testLookupWithProxyInterfaceWithNotCache() throws Exception { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -287,6 +289,7 @@ public void testLookupWithProxyInterfaceWithLazyLookupAndNotCache() throws Excep JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -386,6 +389,7 @@ public void testLookupWithExposeAccessContext() throws Exception { expectLastCall().times(2); replay(mockCtx); jof.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() { return mockCtx; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java
@@ -42,6 +42,7 @@ public void testLookupSucceeds() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -62,6 +63,7 @@ public void testLookupFails() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -86,6 +88,7 @@ public void testLookupReturnsNull() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -111,6 +114,7 @@ public void testLookupFailsWithTypeMismatch() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -136,6 +140,7 @@ public void testBind() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -155,6 +160,7 @@ public void testRebind() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -173,6 +179,7 @@ public void testUnbind() throws Exception { replay(context); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/jndi/SimpleNamingContextTests.java
@@ -219,38 +219,47 @@ public void testCreateInitialContext() throws Exception { class StubDataSource implements DataSource { + @Override public Connection getConnection() throws SQLException { return null; } + @Override public Connection getConnection(String username, String password) throws SQLException { return null; } + @Override public PrintWriter getLogWriter() throws SQLException { return null; } + @Override public int getLoginTimeout() throws SQLException { return 0; } + @Override public void setLogWriter(PrintWriter arg0) throws SQLException { } + @Override public void setLoginTimeout(int arg0) throws SQLException { } + @Override public boolean isWrapperFor(Class<?> arg0) throws SQLException { return false; } + @Override public <T> T unwrap(Class<T> arg0) throws SQLException { return null; } + @Override public Logger getParentLogger() { return null; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java
@@ -70,6 +70,7 @@ public void addObject(String name, Object object) { * return the object provided in the constructor. If the name is * unexpected, a respective NamingException gets thrown. */ + @Override public Object lookup(String name) throws NamingException { Object object = this.jndiObjects.get(name); if (object == null) {
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java
@@ -91,13 +91,15 @@ public SimpleNamingContext(String root, Hashtable<String, Object> boundObjects, // Actual implementations of Context methods follow + @Override public NamingEnumeration<NameClassPair> list(String root) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Listing name/class pairs under [" + root + "]"); } return new NameClassPairEnumeration(this, root); } + @Override public NamingEnumeration<Binding> listBindings(String root) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Listing bindings under [" + root + "]"); @@ -111,6 +113,7 @@ public NamingEnumeration<Binding> listBindings(String root) throws NamingExcepti * Will be used by any standard InitialContext JNDI lookups. * @throws javax.naming.NameNotFoundException if the object could not be found */ + @Override public Object lookup(String lookupName) throws NameNotFoundException { String name = this.root + lookupName; if (logger.isDebugEnabled()) { @@ -136,6 +139,7 @@ public Object lookup(String lookupName) throws NameNotFoundException { return found; } + @Override public Object lookupLink(String name) throws NameNotFoundException { return lookup(name); } @@ -147,30 +151,35 @@ public Object lookupLink(String name) throws NameNotFoundException { * Use SimpleNamingContextBuilder to set up JNDI bindings then. * @see org.springframework.mock.jndi.SimpleNamingContextBuilder#bind */ + @Override public void bind(String name, Object obj) { if (logger.isInfoEnabled()) { logger.info("Static JNDI binding: [" + this.root + name + "] = [" + obj + "]"); } this.boundObjects.put(this.root + name, obj); } + @Override public void unbind(String name) { if (logger.isInfoEnabled()) { logger.info("Static JNDI remove: [" + this.root + name + "]"); } this.boundObjects.remove(this.root + name); } + @Override public void rebind(String name, Object obj) { bind(name, obj); } + @Override public void rename(String oldName, String newName) throws NameNotFoundException { Object obj = lookup(oldName); unbind(oldName); bind(newName, obj); } + @Override public Context createSubcontext(String name) { String subcontextName = this.root + name; if (!subcontextName.endsWith("/")) { @@ -181,84 +190,104 @@ public Context createSubcontext(String name) { return subcontext; } + @Override public void destroySubcontext(String name) { unbind(name); } + @Override public String composeName(String name, String prefix) { return prefix + name; } + @Override public Hashtable<String, Object> getEnvironment() { return this.environment; } + @Override public Object addToEnvironment(String propName, Object propVal) { return this.environment.put(propName, propVal); } + @Override public Object removeFromEnvironment(String propName) { return this.environment.remove(propName); } + @Override public void close() { } // Unsupported methods follow: no support for javax.naming.Name + @Override public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Object lookup(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Object lookupLink(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void bind(Name name, Object obj) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void unbind(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void rebind(Name name, Object obj) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void rename(Name oldName, Name newName) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Context createSubcontext(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void destroySubcontext(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public String getNameInNamespace() throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NameParser getNameParser(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NameParser getNameParser(String name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Name composeName(Name name, Name prefix) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } @@ -298,22 +327,27 @@ private AbstractNamingEnumeration(SimpleNamingContext context, String proot) thr protected abstract T createObject(String strippedName, Object obj); + @Override public boolean hasMore() { return this.iterator.hasNext(); } + @Override public T next() { return this.iterator.next(); } + @Override public boolean hasMoreElements() { return this.iterator.hasNext(); } + @Override public T nextElement() { return this.iterator.next(); } + @Override public void close() { } } @@ -325,6 +359,7 @@ private NameClassPairEnumeration(SimpleNamingContext context, String root) throw super(context, root); } + @Override protected NameClassPair createObject(String strippedName, Object obj) { return new NameClassPair(strippedName, obj.getClass().getName()); } @@ -337,6 +372,7 @@ private BindingEnumeration(SimpleNamingContext context, String root) throws Nami super(context, root); } + @Override protected Binding createObject(String strippedName, Object obj) { return new Binding(strippedName, obj); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
@@ -192,6 +192,7 @@ public void bind(String name, Object obj) { * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ + @Override public InitialContextFactory createInitialContextFactory(Hashtable<?,?> environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); @@ -225,6 +226,7 @@ else if (icf instanceof String) { // Default case... return new InitialContextFactory() { + @Override @SuppressWarnings("unchecked") public Context getInitialContext(Hashtable<?,?> environment) { return new SimpleNamingContext("", boundObjects, (Hashtable<String, Object>) environment);
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/remoting/rmi/RmiSupportTests.java
@@ -322,18 +322,23 @@ public void testRemoteInvocation() throws NoSuchMethodException { final Method setNameMethod = rb.getClass().getDeclaredMethod("setName", new Class<?>[] {String.class}); MethodInvocation mi = new MethodInvocation() { + @Override public Method getMethod() { return setNameMethod; } + @Override public Object[] getArguments() { return new Object[] {"bla"}; } + @Override public Object proceed() throws Throwable { throw new UnsupportedOperationException(); } + @Override public Object getThis() { return rb; } + @Override public AccessibleObject getStaticPart() { return setNameMethod; } @@ -363,11 +368,14 @@ public AccessibleObject getStaticPart() { public void testRmiInvokerWithSpecialLocalMethods() throws Exception { String serviceUrl = "rmi://localhost:1090/test"; RmiProxyFactoryBean factory = new RmiProxyFactoryBean() { + @Override protected Remote lookupStub() { return new RmiInvocationHandler() { + @Override public String getTargetInterfaceName() { return null; } + @Override public Object invoke(RemoteInvocation invocation) throws RemoteException { throw new RemoteException(); } @@ -400,6 +408,7 @@ private static class CountingRmiProxyFactoryBean extends RmiProxyFactoryBean { private int counter = 0; + @Override protected Remote lookupStub() { counter++; return new RemoteBean(); @@ -432,6 +441,7 @@ public static class RemoteBean implements IRemoteBean { private static String name; + @Override public void setName(String nam) throws RemoteException { if (nam != null && nam.endsWith("Exception")) { RemoteException rex = null;
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java
@@ -116,16 +116,19 @@ public static class TestBean implements ITestBean { private final CountDownLatch latch = new CountDownLatch(1); + @Override public Thread getThread() { return this.thread; } + @Override @Async public void test() { this.thread = Thread.currentThread(); this.latch.countDown(); } + @Override public void await(long timeout) { try { this.latch.await(timeout, TimeUnit.MILLISECONDS);
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java
@@ -248,10 +248,12 @@ public interface AsyncInterface { public static class AsyncInterfaceBean implements AsyncInterface { + @Override public void doSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); } + @Override public Future<String> returnSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); return new AsyncResult<String>(Integer.toString(i)); @@ -273,14 +275,17 @@ public interface AsyncMethodsInterface { public static class AsyncMethodsInterfaceBean implements AsyncMethodsInterface { + @Override public void doNothing(int i) { assertTrue(Thread.currentThread().getName().equals(originalThreadName)); } + @Override public void doSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); } + @Override public Future<String> returnSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); return new AsyncResult<String>(Integer.toString(i)); @@ -290,6 +295,7 @@ public Future<String> returnSomething(int i) { public static class AsyncMethodListener implements ApplicationListener<ApplicationEvent> { + @Override @Async public void onApplicationEvent(ApplicationEvent event) { listenerCalled++; @@ -305,6 +311,7 @@ public AsyncClassListener() { listenerConstructed++; } + @Override public void onApplicationEvent(ApplicationEvent event) { listenerCalled++; assertTrue(!Thread.currentThread().getName().equals(originalThreadName));
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java
@@ -247,6 +247,7 @@ public AsyncBean asyncBean() { return new AsyncBean(); } + @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("Custom-");
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java
@@ -216,6 +216,7 @@ public Object getScheduler() { return null; } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler1()); } @@ -318,6 +319,7 @@ public ThreadAwareWorker worker() { return new ThreadAwareWorker(); } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler2()); } @@ -378,6 +380,7 @@ public TaskScheduler taskScheduler2() { return scheduler; } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler2()); } @@ -410,10 +413,12 @@ public TaskScheduler taskScheduler() { return new ThreadPoolTaskScheduler(); } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler()); taskRegistrar.addFixedRateTask(new IntervalTask( new Runnable() { + @Override public void run() { worker().executedByThread = Thread.currentThread().getName(); } @@ -449,11 +454,13 @@ public TaskScheduler scheduler() { scheduler.initialize(); scheduler.schedule( new Runnable() { + @Override public void run() { counter().incrementAndGet(); } }, new Trigger() { + @Override public Date nextExecutionTime(TriggerContext triggerContext) { return new Date(new Date().getTime()+10); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java
@@ -65,6 +65,7 @@ public void testShutdownNowIsPropagatedToTheExecutorOnDestroy() throws Exception mockScheduledExecutorService.replay(); ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { return executor; } @@ -88,6 +89,7 @@ public void testShutdownIsPropagatedToTheExecutorOnDestroy() throws Exception { mockScheduledExecutorService.replay(); ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { return executor; } @@ -233,6 +235,7 @@ public void testWithInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectlyAfterEx @SuppressWarnings("serial") public void testSettingThreadFactoryToNullForcesUseOfDefaultButIsOtherwiseCool() throws Exception { ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { assertNotNull("Bah; the setThreadFactory(..) method must use a default ThreadFactory if a null arg is passed in."); return super.createExecutor(poolSize, threadFactory, rejectedExecutionHandler); @@ -250,6 +253,7 @@ protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory th @SuppressWarnings("serial") public void testSettingRejectedExecutionHandlerToNullForcesUseOfDefaultButIsOtherwiseCool() throws Exception { ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { assertNotNull("Bah; the setRejectedExecutionHandler(..) method must use a default RejectedExecutionHandler if a null arg is passed in."); return super.createExecutor(poolSize, threadFactory, rejectedExecutionHandler);
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java
@@ -239,6 +239,7 @@ private static class TestTask implements Runnable { this.latch = new CountDownLatch(expectedRunCount); } + @Override public void run() { lastThread = Thread.currentThread(); if (actualRunCount.incrementAndGet() > expectedRunCount) { @@ -259,6 +260,7 @@ private static class TestCallable implements Callable<String> { this.expectedRunCount = expectedRunCount; } + @Override public String call() throws Exception { if (actualRunCount.incrementAndGet() > expectedRunCount) { throw new RuntimeException("intentional test failure"); @@ -278,6 +280,7 @@ private static class TestErrorHandler implements ErrorHandler { this.latch = new CountDownLatch(expectedErrorCount); } + @Override public void handleError(Throwable t) { this.lastError = t; this.latch.countDown(); @@ -295,6 +298,7 @@ private static class TestTrigger implements Trigger { this.maxRunCount = maxRunCount; } + @Override public Date nextExecutionTime(TriggerContext triggerContext) { if (this.actualRunCount.incrementAndGet() > this.maxRunCount) { return null;
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java
@@ -56,6 +56,7 @@ public void defaultExecutor() throws Exception { assertEquals(60, getKeepAliveSeconds(executor)); assertEquals(false, getAllowCoreThreadTimeOut(executor)); FutureTask<String> task = new FutureTask<String>(new Callable<String>() { + @Override public String call() throws Exception { return "foo"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java
@@ -123,6 +123,7 @@ public void test() { static class TestTrigger implements Trigger { + @Override public Date nextExecutionTime(TriggerContext triggerContext) { return null; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/support/PeriodicTriggerTests.java
@@ -254,14 +254,17 @@ private static class TestTriggerContext implements TriggerContext { this.completion = completion; } + @Override public Date lastActualExecutionTime() { return this.actual; } + @Override public Date lastCompletionTime() { return this.completion; } + @Override public Date lastScheduledExecutionTime() { return this.scheduled; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java
@@ -50,27 +50,32 @@ public void testTimerFactoryBean() throws Exception { final List<Boolean> success = new ArrayList<Boolean>(3); final Timer timer = new Timer(true) { + @Override public void schedule(TimerTask task, long delay, long period) { if (task == timerTask0 && delay == 0 && period == 10) { success.add(Boolean.TRUE); } } + @Override public void scheduleAtFixedRate(TimerTask task, long delay, long period) { if (task == timerTask1 && delay == 10 && period == 20) { success.add(Boolean.TRUE); } } + @Override public void schedule(TimerTask task, long delay) { if (task instanceof DelegatingTimerTask && delay == 20) { success.add(Boolean.TRUE); } } + @Override public void cancel() { success.add(Boolean.TRUE); } }; TimerFactoryBean timerFactoryBean = new TimerFactoryBean() { + @Override protected Timer createTimer(String name, boolean daemon) { return timer; } @@ -104,6 +109,7 @@ private static class TestTimerTask extends TimerTask { private int counter = 0; + @Override public void run() { counter++; } @@ -114,6 +120,7 @@ private static class TestRunnable implements Runnable { private int counter = 0; + @Override public void run() { counter++; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scheduling/timer/TimerTaskExecutorTests.java
@@ -96,6 +96,7 @@ public void testThatTheDestroyCallbackCancelsTheTimerIfNoTimerIsExplicitlySuppli TimerTaskExecutor executor = new TimerTaskExecutor() { + @Override protected Timer createTimer() { return timer; } @@ -129,6 +130,7 @@ public boolean isCreateTimerWasCalled() { return this.createTimerWasCalled; } + @Override protected Timer createTimer() { this.createTimerWasCalled = true; return super.createTimer(); @@ -146,6 +148,7 @@ public boolean isCancelWasCalled() { } + @Override public void cancel() { this.cancelWasCalled = true; super.cancel(); @@ -166,6 +169,7 @@ public boolean isRunWasCalled() { } + @Override public void run() { this.runWasCalled = true; synchronized (monitor) { @@ -176,6 +180,7 @@ public void run() { private static final class NoOpRunnable implements Runnable { + @Override public void run() { // explicit no-op }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/config/OtherTestBean.java
@@ -21,14 +21,17 @@ */ public class OtherTestBean implements ITestBean { + @Override public ITestBean getOtherBean() { return null; } + @Override public boolean isInitialized() { return false; } + @Override public boolean isDestroyed() { return false; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/groovy/ConcreteMessenger.java
@@ -26,10 +26,12 @@ public class ConcreteMessenger implements ConfigurableMessenger { private String message; + @Override public String getMessage() { return message; } + @Override public void setMessage(String message) { this.message = message; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
@@ -478,8 +478,10 @@ public void testRefreshableFactoryBean() { public static class TestCustomizer implements GroovyObjectCustomizer { + @Override public void customize(GroovyObject goo) { DelegatingMetaClass dmc = new DelegatingMetaClass(goo.getMetaClass()) { + @Override public Object invokeMethod(Object arg0, String mName, Object[] arg2) { if (mName.indexOf("Missing") != -1) { throw new IllegalStateException("Gotcha");
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/groovy/LogUserAdvice.java
@@ -11,6 +11,7 @@ public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice { private int countThrows = 0; + @Override public void before(Method method, Object[] objects, Object o) throws Throwable { countBefore++; System.out.println("Method:"+method.getName());
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/groovy/TestServiceImpl.java
@@ -2,6 +2,7 @@ @Log public class TestServiceImpl implements TestService{ + @Override public String sayHello() { throw new TestException("TestServiceImpl"); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/jruby/JRubyScriptFactoryTests.java
@@ -278,6 +278,7 @@ private static final class CountingPrintable implements Printable { public int count; + @Override public String getContent() { this.count++; return "Hello World!";
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java
@@ -25,10 +25,12 @@ public final class StubMessenger implements ConfigurableMessenger { private String message = "I used to be smart... now I'm just stupid."; + @Override public void setMessage(String message) { this.message = message; } + @Override public String getMessage() { return message; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/ui/ModelMapTests.java
@@ -278,6 +278,7 @@ public void testRawJdkProxy() throws Exception { getClass().getClassLoader(), new Class<?>[] {Map.class}, new InvocationHandler() { + @Override public Object invoke(Object proxy, Method method, Object[] args) { return "proxy"; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/DataBinderFieldAccessTests.java
@@ -115,9 +115,11 @@ public void testBindingWithErrorsAndCustomEditors() throws Exception { DataBinder binder = new DataBinder(rod, "person"); binder.initDirectFieldAccess(); binder.registerCustomEditor(TestBean.class, "spouse", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text, 0)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/DataBinderTests.java
@@ -254,17 +254,21 @@ public void testBindingWithErrorsAndCustomEditors() throws Exception { TestBean rod = new TestBean(); DataBinder binder = new DataBinder(rod, "person"); binder.registerCustomEditor(String.class, "touchy", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix_" + text); } + @Override public String getAsText() { return getValue().toString().substring(7); } }); binder.registerCustomEditor(TestBean.class, "spouse", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text, 0)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -381,9 +385,11 @@ public void testBindingErrorWithStringFormatter() { FormattingConversionService conversionService = new FormattingConversionService(); DefaultConversionService.addDefaultConverters(conversionService); conversionService.addFormatterForFieldType(String.class, new Formatter<String>() { + @Override public String parse(String text, Locale locale) throws ParseException { throw new ParseException(text, 0); } + @Override public String print(String object, Locale locale) { return object; } @@ -669,6 +675,7 @@ public void testBindingWithNestedObjectCreation() throws Exception { DataBinder binder = new DataBinder(tb, "person"); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean()); } @@ -689,9 +696,11 @@ public void testCustomEditorForSingleProperty() { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(6); } @@ -725,9 +734,11 @@ public void testCustomEditorForPrimitiveProperty() { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(int.class, "age", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new Integer(99)); } + @Override public String getAsText() { return "argh"; } @@ -746,9 +757,11 @@ public void testCustomEditorForAllStringProperties() { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, null, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(6); } @@ -775,6 +788,7 @@ public void testCustomEditorWithOldValueAccess() { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, null, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { if (getValue() == null || !text.equalsIgnoreCase(getValue().toString())) { setValue(text); @@ -1053,6 +1067,7 @@ public void testBindingStringArrayToIntegerSet() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(Set.class, new CustomCollectionEditor(TreeSet.class) { + @Override protected Object convertElement(Object element) { return new Integer(element.toString()); } @@ -1091,6 +1106,7 @@ public void testBindingToIndexedField() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array" + text); } @@ -1130,6 +1146,7 @@ public void testBindingToNestedIndexedField() { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } @@ -1166,9 +1183,11 @@ public void testEditorForNestedIndexedField() { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1189,9 +1208,11 @@ public void testSpecificEditorForNestedIndexedField() { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array[0].nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1212,9 +1233,11 @@ public void testInnerSpecificEditorForNestedIndexedField() { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list[0].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1233,11 +1256,13 @@ public void testDirectBindingToIndexedField() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "array", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1283,11 +1308,13 @@ public void testDirectBindingToEmptyIndexedFieldWithRegisteredSpecificEditor() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "map[key0]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1311,11 +1338,13 @@ public void testDirectBindingToEmptyIndexedFieldWithRegisteredGenericEditor() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1339,11 +1368,13 @@ public void testCustomEditorWithSubclass() { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1370,6 +1401,7 @@ public void testBindToStringArrayWithArrayEditor() { TestBean tb = new TestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String[].class, "stringArray", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(StringUtils.delimitedListToStringArray(text, "-")); } @@ -1387,6 +1419,7 @@ public void testBindToStringArrayWithComponentEditor() { TestBean tb = new TestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "stringArray", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("X" + text); } @@ -1647,10 +1680,12 @@ public void setNInStock(int nInStock) { private static class TestBeanValidator implements Validator { + @Override public boolean supports(Class<?> clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { TestBean tb = (TestBean) obj; if (tb.getAge() < 32) { @@ -1674,10 +1709,12 @@ public void validate(Object obj, Errors errors) { private static class SpouseValidator implements Validator { + @Override public boolean supports(Class<?> clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { TestBean tb = (TestBean) obj; if (tb == null || "XXX".equals(tb.getName())) { @@ -1703,6 +1740,7 @@ public List<E> getWrappedList() { return list; } + @Override public E get(int index) { if (index >= list.size()) { for (int i = list.size(); i < index; i++) { @@ -1716,50 +1754,62 @@ public E get(int index) { } } + @Override public int size() { return list.size(); } + @Override public boolean add(E o) { return list.add(o); } + @Override public void add(int index, E element) { list.add(index, element); } + @Override public boolean addAll(int index, Collection<? extends E> c) { return list.addAll(index, c); } + @Override public void clear() { list.clear(); } + @Override public int indexOf(Object o) { return list.indexOf(o); } + @Override public Iterator<E> iterator() { return list.iterator(); } + @Override public int lastIndexOf(Object o) { return list.lastIndexOf(o); } + @Override public ListIterator<E> listIterator() { return list.listIterator(); } + @Override public ListIterator<E> listIterator(int index) { return list.listIterator(index); } + @Override public E remove(int index) { return list.remove(index); } + @Override public E set(int index, E element) { return list.set(index, element); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java
@@ -146,6 +146,7 @@ public void shouldSupportFieldPostfixFormat() throws Exception { @Test public void shouldSupportCustomFormat() throws Exception { resolver.setMessageCodeFormatter(new MessageCodeFormatter() { + @Override public String format(String errorCode, String objectName, String field) { return DefaultMessageCodesResolver.Format.toDelimitedString( "CUSTOM-" + errorCode, objectName, field);
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/ValidationUtilsTests.java
@@ -161,10 +161,12 @@ public void testValidationUtilsEmptyOrWhitespaceVariants() { private static class EmptyValidator implements Validator { + @Override public boolean supports(Class<?> clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmpty(errors, "name", "EMPTY", "You must enter a name!"); } @@ -173,10 +175,12 @@ public void validate(Object obj, Errors errors) { private static class EmptyOrWhitespaceValidator implements Validator { + @Override public boolean supports(Class<?> clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "EMPTY_OR_WHITESPACE", "You must enter a name!"); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java
@@ -84,6 +84,7 @@ private void doTestProxyValidation(MyValidInterface proxy) { @MyStereotype public static class MyValidBean implements MyValidInterface { + @Override public Object myValidMethod(String arg1, int arg2) { return (arg2 == 0 ? null : "value"); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java
@@ -273,9 +273,11 @@ public void setStreet(String street) { public static class NameAddressValidator implements ConstraintValidator<NameAddressValid, ValidPerson> { + @Override public void initialize(NameAddressValid constraintAnnotation) { } + @Override public boolean isValid(ValidPerson value, ConstraintValidatorContext constraintValidatorContext) { return (value.name == null || !value.address.street.contains(value.name)); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/advice/CountingAfterReturningAdvice.java
@@ -28,6 +28,7 @@ @SuppressWarnings("serial") public class CountingAfterReturningAdvice extends MethodCounter implements AfterReturningAdvice { + @Override public void afterReturning(Object o, Method m, Object[] args, Object target) throws Throwable { count(m); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/advice/CountingBeforeAdvice.java
@@ -28,6 +28,7 @@ @SuppressWarnings("serial") public class CountingBeforeAdvice extends MethodCounter implements MethodBeforeAdvice { + @Override public void before(Method m, Object[] args, Object target) throws Throwable { count(m); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/aspect/PerTargetAspect.java
@@ -25,6 +25,7 @@ public void countSetter() { ++count; } + @Override public int getOrder() { return this.order; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/beans/CustomScope.java
@@ -33,6 +33,7 @@ public class CustomScope implements Scope { private Map<String, Object> beans = new HashMap<String, Object>(); + @Override public Object get(String name, ObjectFactory<?> objectFactory) { if (createNewScope) { beans.clear(); @@ -50,18 +51,22 @@ public Object get(String name, ObjectFactory<?> objectFactory) { return beans.get(name); } + @Override public String getConversationId() { return null; } + @Override public void registerDestructionCallback(String name, Runnable callback) { // do nothing } + @Override public Object remove(String name) { return beans.remove(name); } + @Override public Object resolveContextualObject(String key) { return null; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/beans/NestedTestBean.java
@@ -36,6 +36,7 @@ public void setCompany(String company) { this.company = ((company != null) ? company : ""); } + @Override public String getCompany() { return company; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/beans/TestBean.java
@@ -120,6 +120,7 @@ public TestBean(ITestBean spouse, Properties someProperties) { this.someProperties = someProperties; } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } @@ -128,6 +129,7 @@ public String getBeanName() { return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } @@ -144,10 +146,12 @@ public boolean isPostProcessed() { return postProcessed; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } @@ -160,10 +164,12 @@ public void setSex(String sex) { this.sex = sex; } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -176,10 +182,12 @@ public void setJedi(boolean jedi) { this.jedi = jedi; } + @Override public ITestBean getSpouse() { return spouse; } + @Override public void setSpouse(ITestBean spouse) { this.spouse = spouse; } @@ -280,10 +288,12 @@ public void setSomeProperties(Properties someProperties) { this.someProperties = someProperties; } + @Override public INestedTestBean getDoctor() { return doctor; } + @Override public INestedTestBean getLawyer() { return lawyer; } @@ -320,6 +330,7 @@ public void setSomeBoolean(Boolean someBoolean) { this.someBoolean = someBoolean; } + @Override public IndexedTestBean getNestedIndexedBean() { return nestedIndexedBean; } @@ -347,29 +358,34 @@ public void setPets(List<?> pets) { /** * @see ITestBean#exceptional(Throwable) */ + @Override public void exceptional(Throwable t) throws Throwable { if (t != null) { throw t; } } + @Override public void unreliableFileOperation() throws IOException { throw new IOException(); } /** * @see ITestBean#returnsThis() */ + @Override public Object returnsThis() { return this; } /** * @see IOther#absquatulate() */ + @Override public void absquatulate() { } + @Override public int haveBirthday() { return age++; } @@ -401,6 +417,7 @@ public int hashCode() { return this.age; } + @Override public int compareTo(Object other) { if ((this.name != null) && (other instanceof TestBean)) { return this.name.compareTo(((TestBean) other).getName());
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/interceptor/NopInterceptor.java
@@ -32,6 +32,7 @@ public class NopInterceptor implements MethodInterceptor { /** * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation) */ + @Override public Object invoke(MethodInvocation invocation) throws Throwable { increment(); return invocation.proceed();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/interceptor/SerializableNopInterceptor.java
@@ -35,10 +35,12 @@ public class SerializableNopInterceptor extends NopInterceptor implements Serial */ private int count; + @Override public int getCount() { return this.count; } + @Override protected void increment() { ++count; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/interceptor/TimestampIntroductionInterceptor.java
@@ -37,6 +37,7 @@ public void setTime(long ts) { this.ts = ts; } + @Override public long getTimeStamp() { return ts; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/mixin/DefaultLockable.java
@@ -26,14 +26,17 @@ public class DefaultLockable implements Lockable { private boolean locked; + @Override public void lock() { this.locked = true; } + @Override public void unlock() { this.locked = false; } + @Override public boolean locked() { return this.locked; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-context/src/test/java/test/mixin/LockMixin.java
@@ -34,17 +34,20 @@ public class LockMixin extends DelegatingIntroductionInterceptor implements Lock /** This field demonstrates additional state in the mixin */ private boolean locked; + @Override public void lock() { this.locked = true; } + @Override public void unlock() { this.locked = false; } /** * @see test.mixin.AopProxyTests.Lockable#locked() */ + @Override public boolean locked() { return this.locked; } @@ -56,6 +59,7 @@ public boolean locked() { * Lockable(this) then target behaviour. * @see org.aopalliance.MethodInterceptor#invoke(org.aopalliance.MethodInvocation) */ + @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (locked() && invocation.getMethod().getName().indexOf("set") == 0) throw new LockedException();
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/beans/DerivedTestBean.java
@@ -48,12 +48,14 @@ public static DerivedTestBean create(String[] names) { } + @Override public void setBeanName(String beanName) { if (this.beanName == null || beanName == null) { this.beanName = beanName; } } + @Override public String getBeanName() { return beanName; } @@ -72,10 +74,12 @@ public boolean wasInitialized() { } + @Override public void destroy() { this.destroyed = true; } + @Override public boolean wasDestroyed() { return destroyed; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/beans/NestedTestBean.java
@@ -37,6 +37,7 @@ public void setCompany(String company) { this.company = (company != null ? company : ""); } + @Override public String getCompany() { return company; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/beans/TestBean.java
@@ -148,10 +148,12 @@ public boolean isPostProcessed() { return postProcessed; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } @@ -167,10 +169,12 @@ public void setSex(String sex) { } } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -183,14 +187,17 @@ public void setJedi(boolean jedi) { this.jedi = jedi; } + @Override public ITestBean getSpouse() { return (spouses != null ? spouses[0] : null); } + @Override public void setSpouse(ITestBean spouse) { this.spouses = new ITestBean[] {spouse}; } + @Override public ITestBean[] getSpouses() { return spouses; } @@ -217,10 +224,12 @@ public void setCountry(String country) { this.country = country; } + @Override public String[] getStringArray() { return stringArray; } + @Override public void setStringArray(String[] stringArray) { this.stringArray = stringArray; } @@ -289,6 +298,7 @@ public void setSomeProperties(Properties someProperties) { this.someProperties = someProperties; } + @Override public INestedTestBean getDoctor() { return doctor; } @@ -297,6 +307,7 @@ public void setDoctor(INestedTestBean doctor) { this.doctor = doctor; } + @Override public INestedTestBean getLawyer() { return lawyer; } @@ -329,6 +340,7 @@ public void setSomeBoolean(Boolean someBoolean) { this.someBoolean = someBoolean; } + @Override public IndexedTestBean getNestedIndexedBean() { return nestedIndexedBean; } @@ -357,28 +369,33 @@ public void setPets(List pets) { /** * @see ITestBean#exceptional(Throwable) */ + @Override public void exceptional(Throwable t) throws Throwable { if (t != null) { throw t; } } + @Override public void unreliableFileOperation() throws IOException { throw new IOException(); } /** * @see ITestBean#returnsThis() */ + @Override public Object returnsThis() { return this; } /** * @see IOther#absquatulate() */ + @Override public void absquatulate() { } + @Override public int haveBirthday() { return age++; } @@ -408,6 +425,7 @@ public int hashCode() { return this.age; } + @Override public int compareTo(Object other) { if (this.name != null && other instanceof TestBean) { return this.name.compareTo(((TestBean) other).getName());
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java
@@ -32,6 +32,7 @@ public class AttributeAccessorSupportTests extends TestCase { private AttributeAccessor attributeAccessor; + @Override @SuppressWarnings("serial") protected void setUp() throws Exception { this.attributeAccessor = new AttributeAccessorSupport() { @@ -64,6 +65,7 @@ public void testAttributeNames() throws Exception { assertTrue(Arrays.binarySearch(attributeNames, NAME) > -1); assertTrue(Arrays.binarySearch(attributeNames, "abc") > -1); } + @Override protected void tearDown() throws Exception { this.attributeAccessor.removeAttribute(NAME); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java
@@ -356,9 +356,11 @@ public static class MyFoo implements Foo<String> { public void someMethod(Integer theArg, Object otherArg) { } + @Override public void someMethod(String theArg, Object otherArg) { } + @Override public void someVarargMethod(String theArg, Object... otherArgs) { } } @@ -383,6 +385,7 @@ void someMethod(T theArg, Map<?, ?> m) { public static class MyBar extends InterBar<String> { + @Override public void someMethod(String theArg, Object otherArg) { } @@ -399,6 +402,7 @@ public void someMethod(Integer theArg, Object otherArg) { public abstract class AbstractDateAdder implements Adder<Date> { + @Override public abstract void add(Date date); } @@ -430,6 +434,7 @@ public class ExtendsEnclosed extends Enclosed<Integer> { public class ExtendsReallyDeepNow extends ReallyDeepNow<Long> { + @Override void someMethod(Integer s, String t, Long r) { throw new UnsupportedOperationException(); } @@ -448,10 +453,12 @@ void someMethod(Integer s, String t, Long r) { public class MyBoo implements Boo<String, Integer> { + @Override public void foo(String e) { throw new UnsupportedOperationException(); } + @Override public void foo(Integer t) { throw new UnsupportedOperationException(); } @@ -478,12 +485,14 @@ public interface ConcreteSettings extends Settings { public interface SettingsDao<T extends Settings, S> extends Dao<T, S> { + @Override T load(); } public interface ConcreteSettingsDao extends SettingsDao<ConcreteSettings, String> { + @Override String loadFromParent(); } @@ -500,6 +509,7 @@ protected AbstractDaoImpl(T object, S otherObject) { } //@Transactional(readOnly = true) + @Override public S loadFromParent() { return otherObject; } @@ -513,6 +523,7 @@ protected SettingsDaoImpl(ConcreteSettings object) { } //@Transactional(readOnly = true) + @Override public ConcreteSettings load() { return super.object; } @@ -527,6 +538,7 @@ public ConcreteSettings load() { private static class AbstractBounded<E> implements Bounded<E> { + @Override public boolean boundedOperation(E myE) { return true; } @@ -535,6 +547,7 @@ public boolean boundedOperation(E myE) { private static class SerializableBounded<E extends HashMap & Delayed> extends AbstractBounded<E> { + @Override public boolean boundedOperation(E myE) { return false; } @@ -549,6 +562,7 @@ public boolean boundedOperation(E myE) { private static class StringGenericParameter implements GenericParameter<String> { + @Override public String getFor(Class<String> cls) { return "foo"; } @@ -561,94 +575,117 @@ public String getFor(Integer integer) { private static class StringList implements List<String> { + @Override public int size() { throw new UnsupportedOperationException(); } + @Override public boolean isEmpty() { throw new UnsupportedOperationException(); } + @Override public boolean contains(Object o) { throw new UnsupportedOperationException(); } + @Override public Iterator<String> iterator() { throw new UnsupportedOperationException(); } + @Override public Object[] toArray() { throw new UnsupportedOperationException(); } + @Override public <T> T[] toArray(T[] a) { throw new UnsupportedOperationException(); } + @Override public boolean add(String o) { throw new UnsupportedOperationException(); } + @Override public boolean remove(Object o) { throw new UnsupportedOperationException(); } + @Override public boolean containsAll(Collection<?> c) { throw new UnsupportedOperationException(); } + @Override public boolean addAll(Collection<? extends String> c) { throw new UnsupportedOperationException(); } + @Override public boolean addAll(int index, Collection<? extends String> c) { throw new UnsupportedOperationException(); } + @Override public boolean removeAll(Collection<?> c) { throw new UnsupportedOperationException(); } + @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException(); } + @Override public void clear() { throw new UnsupportedOperationException(); } + @Override public String get(int index) { throw new UnsupportedOperationException(); } + @Override public String set(int index, String element) { throw new UnsupportedOperationException(); } + @Override public void add(int index, String element) { throw new UnsupportedOperationException(); } + @Override public String remove(int index) { throw new UnsupportedOperationException(); } + @Override public int indexOf(Object o) { throw new UnsupportedOperationException(); } + @Override public int lastIndexOf(Object o) { throw new UnsupportedOperationException(); } + @Override public ListIterator<String> listIterator() { throw new UnsupportedOperationException(); } + @Override public ListIterator<String> listIterator(int index) { throw new UnsupportedOperationException(); } + @Override public List<String> subList(int fromIndex, int toIndex) { throw new UnsupportedOperationException(); } @@ -665,6 +702,7 @@ public class GenericEvent implements Event { private int priority; + @Override public int getPriority() { return priority; } @@ -743,6 +781,7 @@ public class GenericBroadcasterImpl implements Broadcaster { */ public abstract Receiver<T> getInstance(); + @Override public void setChannel(Channel channel) { this.channel = channel; } @@ -753,10 +792,12 @@ public void setBeanName(String name) { this.beanName = name; } + @Override public void subscribe() { } + @Override public void unsubscribe() { } @@ -800,6 +841,7 @@ public MessageBroadcasterImpl() { super(NewMessageEvent.class); } + @Override public void receive(MessageEvent event) { throw new UnsupportedOperationException("should not be called, use subclassed events"); } @@ -861,6 +903,7 @@ public void register(R... reps) { public void setRepos(R... reps) { } + @Override public <T> SimpleGenericRepository<T> getFor(Class<T> entityType) { return null; } @@ -896,50 +939,62 @@ public void afterPropertiesSet() throws Exception { public void setPersistentClass(Class<T> c) { } + @Override public Class<T> getPersistentClass() { return null; } + @Override public T findById(ID id, boolean lock) { return null; } + @Override public List<T> findAll() { return null; } + @Override public List<T> findByExample(T exampleInstance) { return null; } + @Override public List<T> findByQuery() { return null; } + @Override public T saveOrUpdate(T entity) { return null; } + @Override public void delete(T entity) { } + @Override public T refresh(T entity) { return null; } + @Override public void delete(ID id) { } + @Override public void delete(Collection<T> entities) { } } public class HibernateRepositoryRegistry extends SettableRepositoryRegistry<GenericHibernateRepository<?, ?>> { + @Override public void injectInto(GenericHibernateRepository<?, ?> rep) { } + @Override public <T> GenericHibernateRepository<T, ?> getFor(Class<T> entityType) { return null; } @@ -958,6 +1013,7 @@ public void injectInto(GenericHibernateRepository<?, ?> rep) { public class MyHomer<T extends Bounded<T>, L extends T> implements Homer<L> { + @Override public void foo(L t) { throw new UnsupportedOperationException(); } @@ -966,6 +1022,7 @@ public void foo(L t) { public class YourHomer<T extends AbstractBounded<T>, L extends T> extends MyHomer<T, L> { + @Override public void foo(L t) { throw new UnsupportedOperationException(); } @@ -984,6 +1041,7 @@ public void foo(L t) { public class GenericSqlMapDao<T extends Serializable> implements ConvenienceGenericDao<T> { + @Override public void saveOrUpdate(T t) { throw new UnsupportedOperationException(); } @@ -992,6 +1050,7 @@ public void saveOrUpdate(T t) { public class GenericSqlMapIntegerDao<T extends Integer> extends GenericSqlMapDao<T> { + @Override public void saveOrUpdate(T t) { } } @@ -1027,9 +1086,11 @@ public void saveVararg(T t, Object... args) { public class UserDaoImpl extends AbstractDao<User> implements UserDao { + @Override public void save(Permission perm) { } + @Override public void saveVararg(User user, Object... args) { } } @@ -1053,9 +1114,11 @@ public void save(T object) { public class BusinessDao extends BusinessGenericDao<Business<?>, Long> { + @Override public void save(Business<?> business) { } + @Override public Business<?> get(Long id) { return null; } @@ -1110,6 +1173,7 @@ public void receive(ModifiedMegaMessageEvent event) { throw new UnsupportedOperationException(); } + @Override public void receive(MegaMessageEvent event) { throw new UnsupportedOperationException(); } @@ -1136,6 +1200,7 @@ private static class DomainObjectExtendsSuper extends DomainObjectSuper { private static abstract class AbstractImplementsInterface<D extends DomainObjectSuper> implements IGenericInterface<D> { + @Override public <T> void doSomething(D domainObject, T value) { } @@ -1175,10 +1240,12 @@ public void method2(P p, R r) { private static class DomainObject extends AbstractDomainObject<ParameterType, byte[]> { + @Override public byte[] method1(ParameterType p) { return super.method1(p); } + @Override public void method2(ParameterType p, byte[] r) { super.method2(p, r); } @@ -1215,6 +1282,7 @@ public static class ExternalMessage { public static class ExternalMessageProvider<S extends ExternalMessage, T extends ExternalMessageSearchConditions<S>> implements IExternalMessageProvider<S, T> { + @Override public Collection<S> findBy(T conditions) { return null; } @@ -1235,6 +1303,7 @@ public static class EmailMessageProvider extends ExternalMessageProvider<EmailMe public static class TestEmailProvider extends EmailMessageProvider { + @Override public Collection<EmailMessage> findBy(EmailSearchConditions conditions) { return null; }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/core/DefaultControlFlowTests.java
@@ -30,6 +30,7 @@ public class DefaultControlFlowTests extends AbstractControlFlowTests { public void testThisClassPlease() { } + @Override protected ControlFlow createControlFlow() { return ControlFlowFactory.createControlFlow(); }
true
Other
spring-projects
spring-framework
4c8cd7b0bd45bbe37ec9cc588b0f29608831b05f.json
Add @Override annotations to test sources Issue: SPR-10129
spring-core/src/test/java/org/springframework/core/GenericCollectionTypeResolverTests.java
@@ -36,6 +36,7 @@ */ public class GenericCollectionTypeResolverTests extends AbstractGenericsTests { + @Override protected void setUp() throws Exception { this.targetClass = Foo.class; this.methods = new String[] {"a", "b", "b2", "b3", "c", "d", "d2", "d3", "e", "e2", "e3"}; @@ -44,6 +45,7 @@ protected void setUp() throws Exception { Integer.class, Integer.class, Integer.class, Integer.class, Integer.class}; } + @Override protected Type getType(Method method) { return GenericCollectionTypeResolver.getMapValueReturnType(method); }
true