Skip to content

Commit

Permalink
HV-912 Reducing accessibility of some classes and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling authored and hferentschik committed Jul 24, 2014
1 parent cc782d6 commit ea88f45
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ private ConfiguredConstraint(ConstraintDef<?, A> constraint, L location) {
this.location = location;
}

public static <A extends Annotation> ConfiguredConstraint<A, BeanConstraintLocation> forType(ConstraintDef<?, A> constraint, Class<?> beanType) {
static <A extends Annotation> ConfiguredConstraint<A, BeanConstraintLocation> forType(ConstraintDef<?, A> constraint, Class<?> beanType) {
return new ConfiguredConstraint<A, BeanConstraintLocation>(
constraint, new BeanConstraintLocation( beanType )
);
}

public static <A extends Annotation> ConfiguredConstraint<A, BeanConstraintLocation> forProperty(ConstraintDef<?, A> constraint, Member member) {
static <A extends Annotation> ConfiguredConstraint<A, BeanConstraintLocation> forProperty(ConstraintDef<?, A> constraint, Member member) {

return new ConfiguredConstraint<A, BeanConstraintLocation>(
constraint, new BeanConstraintLocation( member )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* @author Gunnar Morling
*/
public abstract class ConstraintMappingContextImplBase {
abstract class ConstraintMappingContextImplBase {

private static final Log log = LoggerFactory.make();

Expand Down Expand Up @@ -100,7 +100,7 @@ public MethodConstraintMappingContext method(String name, Class<?>... parameterT
*
* @return the member which matching the name and type or {@code null} if no such member exists.
*/
public static Member getMember(Class<?> clazz, String property, ElementType elementType) {
private Member getMember(Class<?> clazz, String property, ElementType elementType) {

Contracts.assertNotNull( clazz, MESSAGES.classCannotBeNull() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
* @author Kevin Pollet <[email protected]> (C) 2011 SERLI
* @author Gunnar Morling
*/
public class MethodConstraintMappingContextImpl implements MethodConstraintMappingContext {
class MethodConstraintMappingContextImpl implements MethodConstraintMappingContext {

private final Class<?> beanClass;
private final Method method;
private final ConstraintMappingContext mapping;

public MethodConstraintMappingContextImpl(Class<?> beanClass, Method method, ConstraintMappingContext mapping) {
MethodConstraintMappingContextImpl(Class<?> beanClass, Method method, ConstraintMappingContext mapping) {

this.beanClass = beanClass;
this.method = method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @author Gunnar Morling
* @author Kevin Pollet <[email protected]> (C) 2011 SERLI
*/
public final class ParameterConstraintMappingContextImpl
final class ParameterConstraintMappingContextImpl
extends ConstraintMappingContextImplBase
implements ParameterConstraintMappingContext {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class PropertyConstraintMappingContextImpl extends ConstraintMappin

private final Member member;

public PropertyConstraintMappingContextImpl(Class<?> beanClass, Member member, ConstraintMappingContext mapping) {
PropertyConstraintMappingContextImpl(Class<?> beanClass, Member member, ConstraintMappingContext mapping) {
super( beanClass, mapping );

this.member = member;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
* @author Gunnar Morling
* @author Kevin Pollet <[email protected]> (C) 2011 SERLI
*/
public final class ReturnValueConstraintMappingContextImpl
final class ReturnValueConstraintMappingContextImpl
extends ConstraintMappingContextImplBase
implements ReturnValueConstraintMappingContext {

private final Method method;

public ReturnValueConstraintMappingContextImpl(Class<?> beanClass, Method method, ConstraintMappingContext mapping) {
ReturnValueConstraintMappingContextImpl(Class<?> beanClass, Method method, ConstraintMappingContext mapping) {

super( beanClass, mapping );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
* @author Davide Marchignoli
* @see java.lang.annotation.Annotation
*/
public class AnnotationProxy implements Annotation, InvocationHandler, Serializable {
class AnnotationProxy implements Annotation, InvocationHandler, Serializable {

private static final long serialVersionUID = 6907601010599429454L;
private static final Log log = LoggerFactory.make();

private final Class<? extends Annotation> annotationType;
private final Map<String, Object> values;

public AnnotationProxy(AnnotationDescriptor<?> descriptor) {
AnnotationProxy(AnnotationDescriptor<?> descriptor) {
this.annotationType = descriptor.type();
values = getAnnotationValues( descriptor );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.validator.internal.util;
package org.hibernate.validator.internal.xml;

import java.io.BufferedInputStream;
import java.io.InputStream;
Expand All @@ -30,7 +30,7 @@
*
* @author Hardy Ferentschik
*/
public final class ResourceLoaderHelper {
final class ResourceLoaderHelper {
private static final Log log = LoggerFactory.make();

/**
Expand All @@ -44,7 +44,7 @@ public final class ResourceLoaderHelper {
*
* @see InputStream#markSupported()
*/
public static InputStream getResettableInputStreamForPath(String path) {
static InputStream getResettableInputStreamForPath(String path) {
//TODO not sure if it's the right thing to removing '/'
String inputPath = path;
if ( inputPath.startsWith( "/" ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class PlatformResourceBundleLocator
implements ResourceBundleLocator, org.hibernate.validator.spi.resourceloading.ResourceBundleLocator {
private static final Logger log = Logger.getLogger( PlatformResourceBundleLocator.class.getName() );
private String bundleName;
private final String bundleName;

public PlatformResourceBundleLocator(String bundleName) {
this.bundleName = bundleName;
Expand All @@ -49,6 +49,7 @@ public PlatformResourceBundleLocator(String bundleName) {
*
* @return the resource bundle or <code>null</code> if none is found.
*/
@Override
public ResourceBundle getResourceBundle(Locale locale) {
ResourceBundle rb = null;
ClassLoader classLoader = GetClassLoader.fromContext();
Expand Down Expand Up @@ -91,7 +92,7 @@ private ResourceBundle loadBundle(ClassLoader classLoader, Locale locale, String
private static class GetClassLoader implements PrivilegedAction<ClassLoader> {
private final Class<?> clazz;

public static ClassLoader fromContext() {
private static ClassLoader fromContext() {
final GetClassLoader action = new GetClassLoader( null );
if ( System.getSecurityManager() != null ) {
return AccessController.doPrivileged( action );
Expand All @@ -101,7 +102,7 @@ public static ClassLoader fromContext() {
}
}

public static ClassLoader fromClass(Class<?> clazz) {
private static ClassLoader fromClass(Class<?> clazz) {
if ( clazz == null ) {
throw new IllegalArgumentException( "Class is null" );
}
Expand All @@ -118,6 +119,7 @@ private GetClassLoader(Class<?> clazz) {
this.clazz = clazz;
}

@Override
public ClassLoader run() {
if ( clazz != null ) {
return clazz.getClassLoader();
Expand Down

0 comments on commit ea88f45

Please sign in to comment.