Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -56,9 +56,9 @@ public interface Advised extends TargetClassAware {
|
||||
|
||||
/**
|
||||
* Determine whether the given interface is proxied.
|
||||
* @param intf the interface to check
|
||||
* @param ifc the interface to check
|
||||
*/
|
||||
boolean isInterfaceProxied(Class<?> intf);
|
||||
boolean isInterfaceProxied(Class<?> ifc);
|
||||
|
||||
/**
|
||||
* Change the {@code TargetSource} used by this {@code Advised} object.
|
||||
|
||||
@@ -222,15 +222,15 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
|
||||
/**
|
||||
* Add a new proxied interface.
|
||||
* @param intf the additional interface to proxy
|
||||
* @param ifc the additional interface to proxy
|
||||
*/
|
||||
public void addInterface(Class<?> intf) {
|
||||
Assert.notNull(intf, "Interface must not be null");
|
||||
if (!intf.isInterface()) {
|
||||
throw new IllegalArgumentException("[" + intf.getName() + "] is not an interface");
|
||||
public void addInterface(Class<?> ifc) {
|
||||
Assert.notNull(ifc, "Interface must not be null");
|
||||
if (!ifc.isInterface()) {
|
||||
throw new IllegalArgumentException("[" + ifc.getName() + "] is not an interface");
|
||||
}
|
||||
if (!this.interfaces.contains(intf)) {
|
||||
this.interfaces.add(intf);
|
||||
if (!this.interfaces.contains(ifc)) {
|
||||
this.interfaces.add(ifc);
|
||||
adviceChanged();
|
||||
}
|
||||
}
|
||||
@@ -238,12 +238,12 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
/**
|
||||
* Remove a proxied interface.
|
||||
* <p>Does nothing if the given interface isn't proxied.
|
||||
* @param intf the interface to remove from the proxy
|
||||
* @param ifc the interface to remove from the proxy
|
||||
* @return {@code true} if the interface was removed; {@code false}
|
||||
* if the interface was not found and hence could not be removed
|
||||
*/
|
||||
public boolean removeInterface(Class<?> intf) {
|
||||
return this.interfaces.remove(intf);
|
||||
public boolean removeInterface(Class<?> ifc) {
|
||||
return this.interfaces.remove(ifc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -252,9 +252,9 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterfaceProxied(Class<?> intf) {
|
||||
public boolean isInterfaceProxied(Class<?> ifc) {
|
||||
for (Class<?> proxyIntf : this.interfaces) {
|
||||
if (intf.isAssignableFrom(proxyIntf)) {
|
||||
if (ifc.isAssignableFrom(proxyIntf)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user