From 14f27ae683e894d8398663e9443266610dbcccf4 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Sat, 27 Mar 2004 00:44:27 +0000 Subject: [PATCH] Make compatible with interface changes to aopalliance.jar. --- .../test/java/org/acegisecurity/BankSecurityVoter.java | 6 +++--- .../org/acegisecurity/attribute/MockMethodInvocation.java | 8 -------- .../main/java/sample/contact/ContactSecurityVoter.java | 8 ++++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/core/src/test/java/org/acegisecurity/BankSecurityVoter.java b/core/src/test/java/org/acegisecurity/BankSecurityVoter.java index 2b5434f1c4..918a983bf9 100644 --- a/core/src/test/java/org/acegisecurity/BankSecurityVoter.java +++ b/core/src/test/java/org/acegisecurity/BankSecurityVoter.java @@ -67,11 +67,11 @@ public class BankSecurityVoter implements AccessDecisionVoter { // Lookup the account number being passed Integer accountNumber = null; - for (int i = 0; i < invocation.getArgumentCount(); i++) { - Class argClass = invocation.getArgument(i).getClass(); + for (int i = 0; i < invocation.getArguments().length; i++) { + Class argClass = invocation.getArguments()[i].getClass(); if (Integer.class.isAssignableFrom(argClass)) { - accountNumber = (Integer) invocation.getArgument(i); + accountNumber = (Integer) invocation.getArguments()[i]; } } diff --git a/core/src/test/java/org/acegisecurity/attribute/MockMethodInvocation.java b/core/src/test/java/org/acegisecurity/attribute/MockMethodInvocation.java index ee181021ae..55a2c53cf5 100644 --- a/core/src/test/java/org/acegisecurity/attribute/MockMethodInvocation.java +++ b/core/src/test/java/org/acegisecurity/attribute/MockMethodInvocation.java @@ -15,7 +15,6 @@ package net.sf.acegisecurity.attribute; -import org.aopalliance.intercept.AttributeRegistry; import org.aopalliance.intercept.Invocation; import org.aopalliance.intercept.MethodInvocation; @@ -66,13 +65,6 @@ public class MockMethodInvocation implements MethodInvocation { throw new UnsupportedOperationException("mock method not implemented"); } - /* (non-Javadoc) - * @see org.aopalliance.intercept.Invocation#getAttributeRegistry() - */ - public AttributeRegistry getAttributeRegistry() { - throw new UnsupportedOperationException("mock method not implemented"); - } - /* (non-Javadoc) * @see org.aopalliance.intercept.MethodInvocation#getMethod() */ diff --git a/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java b/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java index adeade6c24..59cc856a98 100644 --- a/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java +++ b/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java @@ -69,13 +69,13 @@ public class ContactSecurityVoter implements AccessDecisionVoter { // Lookup the account number being passed String passedOwner = null; - for (int i = 0; i < invocation.getArgumentCount(); i++) { - Class argClass = invocation.getArgument(i).getClass(); + for (int i = 0; i < invocation.getArguments().length; i++) { + Class argClass = invocation.getArguments()[i].getClass(); if (String.class.isAssignableFrom(argClass)) { - passedOwner = (String) invocation.getArgument(i); + passedOwner = (String) invocation.getArguments()[i]; } else if (Contact.class.isAssignableFrom(argClass)) { - passedOwner = ((Contact) invocation.getArgument(i)) + passedOwner = ((Contact) invocation.getArguments()[i]) .getOwner(); } }