Skip to content

Commit

Permalink
Polish "Fix Javadoc"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Mar 9, 2024
1 parent abdccff commit 4983a80
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,15 @@ public void unlock() {
this.locked = false;
}

/**
* @see org.springframework.aop.testfixture.mixin.Lockable#locked()
*/
@Override
public boolean locked() {
return this.locked;
}

/**
* Note that we need to override around advice.
* If the method is a setter and we're locked, prevent execution.
* Otherwise let super.invoke() handle it, and do normal
* Lockable(this) then target behaviour.
* @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation)
* If the method is a setter, and we're locked, prevent execution.
* Otherwise, let super.invoke() handle it.
*/
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

package org.springframework.beans.factory.support;

import java.lang.reflect.Method;

import org.springframework.util.ClassUtils;

/**
* Descriptor for a {@link java.lang.reflect.Method Method} which holds a
* Descriptor for a {@link Method Method} which holds a
* reference to the method's {@linkplain #declaringClass declaring class},
* {@linkplain #methodName name}, and {@linkplain #parameterTypes parameter types}.
*
Expand All @@ -33,9 +35,8 @@ record MethodDescriptor(Class<?> declaringClass, String methodName, Class<?>...

/**
* Create a {@link MethodDescriptor} for the supplied bean class and method name.
* <p>The supplied {@code methodName} may be a {@linkplain java.lang.reflect.Method#getName()
* simple method name} or a
* {@linkplain org.springframework.util.ClassUtils#getQualifiedMethodName(java.lang.reflect.Method)
* <p>The supplied {@code methodName} may be a {@linkplain Method#getName()
* simple method name} or a {@linkplain ClassUtils#getQualifiedMethodName(Method)
* qualified method name}.
* <p>If the method name is fully qualified, this utility will parse the
* method name and its declaring class from the qualified method name and then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ class C {
* IntrospectionException regarding a "type mismatch between indexed and non-indexed
* methods" intermittently (approximately one out of every four times) under JDK 7
* due to non-deterministic results from {@link Class#getDeclaredMethods()}.
* @see <a href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7023180">JDK-7023180 : Change in specified-to-be-unspecified ordering of getDeclaredMethods causes application problems</a>
* @see <a href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7023180">JDK-7023180</a>
* @see #cornerSpr9702()
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ private static Method searchForMatch(Class<?> type, Method bridgeMethod) {
/**
* Compare the signatures of the bridge method and the method which it bridges. If
* the parameter and return types are the same, it is a 'visibility' bridge method
* introduced in Java 6 to fix <a href="https://bugs.openjdk.org/browse/JDK-6342411">JDK-6342411</a>.
* introduced in Java 6 to fix <a href="https://bugs.openjdk.org/browse/JDK-6342411">
* JDK-6342411</a>.
* @return whether signatures match as described
* @see <a href="https://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html">Java bridge methods explained</a>
*/
public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) {
if (bridgeMethod == bridgedMethod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
*
* @author Sam Brannen
* @since 5.3.24
* @see <a href="https://github.com/spring-projects/spring-framework/issues/20279">gh-20279</a>
*/
@SuppressWarnings("unused")
class NestedRepeatableAnnotationsTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ private TypedValue executeFunctionViaMethod(ExpressionState state, Method method
/**
* Execute a function represented as {@link MethodHandle}.
* <p>Method types that take no arguments (fully bound handles or static methods
* with no parameters) can use {@link MethodHandle#invoke(Object... var1)} which is the most
* efficient. Otherwise, {@link MethodHandle#invokeWithArguments(Object... arguments)} is used.
* with no parameters) can use {@link MethodHandle#invoke(Object...)} which is the most
* efficient. Otherwise, {@link MethodHandle#invokeWithArguments(Object...)} is used.
* @param state the expression evaluation state
* @param methodHandle the method handle to invoke
* @return the return value of the invoked Java method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

import static org.assertj.core.api.Assertions.assertThat;

///CLOVER:OFF
/**
* Spring Security scenarios from <a href="https://docs.spring.io/spring-security/reference/servlet/authorization/authorize-http-requests.html#authorization-expressions">Expressing Authorization with SpEL</a>
* SpEL expression tests for Spring Security scenarios.
*
* @author Andy Clement
* @see <a href="https://docs.spring.io/spring-security/reference/servlet/authorization/authorize-http-requests.html#authorization-expressions">Expressing Authorization with SpEL</a>
*/
class ScenariosForSpringSecurityExpressionTests extends AbstractExpressionTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ protected EmbeddedDatabaseType getEmbeddedDatabaseType() {
return EmbeddedDatabaseType.H2;
}

/**
* <a href="https://jira.spring.io/browse/SPR-15896">SPR-15896</a>
*
* @since 5.0
*/
@Test
@Test // SPR-15896
void scriptWithH2Alias() {
databasePopulator.addScript(usersSchema());
databasePopulator.addScript(resource("db-test-data-h2-alias.sql"));
Expand All @@ -61,12 +56,7 @@ void scriptWithH2Alias() {
assertThat(jdbcTemplate.queryForObject(sql, String.class)).isEqualTo("maS");
}

/**
* <a href="https://github.com/spring-projects/spring-framework/issues/27008">gh-27008</a>
*
* @since 5.3.11
*/
@Test
@Test // gh-27008
void automaticallyCommitsIfAutoCommitIsDisabled() throws Exception {
EmbeddedDatabase database = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public MessageHeaderInitializer getHeaderInitializer() {
* SimpMessageHeaderAccessor#DESTINATION_HEADER} then the message is sent without
* further changes.
* <p>If a destination header is not already present ,the message is sent
* to the configured {@link AbstractMessageSendingTemplate#setDefaultDestination(Object) defaultDestination}
* or an exception an {@code IllegalStateException} is raised if that isn't
* to the configured {@link AbstractMessageSendingTemplate#setDefaultDestination(Object)
* defaultDestination} or an {@code IllegalStateException} is raised if that isn't
* configured.
* @param message the message to send (never {@code null})
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
*
* @author Sam Brannen
* @since 5.3.17
* @see <a href="https://github.com/spring-projects/spring-framework/issues/27757">gh-27757</a>
*/
class EagerTestExecutionEventPublishingTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import static org.assertj.core.api.Assertions.assertThat;

/**
* Integration tests for an issue raised in <a href="https://jira.spring.io/browse/SPR-15927">SPR-15927</a>.
* Integration tests for {@code SPR-15927}.
*
* @author Sam Brannen
* @since 5.0
*/
public class AutowiredRuleTests {
public class AutowiredRuleSpr15927Tests {

@ClassRule
public static final SpringClassRule springClassRule = new SpringClassRule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,7 @@ void buildContextHierarchyMapForSingleTestClassWithMultiLevelContextHierarchyWit
assertContextConfigEntriesAreNotUnique(SingleTestClassWithMultiLevelContextHierarchyWithDuplicatedContextConfig.class);
}

/**
* Used to reproduce bug reported in <a href="https://jira.spring.io/browse/SPR-10997">SPR-10997</a>
*/
@Test
@Test // SPR-10997
void buildContextHierarchyMapForTestClassHierarchyWithMultiLevelContextHierarchiesAndOverriddenInitializers() {
Map<String, List<ContextConfigurationAttributes>> map = buildContextHierarchyMap(TestClass2WithMultiLevelContextHierarchyWithOverriddenInitializers.class);

Expand Down Expand Up @@ -504,32 +501,24 @@ private static class SingleTestClassWithMultiLevelContextHierarchyWithEmptyConte
private static class SingleTestClassWithMultiLevelContextHierarchyWithDuplicatedContextConfig {
}

/**
* Used to reproduce bug reported in <a href="https://jira.spring.io/browse/SPR-10997">SPR-10997</a>
*/
@ContextHierarchy({//
//
@ContextConfiguration(name = "alpha", locations = "1-A.xml"),//
@ContextConfiguration(name = "beta", locations = "1-B.xml") //
})
}) // SPR-10997
private static class TestClass1WithMultiLevelContextHierarchyWithUniqueContextConfig {
}

/**
* Used to reproduce bug reported in <a href="https://jira.spring.io/browse/SPR-10997">SPR-10997</a>
*/
@ContextHierarchy({//
//
@ContextConfiguration(name = "alpha", initializers = DummyApplicationContextInitializer.class),//
@ContextConfiguration(name = "beta", initializers = DummyApplicationContextInitializer.class) //
})
}) // SPR-10997
private static class TestClass2WithMultiLevelContextHierarchyWithOverriddenInitializers extends
TestClass1WithMultiLevelContextHierarchyWithUniqueContextConfig {
}

/**
* Used to reproduce bug reported in <a href="https://jira.spring.io/browse/SPR-10997">SPR-10997</a>
*/
// SPR-10997
private static class DummyApplicationContextInitializer implements
ApplicationContextInitializer<ConfigurableApplicationContext> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.springframework.web.bind;

import jakarta.servlet.ServletRequest;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
Expand All @@ -26,7 +27,8 @@


/**
* Benchmarks for extracting parameters from {@link jakarta.servlet.ServletRequest}.
* Benchmarks for extracting parameters from {@link ServletRequest}.
*
* @author Brian Clozel
*/
@BenchmarkMode(Mode.Throughput)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
/**
* Indicates we're waiting for one last isReady-onWritePossible cycle
* after "onComplete" because some Servlet containers expect this to take
* place prior to calling AsyncContext.complete().
* @see <a href="https://github.com/eclipse-ee4j/servlet-api/issues/273">gh-273</a>
* place prior to calling AsyncContext.complete(). See also gh-273.
*/
private volatile boolean readyToCompleteAfterLastWrite;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ void settingSuffixToNullCausesEmptyStringToBeUsed() {

/**
* This is the expected behavior, and it now has a test to prove it.
* @see <a href="https://opensource.atlassian.com/projects/spring/browse/SPR-2789">SPR-2789</a>
*/
@PathPatternsParameterizedTest
@PathPatternsParameterizedTest // SPR-2789
void nestedPathisUsedAsViewName_InBreakingChangeFromSpring12Line(
Function<String, MockHttpServletRequest> requestFactory) throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,7 @@ void asBodyTagWithExistingMessagesAttribute() throws Exception {
assertThat(getPageContext().getAttribute(ErrorsTag.MESSAGES_ATTRIBUTE)).isEqualTo(existingAttribute);
}

/**
* <a href="https://jira.spring.io/browse/SPR-2788">SPR-2788</a>
*/
@Test
@Test // SPR-2788
void asBodyTagWithErrorsAndExistingMessagesAttributeInNonPageScopeAreNotClobbered() throws Exception {
String existingAttribute = "something";
getPageContext().setAttribute(ErrorsTag.MESSAGES_ATTRIBUTE, existingAttribute, PageContext.APPLICATION_SCOPE);
Expand All @@ -379,42 +376,27 @@ void asBodyTagWithErrorsAndExistingMessagesAttributeInNonPageScopeAreNotClobbere
assertThat(getPageContext().getAttribute(ErrorsTag.MESSAGES_ATTRIBUTE, PageContext.APPLICATION_SCOPE)).isEqualTo(existingAttribute);
}

/**
* <a href="https://jira.spring.io/browse/SPR-2788">SPR-2788</a>
*/
@Test
@Test // SPR-2788
void asBodyTagWithNoErrorsAndExistingMessagesAttributeInApplicationScopeAreNotClobbered() throws Exception {
assertWhenNoErrorsExistingMessagesInScopeAreNotClobbered(PageContext.APPLICATION_SCOPE);
}

/**
* <a href="https://jira.spring.io/browse/SPR-2788">SPR-2788</a>
*/
@Test
@Test // SPR-2788
void asBodyTagWithNoErrorsAndExistingMessagesAttributeInSessionScopeAreNotClobbered() throws Exception {
assertWhenNoErrorsExistingMessagesInScopeAreNotClobbered(PageContext.SESSION_SCOPE);
}

/**
* <a href="https://jira.spring.io/browse/SPR-2788">SPR-2788</a>
*/
@Test
@Test // SPR-2788
void asBodyTagWithNoErrorsAndExistingMessagesAttributeInPageScopeAreNotClobbered() throws Exception {
assertWhenNoErrorsExistingMessagesInScopeAreNotClobbered(PageContext.PAGE_SCOPE);
}

/**
* <a href="https://jira.spring.io/browse/SPR-2788">SPR-2788</a>
*/
@Test
@Test // SPR-2788
void asBodyTagWithNoErrorsAndExistingMessagesAttributeInRequestScopeAreNotClobbered() throws Exception {
assertWhenNoErrorsExistingMessagesInScopeAreNotClobbered(PageContext.REQUEST_SCOPE);
}

/**
* <a href="https://jira.spring.io/browse/SPR-4005">SPR-4005</a>
*/
@Test
@Test // SPR-4005
void omittedPathMatchesObjectErrorsOnly() throws Exception {
this.tag.setPath(null);
Errors errors = new BeanPropertyBindingResult(new TestBean(), "COMMAND_NAME");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
*/
class PasswordInputTagTests extends InputTagTests {

/**
* <a href="https://jira.spring.io/browse/SPR-2866">SPR-2866</a>
*/
@Test
@Test // SPR-2866
void passwordValueIsNotRenderedByDefault() throws Exception {
this.getTag().setPath("name");

Expand All @@ -48,10 +45,7 @@ void passwordValueIsNotRenderedByDefault() throws Exception {
assertValueAttribute(output, "");
}

/**
* <a href="https://jira.spring.io/browse/SPR-2866">SPR-2866</a>
*/
@Test
@Test // SPR-2866
void passwordValueIsRenderedIfShowPasswordAttributeIsSetToTrue() throws Exception {
this.getTag().setPath("name");
this.getPasswordTag().setShowPassword(true);
Expand All @@ -66,10 +60,7 @@ void passwordValueIsRenderedIfShowPasswordAttributeIsSetToTrue() throws Exceptio
assertValueAttribute(output, "Rob");
}

/**
* <a href="https://jira.spring.io/browse/SPR-2866">SPR-2866</a>
*/
@Test
@Test // >SPR-2866
void passwordValueIsNotRenderedIfShowPasswordAttributeIsSetToFalse() throws Exception {
this.getTag().setPath("name");
this.getPasswordTag().setShowPassword(false);
Expand Down

0 comments on commit 4983a80

Please sign in to comment.