From 3e424e3ce76250fd317e509c772e288e550a7002 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 8 Sep 2023 15:30:52 +0200 Subject: [PATCH] Polish "Add return type check on GetterPointcut" See gh-30068 --- .../main/java/org/springframework/aop/support/Pointcuts.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java b/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java index c091622cde7..50e997266bd 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java @@ -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,7 @@ 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); }