Polishing
This commit is contained in:
parent
fb4fbeab50
commit
07097976ef
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2009 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
|
||||||
/**
|
/**
|
||||||
* Copy of the {@code @Scope} annotation for testing purposes.
|
* Copy of the {@code @Scope} annotation for testing purposes.
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Scope {
|
public @interface Scope {
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ public interface GenericApplicationListener extends SmartApplicationListener {
|
||||||
*/
|
*/
|
||||||
boolean supportsEventType(ResolvableType eventType);
|
boolean supportsEventType(ResolvableType eventType);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@code ApplicationListener} for the given event type.
|
* Create a new {@code ApplicationListener} for the given event type.
|
||||||
* @param eventType the event to listen to
|
* @param eventType the event to listen to
|
||||||
|
|
|
@ -22,8 +22,7 @@ import org.springframework.context.ApplicationEvent;
|
||||||
import org.springframework.core.ResolvableType;
|
import org.springframework.core.ResolvableType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link GenericApplicationListener} implementation that supports a single
|
* A {@link GenericApplicationListener} implementation that supports a single event type.
|
||||||
* event type.
|
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
* @since 6.1.3
|
* @since 6.1.3
|
||||||
|
@ -35,11 +34,13 @@ class GenericApplicationListenerDelegate<E extends ApplicationEvent> implements
|
||||||
|
|
||||||
private final Consumer<E> consumer;
|
private final Consumer<E> consumer;
|
||||||
|
|
||||||
|
|
||||||
GenericApplicationListenerDelegate(Class<E> supportedEventType, Consumer<E> consumer) {
|
GenericApplicationListenerDelegate(Class<E> supportedEventType, Consumer<E> consumer) {
|
||||||
this.supportedEventType = supportedEventType;
|
this.supportedEventType = supportedEventType;
|
||||||
this.consumer = consumer;
|
this.consumer = consumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(ApplicationEvent event) {
|
public void onApplicationEvent(ApplicationEvent event) {
|
||||||
this.consumer.accept(this.supportedEventType.cast(event));
|
this.consumer.accept(this.supportedEventType.cast(event));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2023 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -168,7 +168,7 @@ public final class CronExpression {
|
||||||
* the cron format
|
* the cron format
|
||||||
*/
|
*/
|
||||||
public static CronExpression parse(String expression) {
|
public static CronExpression parse(String expression) {
|
||||||
Assert.hasLength(expression, "Expression string must not be empty");
|
Assert.hasLength(expression, "Expression must not be empty");
|
||||||
|
|
||||||
expression = resolveMacros(expression);
|
expression = resolveMacros(expression);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -848,6 +848,7 @@ class CronTriggerTests {
|
||||||
assertThat(nextExecutionTime).isEqualTo(this.calendar.getTime());
|
assertThat(nextExecutionTime).isEqualTo(this.calendar.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void roundup(Calendar calendar) {
|
private static void roundup(Calendar calendar) {
|
||||||
calendar.add(Calendar.SECOND, 1);
|
calendar.add(Calendar.SECOND, 1);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
@ -861,9 +862,7 @@ class CronTriggerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TriggerContext getTriggerContext(Date lastCompletionTime) {
|
private static TriggerContext getTriggerContext(Date lastCompletionTime) {
|
||||||
SimpleTriggerContext context = new SimpleTriggerContext();
|
return new SimpleTriggerContext(null, null, lastCompletionTime);
|
||||||
context.update(null, null, lastCompletionTime);
|
|
||||||
return context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -41,8 +41,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 6.0
|
* @since 6.0
|
||||||
*/
|
*/
|
||||||
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
|
||||||
@Documented
|
@Documented
|
||||||
@ExtendWith(CompileWithForkedClassLoaderExtension.class)
|
@ExtendWith(CompileWithForkedClassLoaderExtension.class)
|
||||||
public @interface CompileWithForkedClassLoader {
|
public @interface CompileWithForkedClassLoader {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -63,7 +63,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||||
* @see org.springframework.aot.hint.BindingReflectionHintsRegistrar
|
* @see org.springframework.aot.hint.BindingReflectionHintsRegistrar
|
||||||
* @see Reflective @Reflective
|
* @see Reflective @Reflective
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@Reflective(RegisterReflectionForBindingProcessor.class)
|
@Reflective(RegisterReflectionForBindingProcessor.class)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2023 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -224,7 +224,6 @@ class ReflectiveRuntimeHintsRegistrarTests {
|
||||||
@interface SampleInvoker {
|
@interface SampleInvoker {
|
||||||
|
|
||||||
int retries() default 0;
|
int retries() default 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Target({ ElementType.METHOD })
|
@Target({ ElementType.METHOD })
|
||||||
|
@ -235,10 +234,9 @@ class ReflectiveRuntimeHintsRegistrarTests {
|
||||||
|
|
||||||
@AliasFor(attribute = "retries", annotation = SampleInvoker.class)
|
@AliasFor(attribute = "retries", annotation = SampleInvoker.class)
|
||||||
int value() default 1;
|
int value() default 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Target({ ElementType.TYPE })
|
@Target(ElementType.TYPE)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@Reflective(TestTypeHintReflectiveProcessor.class)
|
@Reflective(TestTypeHintReflectiveProcessor.class)
|
||||||
|
|
|
@ -2273,8 +2273,8 @@ class MergedAnnotationsTests {
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
|
|
||||||
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
|
||||||
@Inherited
|
@Inherited
|
||||||
@interface Transactional {
|
@interface Transactional {
|
||||||
|
|
||||||
|
@ -2327,8 +2327,8 @@ class MergedAnnotationsTests {
|
||||||
static class AliasedTransactionalComponentClass {
|
static class AliasedTransactionalComponentClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
|
||||||
@Inherited
|
@Inherited
|
||||||
@interface AliasedTransactional {
|
@interface AliasedTransactional {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2009 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
|
||||||
/**
|
/**
|
||||||
* Copy of the {@code @Scope} annotation for testing purposes.
|
* Copy of the {@code @Scope} annotation for testing purposes.
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Scope {
|
public @interface Scope {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2019 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -32,7 +32,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@Inherited
|
@Inherited
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -30,7 +30,7 @@ import java.lang.annotation.Target;
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@DisabledIf(expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}", reason = "Disabled on Mac OS")
|
@DisabledIf(expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}", reason = "Disabled on Mac OS")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -30,7 +30,7 @@ import java.lang.annotation.Target;
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@EnabledIf(expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}", reason = "Enabled on Mac OS")
|
@EnabledIf(expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}", reason = "Enabled on Mac OS")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Tag;
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
@Tag("failing-test-case")
|
@Tag("failing-test-case")
|
||||||
|
|
Loading…
Reference in New Issue