You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by sb...@apache.org on 2012/07/24 03:32:29 UTC
[9/20] git commit: fix compiler errors, checkstyle violations
fix compiler errors, checkstyle violations
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/6acddac9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/6acddac9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/6acddac9
Branch: refs/heads/master
Commit: 6acddac9e895214c5c8bf6ccba5f580d4b9eb7ef
Parents: 426e372
Author: Shane Bryzak <sb...@gmail.com>
Authored: Mon Jun 18 20:07:29 2012 +1000
Committer: Shane Bryzak <sb...@gmail.com>
Committed: Tue Jul 24 10:08:05 2012 +1000
----------------------------------------------------------------------
deltaspike/examples/security-console/pom.xml | 5 +
.../securityconsole/model/ObjectPermission.java | 8 +
.../security/impl/idm/AbstractIdentityType.java | 18 ++
.../impl/permission/JPAPermissionStore.java | 186 +++++++++++++-
.../impl/util/properties/FieldPropertyImpl.java | 24 ++-
.../impl/util/properties/MethodProperty.java | 4 +-
.../impl/util/properties/MethodPropertyImpl.java | 46 +++--
.../security/impl/util/properties/Properties.java | 3 +-
.../security/impl/util/properties/Property.java | 1 -
.../query/AnnotatedPropertyCriteria.java | 12 +-
.../properties/query/NamedPropertyCriteria.java | 28 ++-
.../util/properties/query/PropertyCriteria.java | 3 +-
.../util/properties/query/PropertyQueries.java | 9 +-
.../impl/util/properties/query/PropertyQuery.java | 14 +-
.../impl/util/reflection/HierarchyDiscovery.java | 143 +++++++----
.../util/reflection/ParameterizedTypeImpl.java | 74 ++++--
.../security/impl/util/reflection/Reflections.java | 64 ++++--
.../reflection/SetAccessiblePriviligedAction.java | 38 ++--
.../security/impl/util/reflection/Types.java | 169 +++++++-------
.../impl/authentication/InMemoryUserStorage.java | 4 +-
.../impl/authentication/LoginLogoutTest.java | 4 +-
.../security/impl/authentication/ShopClient.java | 4 +-
.../impl/authentication/TestAuthenticator.java | 10 +-
.../securitybinding/CustomSecurityBinding.java | 2 +-
.../securityparameterbinding/CustomAuthorizer.java | 3 +-
.../CustomSecurityBinding.java | 2 +-
.../apache/deltaspike/test/util/ArchiveUtils.java | 2 +
.../test/util/ShrinkWrapArchiveUtil.java | 108 ++++++---
28 files changed, 676 insertions(+), 312 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/examples/security-console/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/pom.xml b/deltaspike/examples/security-console/pom.xml
index f96daf7..0b6bf9a 100644
--- a/deltaspike/examples/security-console/pom.xml
+++ b/deltaspike/examples/security-console/pom.xml
@@ -59,6 +59,11 @@
<artifactId>deltaspike-security-module-impl</artifactId>
<scope>runtime</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ </dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ObjectPermission.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ObjectPermission.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ObjectPermission.java
new file mode 100644
index 0000000..b814691
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ObjectPermission.java
@@ -0,0 +1,8 @@
+package org.apache.deltaspike.example.securityconsole.model;
+
+@AclStore
+@Entity
+public class ObjectPermission
+{
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/idm/AbstractIdentityType.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/idm/AbstractIdentityType.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/idm/AbstractIdentityType.java
index bbb3521..c6b2b9e 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/idm/AbstractIdentityType.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/idm/AbstractIdentityType.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.deltaspike.security.impl.idm;
import java.util.Date;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/permission/JPAPermissionStore.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/permission/JPAPermissionStore.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/permission/JPAPermissionStore.java
index 74f94b6..4fb7ed5 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/permission/JPAPermissionStore.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/permission/JPAPermissionStore.java
@@ -19,10 +19,13 @@
package org.apache.deltaspike.security.impl.permission;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
@@ -34,11 +37,19 @@ import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.inject.Inject;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
+import javax.persistence.Query;
import org.apache.deltaspike.security.api.SecurityConfigurationException;
import org.apache.deltaspike.security.api.permission.Permission;
import org.apache.deltaspike.security.api.permission.PermissionQuery;
+import org.apache.deltaspike.security.api.permission.annotations.ACLIdentifier;
+import org.apache.deltaspike.security.api.permission.annotations.ACLPermission;
+import org.apache.deltaspike.security.api.permission.annotations.ACLRecipient;
+import org.apache.deltaspike.security.api.permission.annotations.ACLResourceClass;
import org.apache.deltaspike.security.api.permission.annotations.ACLStore;
+import org.apache.deltaspike.security.impl.util.properties.Property;
+import org.apache.deltaspike.security.impl.util.properties.query.AnnotatedPropertyCriteria;
+import org.apache.deltaspike.security.impl.util.properties.query.PropertyQueries;
import org.apache.deltaspike.security.spi.permission.PermissionStore;
/**
@@ -48,18 +59,18 @@ import org.apache.deltaspike.security.spi.permission.PermissionStore;
@ApplicationScoped
public class JPAPermissionStore implements PermissionStore, Extension
{
- private Class<?> generalPermissionStore = null;
+ private StoreMetadata generalStore = null;
- private Map<Class<?>, Class<?>> permissionStoreMap = new HashMap<Class<?>, Class<?>>();
+ private Map<Class<?>, StoreMetadata> storeMap = new HashMap<Class<?>, StoreMetadata>();
@Inject
- private Instance<EntityManager> entityManagerInstance;
+ private Instance<EntityManager> entityManagerInstance;
public <X> void processAnnotatedType(@Observes ProcessAnnotatedType<X> event,
final BeanManager beanManager)
{
-
- if (event.getAnnotatedType().isAnnotationPresent(Entity.class)) {
+ if (event.getAnnotatedType().isAnnotationPresent(Entity.class))
+ {
AnnotatedType<X> type = event.getAnnotatedType();
if (type.isAnnotationPresent(ACLStore.class))
@@ -67,34 +78,34 @@ public class JPAPermissionStore implements PermissionStore, Extension
ACLStore store = type.getAnnotation(ACLStore.class);
if (store.value() == null)
{
- if (generalPermissionStore == null)
+ if (generalStore == null)
{
- generalPermissionStore = type.getJavaClass();
+ generalStore = new StoreMetadata(type.getJavaClass());
}
else
{
throw new SecurityConfigurationException(
"More than one entity bean has been configured as a general ACL store - " +
- "conflicting bean classes: " + generalPermissionStore.getName() + " and " +
+ "conflicting bean classes: " + generalStore.getStoreClass().getName() + " and " +
type.getJavaClass().getName());
}
}
else
{
- if (permissionStoreMap.containsKey(store.value()))
+ if (storeMap.containsKey(store.value()))
{
throw new SecurityConfigurationException(
"More than one entity bean has been configured to store ACL permissions for class " +
store.value().getName() + " - conflicting classes: " +
- permissionStoreMap.get(store.value()).getName() + " and " + type.getJavaClass().getName());
+ storeMap.get(store.value()).getStoreClass().getName() + " and " +
+ type.getJavaClass().getName());
}
else
{
- permissionStoreMap.put(store.value(), type.getJavaClass());
+ storeMap.put(store.value(), new StoreMetadata(type.getJavaClass()));
}
}
- }
-
+ }
}
}
@@ -103,9 +114,80 @@ public class JPAPermissionStore implements PermissionStore, Extension
{
EntityManager em = entityManagerInstance.get();
+ Map<StoreMetadata, Set<Object>> resourceMetadata = new HashMap<StoreMetadata, Set<Object>>();
+
+ if (query.getResources() != null)
+ {
+ for (Object resource : query.getResources())
+ {
+ Class<?> resourceClass = resource.getClass();
+ StoreMetadata meta = (storeMap.containsKey(resourceClass)) ? storeMap.get(resourceClass) : generalStore;
+
+ if (!resourceMetadata.containsKey(meta))
+ {
+ resourceMetadata.put(meta, new HashSet<Object>());
+ }
+ resourceMetadata.get(meta).add(resource);
+ }
+ }
+ else if (query.getResource() != null)
+ {
+ Class<?> resourceClass = query.getResource().getClass();
+ StoreMetadata meta = (storeMap.containsKey(resourceClass)) ? storeMap.get(resourceClass) : generalStore;
+
+ if (!resourceMetadata.containsKey(meta))
+ {
+ resourceMetadata.put(meta, new HashSet<Object>());
+ }
+ resourceMetadata.get(meta).add(query.getResource());
+ }
+
+ if (resourceMetadata.isEmpty())
+ {
+ // No resources specified in query - we need to query every known permission store and retrieve
+ // all permissions for the specified query parameters
+
+ for (StoreMetadata meta : storeMap.values())
+ {
+ Query permissionQuery = buildPermissionQuery(meta, query, em);
+
+ }
+ }
+ else
+ {
+ List<Permission> results = new ArrayList<Permission>();
+
+ // Iterate through each permission store and execute a separate query
+ for (StoreMetadata meta : resourceMetadata.keySet())
+ {
+ Query permissionQuery = buildPermissionQuery(meta, query, em);
+ }
+ }
+
// TODO Auto-generated method stub
return null;
}
+
+ private Query buildPermissionQuery(StoreMetadata meta, PermissionQuery query, EntityManager em)
+ {
+ StringBuilder queryText = new StringBuilder();
+ queryText.append("SELECT P FROM ");
+ queryText.append(meta.getStoreClass().getName());
+ queryText.append(" P WHERE ");
+
+ if (query.getRecipient() != null)
+ {
+ queryText.append(meta.getAclRecipient().getName());
+ queryText.append(" = :RECIPIENT");
+ }
+
+ Query q = em.createQuery(queryText.toString())
+ .setParameter("RECIPIENT", query.getRecipient().getKey());
+
+ // TODO apply the range if specified
+
+ return q;
+ }
@Override
public boolean grantPermission(Permission permission)
@@ -155,5 +237,81 @@ public class JPAPermissionStore implements PermissionStore, Extension
// TODO Auto-generated method stub
return false;
}
-
+
+ private class StoreMetadata
+ {
+ private Class<?> storeClass;
+ private Property<String> aclIdentifier;
+ private Property<?> aclPermission;
+ private Property<String> aclRecipient;
+ private Property<String> aclResourceClass;
+
+ public StoreMetadata(Class<?> storeClass)
+ {
+ this.storeClass = storeClass;
+ validateStore();
+ }
+
+ private void validateStore()
+ {
+ aclIdentifier = PropertyQueries.<String>createQuery(storeClass)
+ .addCriteria(new AnnotatedPropertyCriteria(ACLIdentifier.class))
+ .getFirstResult();
+
+ if (aclIdentifier == null)
+ {
+ throw new SecurityConfigurationException("Permission storage class " + storeClass.getName() +
+ " must have a field annotated @ACLIdentifier");
+ }
+
+ aclPermission = PropertyQueries.createQuery(storeClass)
+ .addCriteria(new AnnotatedPropertyCriteria(ACLPermission.class))
+ .getFirstResult();
+
+ if (aclPermission == null)
+ {
+ throw new SecurityConfigurationException("Permission storage class " + storeClass.getName() +
+ " must have a field annotated @ACLPermission");
+ }
+
+ aclRecipient = PropertyQueries.<String>createQuery(storeClass)
+ .addCriteria(new AnnotatedPropertyCriteria(ACLRecipient.class))
+ .getFirstResult();
+
+ if (aclRecipient == null)
+ {
+ throw new SecurityConfigurationException("Permission storage class " + storeClass.getName() +
+ " must have a field annotated @ACLRecipient");
+ }
+
+ aclResourceClass = PropertyQueries.<String>createQuery(storeClass)
+ .addCriteria(new AnnotatedPropertyCriteria(ACLResourceClass.class))
+ .getFirstResult();
+ }
+
+ public Class<?> getStoreClass()
+ {
+ return storeClass;
+ }
+
+ public Property<String> getAclIdentifier()
+ {
+ return aclIdentifier;
+ }
+
+ public Property<?> getAclPermission()
+ {
+ return aclPermission;
+ }
+
+ public Property<String> getAclRecipient()
+ {
+ return aclRecipient;
+ }
+
+ public Property<String> getAclResourceClass()
+ {
+ return aclResourceClass;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/FieldPropertyImpl.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/FieldPropertyImpl.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/FieldPropertyImpl.java
index 95b6511..ae15ee9 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/FieldPropertyImpl.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/FieldPropertyImpl.java
@@ -60,7 +60,8 @@ class FieldPropertyImpl<V> implements FieldProperty<V>
}
@SuppressWarnings("unchecked")
- public Class<V> getJavaClass() {
+ public Class<V> getJavaClass()
+ {
return (Class<V>) field.getType();
}
@@ -70,35 +71,42 @@ class FieldPropertyImpl<V> implements FieldProperty<V>
return getFieldValue(field, instance, getJavaClass());
}
- public void setValue(Object instance, V value) {
+ public void setValue(Object instance, V value)
+ {
setAccessible();
setFieldValue(true, field, instance, value);
}
- public Class<?> getDeclaringClass() {
+ public Class<?> getDeclaringClass()
+ {
return field.getDeclaringClass();
}
- public boolean isReadOnly() {
+ public boolean isReadOnly()
+ {
return false;
}
- public void setAccessible() {
+ public void setAccessible()
+ {
Reflections.setAccessible(field);
}
@Override
- public String toString() {
+ public String toString()
+ {
return field.toString();
}
@Override
- public int hashCode() {
+ public int hashCode()
+ {
return field.hashCode();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(Object obj)
+ {
return field.equals(obj);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodProperty.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodProperty.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodProperty.java
index 6b415e4..08bfca6 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodProperty.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodProperty.java
@@ -23,7 +23,5 @@ import java.lang.reflect.Method;
public interface MethodProperty<V> extends Property<V>
{
-
- public Method getAnnotatedElement();
-
+ Method getAnnotatedElement();
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodPropertyImpl.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodPropertyImpl.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodPropertyImpl.java
index c15fea7..0536699 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodPropertyImpl.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/MethodPropertyImpl.java
@@ -54,11 +54,13 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
{
if (method.getReturnType() == Void.TYPE)
{
- throw new IllegalArgumentException("Invalid accessor method, must have return value if starts with 'get'. Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must have return value if starts with 'get'. Method: " + method);
}
else if (method.getParameterTypes().length > 0)
{
- throw new IllegalArgumentException("Invalid accessor method, must have zero arguments if starts with 'get'. Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must have zero arguments if starts with 'get'. Method: " + method);
}
propertyNameInAccessorMethod = method.getName().substring(GETTER_METHOD_PREFIX_LENGTH);
accessorMethodPrefix = GETTER_METHOD_PREFIX;
@@ -67,11 +69,13 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
{
if (method.getReturnType() != Void.TYPE)
{
- throw new IllegalArgumentException("Invalid accessor method, must not have return value if starts with 'set'. Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must not have return value if starts with 'set'. Method: " + method);
}
else if (method.getParameterTypes().length != 1)
{
- throw new IllegalArgumentException("Invalid accessor method, must have one argument if starts with 'set'. Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must have one argument if starts with 'set'. Method: " + method);
}
propertyNameInAccessorMethod = method.getName().substring(SETTER_METHOD_PREFIX_LENGTH);
accessorMethodPrefix = SETTER_METHOD_PREFIX;
@@ -80,17 +84,21 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
{
if (method.getReturnType() != Boolean.TYPE || !method.getReturnType().isPrimitive())
{
- throw new IllegalArgumentException("Invalid accessor method, must return boolean primitive if starts with 'is'. Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must return boolean primitive if starts with 'is'. Method: " +
+ method);
}
propertyNameInAccessorMethod = method.getName().substring(BOOLEAN_GETTER_METHOD_PREFIX_LENGTH);
accessorMethodPrefix = BOOLEAN_GETTER_METHOD_PREFIX;
}
else
{
- throw new IllegalArgumentException("Invalid accessor method, must start with 'get', 'set' or 'is'. " + "Method: " + method);
+ throw new IllegalArgumentException(
+ "Invalid accessor method, must start with 'get', 'set' or 'is'. " + "Method: " + method);
}
- if (propertyNameInAccessorMethod.length() == 0 || !Character.isUpperCase(propertyNameInAccessorMethod.charAt(0)))
+ if (propertyNameInAccessorMethod.length() == 0 ||
+ !Character.isUpperCase(propertyNameInAccessorMethod.charAt(0)))
{
throw new IllegalArgumentException("Invalid accessor method, prefix '" + accessorMethodPrefix +
"' must be followed a non-empty property name, capitalized. Method: " + method);
@@ -127,18 +135,24 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
return getterMethod;
}
- public V getValue(Object instance)
- {
- if (getterMethod == null) {
- throw new UnsupportedOperationException("Property " + this.setterMethod.getDeclaringClass() + "." + propertyName + " cannot be read, as there is no getter method.");
+ public V getValue(Object instance)
+ {
+ if (getterMethod == null)
+ {
+ throw new UnsupportedOperationException("Property " +
+ this.setterMethod.getDeclaringClass() + "." + propertyName +
+ " cannot be read, as there is no getter method.");
}
return Reflections.cast(invokeMethod(getterMethod, instance));
}
public void setValue(Object instance, V value)
{
- if (setterMethod == null) {
- throw new UnsupportedOperationException("Property " + this.getterMethod.getDeclaringClass() + "." + propertyName + " is read only, as there is no setter method.");
+ if (setterMethod == null)
+ {
+ throw new UnsupportedOperationException("Property " +
+ this.getterMethod.getDeclaringClass() + "." + propertyName +
+ " is read only, as there is no setter method.");
}
invokeMethod(setterMethod, instance, value);
}
@@ -176,7 +190,8 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
}
else if (methodName.startsWith(BOOLEAN_GETTER_METHOD_PREFIX))
{
- if (Introspector.decapitalize(methodName.substring(BOOLEAN_GETTER_METHOD_PREFIX_LENGTH)).equals(name))
+ if (Introspector.decapitalize(
+ methodName.substring(BOOLEAN_GETTER_METHOD_PREFIX_LENGTH)).equals(name))
{
return method;
}
@@ -238,7 +253,8 @@ class MethodPropertyImpl<V> implements MethodProperty<V>
if (this.setterMethod == null)
{
return that.setterMethod == null && this.getterMethod.equals(that.getterMethod);
- } else
+ }
+ else
{
return this.setterMethod.equals(that.setterMethod) && this.getterMethod.equals(that.getterMethod);
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Properties.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Properties.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Properties.java
index fea6049..2a7c337 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Properties.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Properties.java
@@ -81,7 +81,8 @@ public class Properties
}
else
{
- throw new IllegalArgumentException("Cannot make a property of " + member + " - it is neither a method or a field");
+ throw new IllegalArgumentException("Cannot make a property of " +
+ member + " - it is neither a method or a field");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Property.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Property.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Property.java
index e2d5fab..82d443b 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Property.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/Property.java
@@ -21,7 +21,6 @@ package org.apache.deltaspike.security.impl.util.properties;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Member;
import java.lang.reflect.Type;
-import java.security.PrivilegedAction;
/**
* A representation of a JavaBean style property
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/AnnotatedPropertyCriteria.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/AnnotatedPropertyCriteria.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/AnnotatedPropertyCriteria.java
index 0157c3b..3a61e0b 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/AnnotatedPropertyCriteria.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/AnnotatedPropertyCriteria.java
@@ -27,18 +27,22 @@ import java.lang.reflect.Method;
*
* @see PropertyCriteria
*/
-public class AnnotatedPropertyCriteria implements PropertyCriteria {
+public class AnnotatedPropertyCriteria implements PropertyCriteria
+{
private final Class<? extends Annotation> annotationClass;
- public AnnotatedPropertyCriteria(Class<? extends Annotation> annotationClass) {
+ public AnnotatedPropertyCriteria(Class<? extends Annotation> annotationClass)
+ {
this.annotationClass = annotationClass;
}
- public boolean fieldMatches(Field f) {
+ public boolean fieldMatches(Field f)
+ {
return f.isAnnotationPresent(annotationClass);
}
- public boolean methodMatches(Method m) {
+ public boolean methodMatches(Method m)
+ {
return m.isAnnotationPresent(annotationClass);
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/NamedPropertyCriteria.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/NamedPropertyCriteria.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/NamedPropertyCriteria.java
index c7b73b1..a56fd21 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/NamedPropertyCriteria.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/NamedPropertyCriteria.java
@@ -27,24 +27,36 @@ import java.lang.reflect.Method;
*
* @see PropertyCriteria
*/
-public class NamedPropertyCriteria implements PropertyCriteria {
+public class NamedPropertyCriteria implements PropertyCriteria
+{
private final String[] propertyNames;
- public NamedPropertyCriteria(String... propertyNames) {
+ public NamedPropertyCriteria(String... propertyNames)
+ {
this.propertyNames = propertyNames;
}
- public boolean fieldMatches(Field f) {
- for (String propertyName : propertyNames) {
- if (propertyName.equals(f.getName())) return true;
+ public boolean fieldMatches(Field f)
+ {
+ for (String propertyName : propertyNames)
+ {
+ if (propertyName.equals(f.getName()))
+ {
+ return true;
+ }
}
return false;
}
- public boolean methodMatches(Method m) {
- for (String propertyName : propertyNames) {
+ public boolean methodMatches(Method m)
+ {
+ for (String propertyName : propertyNames)
+ {
if (m.getName().startsWith("get") &&
- Introspector.decapitalize(m.getName().substring(3)).equals(propertyName)) return true;
+ Introspector.decapitalize(m.getName().substring(3)).equals(propertyName))
+ {
+ return true;
+ }
}
return false;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyCriteria.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyCriteria.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyCriteria.java
index 4d8b589..4b35b1c 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyCriteria.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyCriteria.java
@@ -40,7 +40,8 @@ import java.lang.reflect.Method;
* @see AnnotatedPropertyCriteria
* @see NamedPropertyCriteria
*/
-public interface PropertyCriteria {
+public interface PropertyCriteria
+{
/**
* Tests whether the specified field matches the criteria
*
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQueries.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQueries.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQueries.java
index 4a4c77d..5cd187e 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQueries.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQueries.java
@@ -23,9 +23,11 @@ package org.apache.deltaspike.security.impl.util.properties.query;
*
* @see PropertyQuery
*/
-public class PropertyQueries {
+public class PropertyQueries
+{
- private PropertyQueries() {
+ private PropertyQueries()
+ {
}
/**
@@ -35,7 +37,8 @@ public class PropertyQueries {
* @param targetClass
* @return
*/
- public static <V> PropertyQuery<V> createQuery(Class<?> targetClass) {
+ public static <V> PropertyQuery<V> createQuery(Class<?> targetClass)
+ {
return new PropertyQuery<V>(targetClass);
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQuery.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQuery.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQuery.java
index a8f9a94..1f4f99a 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQuery.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/properties/query/PropertyQuery.java
@@ -112,11 +112,14 @@ public class PropertyQuery<V>
}
else if (results.isEmpty())
{
- throw new RuntimeException("Expected one property match, but the criteria did not match any properties on " + targetClass.getName());
+ throw new RuntimeException(
+ "Expected one property match, but the criteria did not match any properties on " +
+ targetClass.getName());
}
else
{
- throw new RuntimeException("Expected one property match, but the criteria matched " + results.size() + " properties on " + targetClass.getName());
+ throw new RuntimeException("Expected one property match, but the criteria matched " + results.size() +
+ " properties on " + targetClass.getName());
}
}
@@ -137,11 +140,14 @@ public class PropertyQuery<V>
}
else if (results.isEmpty())
{
- throw new RuntimeException("Expected one property match, but the criteria did not match any properties on " + targetClass.getName());
+ throw new RuntimeException(
+ "Expected one property match, but the criteria did not match any properties on " +
+ targetClass.getName());
}
else
{
- throw new RuntimeException("Expected one property match, but the criteria matched " + results.size() + " properties on " + targetClass.getName());
+ throw new RuntimeException("Expected one property match, but the criteria matched " +
+ results.size() + " properties on " + targetClass.getName());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/HierarchyDiscovery.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/HierarchyDiscovery.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/HierarchyDiscovery.java
index 404f6c3..1b6180f 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/HierarchyDiscovery.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/HierarchyDiscovery.java
@@ -1,18 +1,20 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.deltaspike.security.impl.util.reflection;
@@ -27,58 +29,76 @@ import java.util.Set;
/**
* Utility class for resolving all bean types from a given type.
*/
-public class HierarchyDiscovery {
+public class HierarchyDiscovery
+{
private final Type type;
private Map<Type, Class<?>> types;
- public HierarchyDiscovery(Type type) {
+ public HierarchyDiscovery(Type type)
+ {
this.type = type;
}
- protected void add(Class<?> clazz, Type type) {
+ protected void add(Class<?> clazz, Type type)
+ {
types.put(type, clazz);
}
- public Set<Type> getTypeClosure() {
- if (types == null) {
+ public Set<Type> getTypeClosure()
+ {
+ if (types == null)
+ {
init();
}
// Return an independent set with no ties to the BiMap used
return new HashSet<Type>(types.keySet());
}
- private void init() {
+ private void init()
+ {
this.types = new HashMap<Type, Class<?>>();
- try {
+ try
+ {
discoverTypes(type);
- } catch (StackOverflowError e) {
+ }
+ catch (StackOverflowError e)
+ {
System.out.println("type" + type);
Thread.dumpStack();
throw e;
}
}
- public Type getResolvedType() {
- if (type instanceof Class<?>) {
+ public Type getResolvedType()
+ {
+ if (type instanceof Class<?>)
+ {
Class<?> clazz = (Class<?>) type;
return resolveType(clazz);
}
return type;
}
- private void discoverTypes(Type type) {
- if (type != null) {
- if (type instanceof Class<?>) {
+ private void discoverTypes(Type type)
+ {
+ if (type != null)
+ {
+ if (type instanceof Class<?>)
+ {
Class<?> clazz = (Class<?>) type;
add(clazz, resolveType(clazz));
discoverFromClass(clazz);
- } else {
+ }
+ else
+ {
Class<?> clazz = null;
- if (type instanceof ParameterizedType) {
+ if (type instanceof ParameterizedType)
+ {
Type rawType = ((ParameterizedType) type).getRawType();
- if (rawType instanceof Class<?>) {
+ if (rawType instanceof Class<?>)
+ {
discoverFromClass((Class<?>) rawType);
clazz = (Class<?>) rawType;
}
@@ -88,19 +108,26 @@ public class HierarchyDiscovery {
}
}
- private Type resolveType(Class<?> clazz) {
- if (clazz.getTypeParameters().length > 0) {
+ private Type resolveType(Class<?> clazz)
+ {
+ if (clazz.getTypeParameters().length > 0)
+ {
TypeVariable<?>[] actualTypeParameters = clazz.getTypeParameters();
- ParameterizedType parameterizedType = new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass());
+ ParameterizedType parameterizedType = new ParameterizedTypeImpl(
+ clazz, actualTypeParameters, clazz.getDeclaringClass());
return parameterizedType;
- } else {
+ }
+ else
+ {
return clazz;
}
}
- private void discoverFromClass(Class<?> clazz) {
+ private void discoverFromClass(Class<?> clazz)
+ {
discoverTypes(resolveType(type, type, clazz.getGenericSuperclass()));
- for (Type c : clazz.getGenericInterfaces()) {
+ for (Type c : clazz.getGenericInterfaces())
+ {
discoverTypes(resolveType(type, type, c));
}
}
@@ -112,48 +139,60 @@ public class HierarchyDiscovery {
* @param type
* @return actual type
*/
- private Type resolveType(Type beanType, Type beanType2, Type type) {
- if (type instanceof ParameterizedType) {
- if (beanType instanceof ParameterizedType) {
+ private Type resolveType(Type beanType, Type beanType2, Type type)
+ {
+ if (type instanceof ParameterizedType)
+ {
+ if (beanType instanceof ParameterizedType)
+ {
return resolveParameterizedType((ParameterizedType) beanType, (ParameterizedType) type);
}
- if (beanType instanceof Class<?>) {
+ if (beanType instanceof Class<?>)
+ {
return resolveType(((Class<?>) beanType).getGenericSuperclass(), beanType2, type);
}
}
- if (type instanceof TypeVariable<?>) {
- if (beanType instanceof ParameterizedType) {
+ if (type instanceof TypeVariable<?>)
+ {
+ if (beanType instanceof ParameterizedType)
+ {
return resolveTypeParameter((ParameterizedType) beanType, beanType2, (TypeVariable<?>) type);
}
- if (beanType instanceof Class<?>) {
+ if (beanType instanceof Class<?>)
+ {
return resolveType(((Class<?>) beanType).getGenericSuperclass(), beanType2, type);
}
}
return type;
}
- private Type resolveParameterizedType(ParameterizedType beanType, ParameterizedType parameterizedType) {
+ private Type resolveParameterizedType(ParameterizedType beanType, ParameterizedType parameterizedType)
+ {
Type rawType = parameterizedType.getRawType();
Type[] actualTypes = parameterizedType.getActualTypeArguments();
Type resolvedRawType = resolveType(beanType, beanType, rawType);
Type[] resolvedActualTypes = new Type[actualTypes.length];
- for (int i = 0; i < actualTypes.length; i++) {
+ for (int i = 0; i < actualTypes.length; i++)
+ {
resolvedActualTypes[i] = resolveType(beanType, beanType, actualTypes[i]);
}
// reconstruct ParameterizedType by types resolved TypeVariable.
return new ParameterizedTypeImpl(resolvedRawType, resolvedActualTypes, parameterizedType.getOwnerType());
}
- private Type resolveTypeParameter(ParameterizedType type, Type beanType, TypeVariable<?> typeVariable) {
+ private Type resolveTypeParameter(ParameterizedType type, Type beanType, TypeVariable<?> typeVariable)
+ {
// step1. raw type
Class<?> actualType = (Class<?>) type.getRawType();
TypeVariable<?>[] typeVariables = actualType.getTypeParameters();
Type[] actualTypes = type.getActualTypeArguments();
- for (int i = 0; i < typeVariables.length; i++) {
- if (typeVariables[i].equals(typeVariable) && !actualTypes[i].equals(typeVariable)) {
+ for (int i = 0; i < typeVariables.length; i++)
+ {
+ if (typeVariables[i].equals(typeVariable) && !actualTypes[i].equals(typeVariable))
+ {
return resolveType(this.type, beanType, actualTypes[i]);
}
}
@@ -161,15 +200,19 @@ public class HierarchyDiscovery {
// step2. generic super class
Type genericSuperType = actualType.getGenericSuperclass();
Type resolvedGenericSuperType = resolveType(genericSuperType, beanType, typeVariable);
- if (!(resolvedGenericSuperType instanceof TypeVariable<?>)) {
+ if (!(resolvedGenericSuperType instanceof TypeVariable<?>))
+ {
return resolvedGenericSuperType;
}
// step3. generic interfaces
- if (beanType instanceof ParameterizedType) {
- for (Type interfaceType : ((Class<?>) ((ParameterizedType) beanType).getRawType()).getGenericInterfaces()) {
+ if (beanType instanceof ParameterizedType)
+ {
+ for (Type interfaceType : ((Class<?>) ((ParameterizedType) beanType).getRawType()).getGenericInterfaces())
+ {
Type resolvedType = resolveType(interfaceType, interfaceType, typeVariable);
- if (!(resolvedType instanceof TypeVariable<?>)) {
+ if (!(resolvedType instanceof TypeVariable<?>))
+ {
return resolvedType;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/ParameterizedTypeImpl.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/ParameterizedTypeImpl.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/ParameterizedTypeImpl.java
index 8e45e0d..48b47c6 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/ParameterizedTypeImpl.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/ParameterizedTypeImpl.java
@@ -1,18 +1,20 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.deltaspike.security.impl.util.reflection;
@@ -21,56 +23,74 @@ import java.lang.reflect.Type;
import java.util.Arrays;
-public class ParameterizedTypeImpl implements ParameterizedType {
+public class ParameterizedTypeImpl implements ParameterizedType
+{
private final Type[] actualTypeArguments;
private final Type rawType;
private final Type ownerType;
- public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type ownerType) {
+ public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type ownerType)
+ {
this.actualTypeArguments = actualTypeArguments;
this.rawType = rawType;
this.ownerType = ownerType;
}
- public Type[] getActualTypeArguments() {
+ public Type[] getActualTypeArguments()
+ {
return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
}
- public Type getOwnerType() {
+ public Type getOwnerType()
+ {
return ownerType;
}
- public Type getRawType() {
+ public Type getRawType()
+ {
return rawType;
}
@Override
- public int hashCode() {
- return Arrays.hashCode(actualTypeArguments) ^ (ownerType == null ? 0 : ownerType.hashCode()) ^ (rawType == null ? 0 : rawType.hashCode());
+ public int hashCode()
+ {
+ return Arrays.hashCode(actualTypeArguments) ^ (ownerType == null ? 0 :
+ ownerType.hashCode()) ^ (rawType == null ? 0 : rawType.hashCode());
}
@Override
- public boolean equals(Object obj) {
- if (this == obj) {
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
return true;
- } else if (obj instanceof ParameterizedType) {
+ }
+ else if (obj instanceof ParameterizedType)
+ {
ParameterizedType that = (ParameterizedType) obj;
Type thatOwnerType = that.getOwnerType();
Type thatRawType = that.getRawType();
- return (ownerType == null ? thatOwnerType == null : ownerType.equals(thatOwnerType)) && (rawType == null ? thatRawType == null : rawType.equals(thatRawType)) && Arrays.equals(actualTypeArguments, that.getActualTypeArguments());
- } else {
+ return (ownerType == null ? thatOwnerType == null :
+ ownerType.equals(thatOwnerType)) && (rawType == null ? thatRawType == null :
+ rawType.equals(thatRawType)) && Arrays.equals(actualTypeArguments, that.getActualTypeArguments());
+ }
+ else
+ {
return false;
}
}
@Override
- public String toString() {
+ public String toString()
+ {
StringBuilder sb = new StringBuilder();
sb.append(rawType);
- if (actualTypeArguments.length > 0) {
+ if (actualTypeArguments.length > 0)
+ {
sb.append("<");
- for (Type actualType : actualTypeArguments) {
+ for (Type actualType : actualTypeArguments)
+ {
sb.append(actualType);
sb.append(",");
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Reflections.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Reflections.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Reflections.java
index 7a80df0..5786526 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Reflections.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Reflections.java
@@ -70,6 +70,10 @@ public class Reflections
public static final Type[] EMPTY_TYPES = {};
public static final Class<?>[] EMPTY_CLASSES = new Class<?>[0];
+
+ private Reflections()
+ {
+ }
/**
* <p>
@@ -150,7 +154,8 @@ public class Reflections
{
for (AnnotatedField<? super X> annotatedField : annotatedType.getFields())
{
- if (annotatedField.getDeclaringType().getJavaClass().equals(field.getDeclaringClass()) && annotatedField.getJavaMember().getName().equals(field.getName()))
+ if (annotatedField.getDeclaringType().getJavaClass().equals(
+ field.getDeclaringClass()) && annotatedField.getJavaMember().getName().equals(field.getName()))
{
return annotatedField;
}
@@ -166,7 +171,8 @@ public class Reflections
* @return The set of annotations with the specified meta annotation, or an
* empty set if none are found
*/
- public static Set<Annotation> getAnnotationsWithMetaAnnotation(Set<Annotation> annotations, Class<? extends Annotation> metaAnnotationType)
+ public static Set<Annotation> getAnnotationsWithMetaAnnotation(
+ Set<Annotation> annotations, Class<? extends Annotation> metaAnnotationType)
{
Set<Annotation> set = new HashSet<Annotation>();
for (Annotation annotation : annotations)
@@ -366,7 +372,8 @@ public class Reflections
*/
public static Class<?> classForName(String name, ClassLoader... loaders) throws ClassNotFoundException
{
- try {
+ try
+ {
if (Thread.currentThread().getContextClassLoader() != null)
{
return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
@@ -392,17 +399,23 @@ public class Reflections
}
if (Thread.currentThread().getContextClassLoader() != null)
{
- throw new ClassNotFoundException("Could not load class " + name + " with the context class loader " + Thread.currentThread().getContextClassLoader().toString() + " or any of the additional ClassLoaders: " + Arrays.toString(loaders));
+ throw new ClassNotFoundException("Could not load class " + name +
+ " with the context class loader " + Thread.currentThread().getContextClassLoader().toString() +
+ " or any of the additional ClassLoaders: " + Arrays.toString(loaders));
}
else
{
- throw new ClassNotFoundException("Could not load class " + name + " using Class.forName or using any of the additional ClassLoaders: " + Arrays.toString(loaders));
+ throw new ClassNotFoundException("Could not load class " + name +
+ " using Class.forName or using any of the additional ClassLoaders: " +
+ Arrays.toString(loaders));
}
}
private static String buildInvokeMethodErrorMessage(Method method, Object obj, Object... args)
{
- StringBuilder message = new StringBuilder(String.format("Exception invoking method [%s] on object [%s], using arguments [", method.getName(), obj));
+ StringBuilder message = new StringBuilder(
+ String.format("Exception invoking method [%s] on object [%s], using arguments [",
+ method.getName(), obj));
if (args != null)
{
for (int i = 0; i < args.length; i++)
@@ -534,7 +547,8 @@ public class Reflections
* method fails.
* @see Method#invoke(Object, Object...)
*/
- public static <T> T invokeMethod(boolean setAccessible, Method method, Class<T> expectedReturnType, Object instance, Object... args)
+ public static <T> T invokeMethod(boolean setAccessible, Method method,
+ Class<T> expectedReturnType, Object instance, Object... args)
{
if (setAccessible && !method.isAccessible())
{
@@ -565,7 +579,8 @@ public class Reflections
}
catch (ExceptionInInitializerError e)
{
- ExceptionInInitializerError e2 = new ExceptionInInitializerError(buildInvokeMethodErrorMessage(method, instance, args));
+ ExceptionInInitializerError e2 = new ExceptionInInitializerError(
+ buildInvokeMethodErrorMessage(method, instance, args));
e2.initCause(e.getCause());
throw e2;
}
@@ -638,7 +653,8 @@ public class Reflections
}
catch (ExceptionInInitializerError e)
{
- ExceptionInInitializerError e2 = new ExceptionInInitializerError(buildSetFieldValueErrorMessage(field, instance, value));
+ ExceptionInInitializerError e2 = new ExceptionInInitializerError(
+ buildSetFieldValueErrorMessage(field, instance, value));
e2.initCause(e.getCause());
throw e2;
}
@@ -702,7 +718,8 @@ public class Reflections
}
catch (ExceptionInInitializerError e)
{
- ExceptionInInitializerError e2 = new ExceptionInInitializerError(buildGetFieldValueErrorMessage(field, instance));
+ ExceptionInInitializerError e2 = new ExceptionInInitializerError(
+ buildGetFieldValueErrorMessage(field, instance));
e2.initCause(e.getCause());
throw e2;
}
@@ -1054,14 +1071,18 @@ public class Reflections
* empty array if not a parameterized type
* @return
*/
- public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2)
+ public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1,
+ Class<?> rawType2, Type[] actualTypeArguments2)
{
- return Types.boxedClass(rawType1).isAssignableFrom(Types.boxedClass(rawType2)) && isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
+ return Types.boxedClass(rawType1).isAssignableFrom(Types.boxedClass(rawType2)) &&
+ isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
}
- public static boolean matches(Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2)
+ public static boolean matches(Class<?> rawType1, Type[] actualTypeArguments1,
+ Class<?> rawType2, Type[] actualTypeArguments2)
{
- return Types.boxedClass(rawType1).equals(Types.boxedClass(rawType2)) && isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
+ return Types.boxedClass(rawType1).equals(Types.boxedClass(rawType2)) &&
+ isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
}
public static boolean isAssignableFrom(Type[] actualTypeArguments1, Type[] actualTypeArguments2)
@@ -1133,7 +1154,8 @@ public class Reflections
ParameterizedType parameterizedType1 = (ParameterizedType) type1;
if (parameterizedType1.getRawType() instanceof Class<?>)
{
- if (isAssignableFrom((Class<?>) parameterizedType1.getRawType(), parameterizedType1.getActualTypeArguments(), type2))
+ if (isAssignableFrom((Class<?>) parameterizedType1.getRawType(),
+ parameterizedType1.getActualTypeArguments(), type2))
{
return true;
}
@@ -1147,7 +1169,8 @@ public class Reflections
return true;
}
}
- if (type2 instanceof WildcardType) {
+ if (type2 instanceof WildcardType)
+ {
WildcardType wildcardType = (WildcardType) type2;
if (isTypeBounded(type1, wildcardType.getUpperBounds(), wildcardType.getLowerBounds()))
{
@@ -1188,7 +1211,8 @@ public class Reflections
ParameterizedType parameterizedType1 = (ParameterizedType) type1;
if (parameterizedType1.getRawType() instanceof Class<?>)
{
- if (matches((Class<?>) parameterizedType1.getRawType(), parameterizedType1.getActualTypeArguments(), type2))
+ if (matches((Class<?>) parameterizedType1.getRawType(),
+ parameterizedType1.getActualTypeArguments(), type2))
{
return true;
}
@@ -1346,7 +1370,7 @@ public class Reflections
}
/**
- * Check the assiginability of a set of <b>flattened</b> types. This
+ * Check the assignability of a set of <b>flattened</b> types. This
* algorithm will check whether any of the types1 matches a type in types2
*
* @param types1
@@ -1384,8 +1408,4 @@ public class Reflections
}
- private Reflections()
- {
- }
-
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/SetAccessiblePriviligedAction.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/SetAccessiblePriviligedAction.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/SetAccessiblePriviligedAction.java
index f8020dd..64a723b 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/SetAccessiblePriviligedAction.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/SetAccessiblePriviligedAction.java
@@ -1,18 +1,20 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.deltaspike.security.impl.util.reflection;
@@ -22,18 +24,18 @@ import java.security.PrivilegedAction;
/**
* A {@link PrivilegedAction} that calls
* {@link AccessibleObject#setAccessible(boolean)}
- *
- * @author Stuart Douglas
*/
-public class SetAccessiblePriviligedAction implements PrivilegedAction<Void> {
-
+public class SetAccessiblePriviligedAction implements PrivilegedAction<Void>
+{
private final AccessibleObject member;
- public SetAccessiblePriviligedAction(AccessibleObject member) {
+ public SetAccessiblePriviligedAction(AccessibleObject member)
+ {
this.member = member;
}
- public Void run() {
+ public Void run()
+ {
member.setAccessible(true);
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Types.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Types.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Types.java
index 2115bd4..81c1a0b 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Types.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/util/reflection/Types.java
@@ -1,23 +1,20 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.deltaspike.security.impl.util.reflection;
@@ -25,76 +22,78 @@ import java.lang.reflect.Type;
/**
* Utility class for Types
- *
- * @author Pete Muir
*/
public class Types
{
+ private Types()
+ {
+
+ }
+
+ /**
+ * Gets the boxed type of a class
+ *
+ * @param type The type
+ * @return The boxed type
+ */
+ public static Type boxedType(Type type)
+ {
+ if (type instanceof Class<?>)
+ {
+ return boxedClass((Class<?>) type);
+ }
+ else
+ {
+ return type;
+ }
+ }
- /**
- * Gets the boxed type of a class
- *
- * @param type The type
- * @return The boxed type
- */
- public static Type boxedType(Type type)
- {
- if (type instanceof Class<?>)
- {
- return boxedClass((Class<?>) type);
- }
- else
- {
- return type;
- }
- }
-
- public static Class<?> boxedClass(Class<?> type)
- {
- if (!type.isPrimitive())
- {
- return type;
- }
- else if (type.equals(Boolean.TYPE))
- {
- return Boolean.class;
- }
- else if (type.equals(Character.TYPE))
- {
- return Character.class;
- }
- else if (type.equals(Byte.TYPE))
- {
- return Byte.class;
- }
- else if (type.equals(Short.TYPE))
- {
- return Short.class;
- }
- else if (type.equals(Integer.TYPE))
- {
- return Integer.class;
- }
- else if (type.equals(Long.TYPE))
- {
- return Long.class;
- }
- else if (type.equals(Float.TYPE))
- {
- return Float.class;
- }
- else if (type.equals(Double.TYPE))
- {
- return Double.class;
- }
- else if (type.equals(Void.TYPE))
- {
- return Void.class;
- }
- else
- {
- // Vagaries of if/else statement, can't be reached ;-)
- return type;
- }
- }
+ public static Class<?> boxedClass(Class<?> type)
+ {
+ if (!type.isPrimitive())
+ {
+ return type;
+ }
+ else if (type.equals(Boolean.TYPE))
+ {
+ return Boolean.class;
+ }
+ else if (type.equals(Character.TYPE))
+ {
+ return Character.class;
+ }
+ else if (type.equals(Byte.TYPE))
+ {
+ return Byte.class;
+ }
+ else if (type.equals(Short.TYPE))
+ {
+ return Short.class;
+ }
+ else if (type.equals(Integer.TYPE))
+ {
+ return Integer.class;
+ }
+ else if (type.equals(Long.TYPE))
+ {
+ return Long.class;
+ }
+ else if (type.equals(Float.TYPE))
+ {
+ return Float.class;
+ }
+ else if (type.equals(Double.TYPE))
+ {
+ return Double.class;
+ }
+ else if (type.equals(Void.TYPE))
+ {
+ return Void.class;
+ }
+ else
+ {
+ // Vagaries of if/else statement, can't be reached ;-)
+ return type;
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/InMemoryUserStorage.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/InMemoryUserStorage.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/InMemoryUserStorage.java
index 6a89e7d..2930881 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/InMemoryUserStorage.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/InMemoryUserStorage.java
@@ -25,9 +25,11 @@ import java.util.concurrent.ConcurrentHashMap;
@Exclude
class InMemoryUserStorage
-{
+{
private static Map<String, String> simpleUserPasswordMapping = new ConcurrentHashMap<String, String>();
+ private InMemoryUserStorage() { }
+
static void setPassword(String userName, String password)
{
simpleUserPasswordMapping.put(userName, password);
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/LoginLogoutTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/LoginLogoutTest.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/LoginLogoutTest.java
index 02b89cb..fc78ecd 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/LoginLogoutTest.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/LoginLogoutTest.java
@@ -22,7 +22,7 @@ import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension;
import org.apache.deltaspike.security.api.Identity;
import org.apache.deltaspike.security.api.authentication.UnexpectedCredentialException;
-import org.apache.deltaspike.security.api.credential.LoginCredential;
+import org.apache.deltaspike.security.api.credential.LoginCredentials;
import org.apache.deltaspike.test.util.ArchiveUtils;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
@@ -138,7 +138,7 @@ public class LoginLogoutTest
Assert.assertEquals(userName, identity.getUser().getId());
//X TODO stop and start new request via ContextControl - instead of:
- BeanProvider.getContextualReference(LoginCredential.class).invalidate();
+ BeanProvider.getContextualReference(LoginCredentials.class).invalidate();
try
{
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/ShopClient.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/ShopClient.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/ShopClient.java
index d90dcb0..b4ae5c3 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/ShopClient.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/ShopClient.java
@@ -20,7 +20,7 @@ package org.apache.deltaspike.test.security.impl.authentication;
import org.apache.deltaspike.security.api.Identity;
import org.apache.deltaspike.security.api.credential.Credential;
-import org.apache.deltaspike.security.api.credential.LoginCredential;
+import org.apache.deltaspike.security.api.credential.LoginCredentials;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@@ -29,7 +29,7 @@ import javax.inject.Inject;
public class ShopClient
{
@Inject
- private LoginCredential loginCredential;
+ private LoginCredentials loginCredential;
@Inject
private Identity identity;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/TestAuthenticator.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/TestAuthenticator.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/TestAuthenticator.java
index a1f4dd6..53b3041 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/TestAuthenticator.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authentication/TestAuthenticator.java
@@ -18,8 +18,9 @@
*/
package org.apache.deltaspike.test.security.impl.authentication;
-import org.apache.deltaspike.security.api.User;
-import org.apache.deltaspike.security.api.credential.LoginCredential;
+import org.apache.deltaspike.security.api.idm.User;
+import org.apache.deltaspike.security.api.credential.LoginCredentials;
+import org.apache.deltaspike.security.impl.idm.SimpleUser;
import org.apache.deltaspike.security.spi.authentication.BaseAuthenticator;
import javax.enterprise.context.RequestScoped;
@@ -29,7 +30,7 @@ import javax.inject.Inject;
public class TestAuthenticator extends BaseAuthenticator
{
@Inject
- private LoginCredential loginCredential;
+ private LoginCredentials loginCredential;
private User user;
@@ -41,7 +42,8 @@ public class TestAuthenticator extends BaseAuthenticator
if (password != null && password.equals(loginCredential.getCredential().getValue()))
{
setStatus(AuthenticationStatus.SUCCESS);
- user = new User(loginCredential.getUserId());
+
+ this.user = new SimpleUser(this.loginCredential.getUserId());
return;
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/CustomSecurityBinding.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/CustomSecurityBinding.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/CustomSecurityBinding.java
index 96bbf28..e001bc2 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/CustomSecurityBinding.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/CustomSecurityBinding.java
@@ -29,7 +29,7 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(value = RUNTIME)
-@Target({TYPE, METHOD})
+@Target({ TYPE, METHOD })
@Documented
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomAuthorizer.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomAuthorizer.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomAuthorizer.java
index 861b5ee..3b5d954 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomAuthorizer.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomAuthorizer.java
@@ -30,7 +30,8 @@ public class CustomAuthorizer
@Secures
@CustomSecurityBinding
@SuppressWarnings("UnusedDeclaration")
- public boolean doSecuredCheck(@MockParamBinding MockObject obj, InvocationContext invocationContext) throws Exception
+ public boolean doSecuredCheck(@MockParamBinding MockObject obj, InvocationContext invocationContext)
+ throws Exception
{
return obj.isValue();
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomSecurityBinding.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomSecurityBinding.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomSecurityBinding.java
index dc8900a..e321512 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomSecurityBinding.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securityparameterbinding/CustomSecurityBinding.java
@@ -29,7 +29,7 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(value = RUNTIME)
-@Target({TYPE, METHOD})
+@Target({ TYPE, METHOD })
@Documented
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6acddac9/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/util/ArchiveUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/util/ArchiveUtils.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/util/ArchiveUtils.java
index dfe16bf..af6f7ad 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/util/ArchiveUtils.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/util/ArchiveUtils.java
@@ -27,6 +27,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive;
*/
public class ArchiveUtils
{
+ private ArchiveUtils() { }
+
public static JavaArchive[] getDeltaSpikeCoreAndSecurityArchive()
{
//X TODO remove this workaround - lightguard.jp We don't need the work around, we have to have the META-INF/beans.xml for all containers