mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-01 16:22:15 +00:00
Remove extra dependency on Commons Lang. This dependency is only required by the domain subproject, not the core security project.
This commit is contained in:
parent
13a0784736
commit
49a917b08d
@ -44,11 +44,6 @@
|
|||||||
<version>2.0.11</version>
|
<version>2.0.11</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-logging</groupId>
|
<groupId>commons-logging</groupId>
|
||||||
<artifactId>commons-logging</artifactId>
|
<artifactId>commons-logging</artifactId>
|
||||||
|
@ -15,9 +15,8 @@
|
|||||||
|
|
||||||
package org.acegisecurity.acl.basic;
|
package org.acegisecurity.acl.basic;
|
||||||
|
|
||||||
import org.apache.commons.lang.ClassUtils;
|
|
||||||
|
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@ -66,10 +65,10 @@ public class NamedEntityObjectIdentity implements AclObjectIdentity {
|
|||||||
throws IllegalAccessException, InvocationTargetException {
|
throws IllegalAccessException, InvocationTargetException {
|
||||||
Assert.notNull(object, "object cannot be null");
|
Assert.notNull(object, "object cannot be null");
|
||||||
|
|
||||||
this.classname = (object.getClass().getPackage() == null)
|
this.classname = (getPackageName(object.getClass().getName()) == null)
|
||||||
? ClassUtils.getShortClassName(object.getClass())
|
? ClassUtils.getShortName(object.getClass())
|
||||||
: (object.getClass().getPackage().getName() + "."
|
: getPackageName(object.getClass().getName() + "."
|
||||||
+ ClassUtils.getShortClassName(object.getClass()));
|
+ ClassUtils.getShortName(object.getClass()));
|
||||||
|
|
||||||
Class clazz = object.getClass();
|
Class clazz = object.getClass();
|
||||||
|
|
||||||
@ -134,6 +133,18 @@ public class NamedEntityObjectIdentity implements AclObjectIdentity {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getPackageName(String className) {
|
||||||
|
Assert.hasLength(className, "class name must not be empty");
|
||||||
|
|
||||||
|
int lastDotIndex = className.lastIndexOf(".");
|
||||||
|
|
||||||
|
if (lastDotIndex == -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return className.substring(0, lastDotIndex);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Important so caching operates properly.
|
* Important so caching operates properly.
|
||||||
*
|
*
|
||||||
|
10
project.xml
10
project.xml
@ -211,16 +211,6 @@
|
|||||||
<war.bundle>true</war.bundle>
|
<war.bundle>true</war.bundle>
|
||||||
</properties>
|
</properties>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<url>http://jakarta.apache.org/commons</url>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-logging</groupId>
|
<groupId>commons-logging</groupId>
|
||||||
<artifactId>commons-logging</artifactId>
|
<artifactId>commons-logging</artifactId>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user