Browse Source

Merge pull request #30068 from enimiste

* pr/30068:
  Polish "Add return type check on GetterPointcut"
  Add return type check on GetterPointcut

Closes gh-30068
pull/31194/head
Stephane Nicoll 2 years ago
parent
commit
91f65e63b4
  1. 5
      spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java

5
spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -126,7 +126,8 @@ public abstract class Pointcuts { @@ -126,7 +126,8 @@ public abstract class Pointcuts {
@Override
public boolean matches(Method method, Class<?> targetClass) {
return (method.getName().startsWith("get") &&
method.getParameterCount() == 0);
method.getParameterCount() == 0 &&
method.getReturnType() != Void.TYPE);
}
private Object readResolve() {

Loading…
Cancel
Save