/*
 * 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 com.agimatec.validation.jsr303;

import com.agimatec.validation.jsr303.util.SecureActions;
import org.apache.commons.lang.ClassUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.validation.Path;
import javax.validation.TraversableResolver;
import java.lang.annotation.ElementType;


/** @see javax.validation.TraversableResolver */
public class DefaultTraversableResolver implements TraversableResolver {
    private static final Log log = LogFactory.getLog(DefaultTraversableResolver.class);

    /** Class to load to check whether JPA 2 is on the classpath. */
    private static final String PERSISTENCE_UTIL_CLASSNAME =
          "javax.persistence.PersistenceUtil";

    /** Class to instantiate in case JPA 2 is on the classpath. */
    private static final String JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME =
          "com.agimatec.validation.jsr303.JPATraversableResolver";


    private TraversableResolver jpaTR;


    public DefaultTraversableResolver() {
        initJpa();
    }

    public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
                               Class<?> rootBeanType, Path pathToTraversableObject,
                               ElementType elementType) {
        return jpaTR == null || jpaTR.isReachable(traversableObject, traversableProperty,
              rootBeanType, pathToTraversableObject, elementType);
    }

    public boolean isCascadable(Object traversableObject, Path.Node traversableProperty,
                                Class<?> rootBeanType, Path pathToTraversableObject,
                                ElementType elementType) {
        return jpaTR == null || jpaTR.isCascadable(traversableObject, traversableProperty,
              rootBeanType, pathToTraversableObject, elementType);
    }

    /** Tries to load detect and load JPA. */
    private void initJpa() {
        try {
            ClassUtils.getClass(PERSISTENCE_UTIL_CLASSNAME);
            log.debug("Found " + PERSISTENCE_UTIL_CLASSNAME + " on classpath.");
        } catch (Exception e) {
            log.debug("Cannot find " + PERSISTENCE_UTIL_CLASSNAME +
                  " on classpath. All properties will per default be traversable.");
            return;
        }

        try {
            Class<? extends TraversableResolver> jpaAwareResolverClass =
                  (Class<? extends TraversableResolver>) ClassUtils
                        .getClass(JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME);
            jpaTR = SecureActions.newInstance(jpaAwareResolverClass);
            log.info("Instantiated an instance of " +
                  JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME + ".");
        } catch (Exception e) {
            log.info("Unable to load or instanciate JPA aware resolver " +
                  JPA_AWARE_TRAVERSABLE_RESOLVER_CLASSNAME +
                  ". All properties will per default be traversable.");
        }
    }

}

@@ -3556,20 +3556,20 @@
     log.
-info
+warn
 (%22Unable

make log msg a warn