Author: hardy.ferentschik
Date: 2010-05-22 08:31:15 -0400 (Sat, 22 May 2010)
New Revision: 19588
Removed:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/ContainsMethod.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/GetDeclaredField.java
Log:
HV-274 removed some unnecessary depednecies between util and privilegedaction package
Deleted:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/ContainsMethod.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/ContainsMethod.java 2010-05-22
12:09:58 UTC (rev 19587)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/ContainsMethod.java 2010-05-22
12:31:15 UTC (rev 19588)
@@ -1,43 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, 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 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.hibernate.validator.util.privilegedactions;
-
-import java.security.PrivilegedAction;
-
-import org.hibernate.validator.util.ReflectionHelper;
-
-/**
- * @author Emmanuel Bernard
- */
-public class ContainsMethod implements PrivilegedAction<Boolean> {
- private final Class<?> clazz;
- private final String property;
-
- public static ContainsMethod action(Class<?> clazz, String property) {
- return new ContainsMethod( clazz, property );
- }
-
- private ContainsMethod(Class<?> clazz, String property) {
- this.clazz = clazz;
- this.property = property;
- }
-
- public Boolean run() {
- return ReflectionHelper.getMethodFromPropertyName( clazz, property ) != null;
- }
-}
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/GetDeclaredField.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/GetDeclaredField.java 2010-05-22
12:09:58 UTC (rev 19587)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/GetDeclaredField.java 2010-05-22
12:31:15 UTC (rev 19588)
@@ -20,8 +20,6 @@
import java.lang.reflect.Field;
import java.security.PrivilegedAction;
-import org.hibernate.validator.util.ReflectionHelper;
-
/**
* @author Emmanuel Bernard
*/
@@ -41,7 +39,7 @@
public Field run() {
try {
final Field field = clazz.getDeclaredField( fieldName );
- ReflectionHelper.setAccessibility( field );
+ field.setAccessible( true );
return field;
}
catch ( NoSuchFieldException e ) {