Convert CRLF (dos) to LF (unix)

Prior to this change, roughly 5% (~300 out of 6000+) of files under the
source tree had CRLF line endings as opposed to the majority which have
LF endings.

This change normalizes these files to LF for consistency going forward.

Command used:

$ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix

Issue: SPR-5608
This commit is contained in:
Chris Beams
2011-12-21 14:40:03 +01:00
parent 096de373b4
commit ae72cf2f50
292 changed files with 30756 additions and 30756 deletions

View File

@@ -1,123 +1,123 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* 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.springframework.orm.hibernate3;
import java.lang.reflect.Method;
import java.util.Properties;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.QueryResultsRegion;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.TimestampsRegion;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cfg.Settings;
import org.springframework.util.ReflectionUtils;
/**
* Proxy for a Hibernate RegionFactory, delegating to a Spring-managed
* RegionFactory instance, determined by LocalSessionFactoryBean's
* "cacheRegionFactory" property.
*
* <p>Compatible with Hibernate 3.3 as well as Hibernate 3.5's version
* of the RegionFactory SPI.
*
* @author Juergen Hoeller
* @since 3.0
* @see LocalSessionFactoryBean#setCacheRegionFactory
*/
public class LocalRegionFactoryProxy implements RegionFactory {
private final RegionFactory regionFactory;
/**
* Standard constructor.
*/
public LocalRegionFactoryProxy() {
RegionFactory rf = (RegionFactory) LocalSessionFactoryBean.getConfigTimeRegionFactory();
// absolutely needs thread-bound RegionFactory to initialize
if (rf == null) {
throw new IllegalStateException("No Hibernate RegionFactory found - " +
"'cacheRegionFactory' property must be set on LocalSessionFactoryBean");
}
this.regionFactory = rf;
}
/**
* Properties constructor: not used by this class or formally required,
* but enforced by Hibernate when reflectively instantiating a RegionFactory.
*/
public LocalRegionFactoryProxy(Properties properties) {
this();
}
public void start(Settings settings, Properties properties) throws CacheException {
this.regionFactory.start(settings, properties);
}
public void stop() {
this.regionFactory.stop();
}
public boolean isMinimalPutsEnabledByDefault() {
return this.regionFactory.isMinimalPutsEnabledByDefault();
}
public AccessType getDefaultAccessType() {
try {
Method method = RegionFactory.class.getMethod("getDefaultAccessType");
return (AccessType) ReflectionUtils.invokeMethod(method, this.regionFactory);
}
catch (NoSuchMethodException ex) {
throw new IllegalStateException("getDefaultAccessType requires Hibernate 3.5+");
}
}
public long nextTimestamp() {
return this.regionFactory.nextTimestamp();
}
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
throws CacheException {
return this.regionFactory.buildEntityRegion(regionName, properties, metadata);
}
public CollectionRegion buildCollectionRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
return this.regionFactory.buildCollectionRegion(regionName, properties, metadata);
}
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties)
throws CacheException {
return this.regionFactory.buildQueryResultsRegion(regionName, properties);
}
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties)
throws CacheException {
return this.regionFactory.buildTimestampsRegion(regionName, properties);
}
}
/*
* Copyright 2002-2010 the original author or authors.
*
* 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.springframework.orm.hibernate3;
import java.lang.reflect.Method;
import java.util.Properties;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.QueryResultsRegion;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.TimestampsRegion;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cfg.Settings;
import org.springframework.util.ReflectionUtils;
/**
* Proxy for a Hibernate RegionFactory, delegating to a Spring-managed
* RegionFactory instance, determined by LocalSessionFactoryBean's
* "cacheRegionFactory" property.
*
* <p>Compatible with Hibernate 3.3 as well as Hibernate 3.5's version
* of the RegionFactory SPI.
*
* @author Juergen Hoeller
* @since 3.0
* @see LocalSessionFactoryBean#setCacheRegionFactory
*/
public class LocalRegionFactoryProxy implements RegionFactory {
private final RegionFactory regionFactory;
/**
* Standard constructor.
*/
public LocalRegionFactoryProxy() {
RegionFactory rf = (RegionFactory) LocalSessionFactoryBean.getConfigTimeRegionFactory();
// absolutely needs thread-bound RegionFactory to initialize
if (rf == null) {
throw new IllegalStateException("No Hibernate RegionFactory found - " +
"'cacheRegionFactory' property must be set on LocalSessionFactoryBean");
}
this.regionFactory = rf;
}
/**
* Properties constructor: not used by this class or formally required,
* but enforced by Hibernate when reflectively instantiating a RegionFactory.
*/
public LocalRegionFactoryProxy(Properties properties) {
this();
}
public void start(Settings settings, Properties properties) throws CacheException {
this.regionFactory.start(settings, properties);
}
public void stop() {
this.regionFactory.stop();
}
public boolean isMinimalPutsEnabledByDefault() {
return this.regionFactory.isMinimalPutsEnabledByDefault();
}
public AccessType getDefaultAccessType() {
try {
Method method = RegionFactory.class.getMethod("getDefaultAccessType");
return (AccessType) ReflectionUtils.invokeMethod(method, this.regionFactory);
}
catch (NoSuchMethodException ex) {
throw new IllegalStateException("getDefaultAccessType requires Hibernate 3.5+");
}
}
public long nextTimestamp() {
return this.regionFactory.nextTimestamp();
}
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
throws CacheException {
return this.regionFactory.buildEntityRegion(regionName, properties, metadata);
}
public CollectionRegion buildCollectionRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
return this.regionFactory.buildCollectionRegion(regionName, properties, metadata);
}
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties)
throws CacheException {
return this.regionFactory.buildQueryResultsRegion(regionName, properties);
}
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties)
throws CacheException {
return this.regionFactory.buildTimestampsRegion(regionName, properties);
}
}

View File

@@ -1,40 +1,40 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* 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.springframework.orm.jpa.persistenceunit;
import javax.persistence.spi.PersistenceUnitInfo;
/**
* Extension of the standard JPA PersistenceUnitInfo interface, for advanced collaboration
* between Spring's {@link org.springframework.orm.jpa.LocalEntityManagerFactoryBean} and
* {@link PersistenceUnitManager} implementations.
*
* @author Juergen Hoeller
* @since 3.0.1
* @see PersistenceUnitManager
* @see org.springframework.orm.jpa.LocalEntityManagerFactoryBean
*/
public interface SmartPersistenceUnitInfo extends PersistenceUnitInfo {
/**
* Set the persistence provider's own package name, for exclusion from class transformation.
* @see #addTransformer(javax.persistence.spi.ClassTransformer)
* @see #getNewTempClassLoader()
*/
void setPersistenceProviderPackageName(String persistenceProviderPackageName);
}
/*
* Copyright 2002-2010 the original author or authors.
*
* 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.springframework.orm.jpa.persistenceunit;
import javax.persistence.spi.PersistenceUnitInfo;
/**
* Extension of the standard JPA PersistenceUnitInfo interface, for advanced collaboration
* between Spring's {@link org.springframework.orm.jpa.LocalEntityManagerFactoryBean} and
* {@link PersistenceUnitManager} implementations.
*
* @author Juergen Hoeller
* @since 3.0.1
* @see PersistenceUnitManager
* @see org.springframework.orm.jpa.LocalEntityManagerFactoryBean
*/
public interface SmartPersistenceUnitInfo extends PersistenceUnitInfo {
/**
* Set the persistence provider's own package name, for exclusion from class transformation.
* @see #addTransformer(javax.persistence.spi.ClassTransformer)
* @see #getNewTempClassLoader()
*/
void setPersistenceProviderPackageName(String persistenceProviderPackageName);
}

View File

@@ -1,56 +1,56 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* 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.springframework.orm.jpa.vendor;
import javax.persistence.EntityManagerFactory;
import org.hibernate.SessionFactory;
import org.hibernate.ejb.HibernateEntityManagerFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.orm.jpa.EntityManagerFactoryAccessor;
import org.springframework.util.Assert;
/**
* Simple <code>FactoryBean</code> that exposes the underlying {@link SessionFactory}
* behind a Hibernate-backed JPA {@link EntityManagerFactory}.
*
* <p>Primarily available for resolving a SessionFactory by JPA persistence unit name
* via the {@link #setPersistenceUnitName "persistenceUnitName"} bean property.
*
* @author Juergen Hoeller
* @since 3.1
* @see #setPersistenceUnitName
* @see #setEntityManagerFactory
*/
public class HibernateJpaSessionFactoryBean extends EntityManagerFactoryAccessor implements FactoryBean<SessionFactory> {
public SessionFactory getObject() {
EntityManagerFactory emf = getEntityManagerFactory();
Assert.isInstanceOf(HibernateEntityManagerFactory.class, emf);
return ((HibernateEntityManagerFactory) emf).getSessionFactory();
}
public Class<?> getObjectType() {
return SessionFactory.class;
}
public boolean isSingleton() {
return true;
}
}
/*
* Copyright 2002-2011 the original author or authors.
*
* 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.springframework.orm.jpa.vendor;
import javax.persistence.EntityManagerFactory;
import org.hibernate.SessionFactory;
import org.hibernate.ejb.HibernateEntityManagerFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.orm.jpa.EntityManagerFactoryAccessor;
import org.springframework.util.Assert;
/**
* Simple <code>FactoryBean</code> that exposes the underlying {@link SessionFactory}
* behind a Hibernate-backed JPA {@link EntityManagerFactory}.
*
* <p>Primarily available for resolving a SessionFactory by JPA persistence unit name
* via the {@link #setPersistenceUnitName "persistenceUnitName"} bean property.
*
* @author Juergen Hoeller
* @since 3.1
* @see #setPersistenceUnitName
* @see #setEntityManagerFactory
*/
public class HibernateJpaSessionFactoryBean extends EntityManagerFactoryAccessor implements FactoryBean<SessionFactory> {
public SessionFactory getObject() {
EntityManagerFactory emf = getEntityManagerFactory();
Assert.isInstanceOf(HibernateEntityManagerFactory.class, emf);
return ((HibernateEntityManagerFactory) emf).getSessionFactory();
}
public Class<?> getObjectType() {
return SessionFactory.class;
}
public boolean isSingleton() {
return true;
}
}

View File

@@ -1,73 +1,73 @@
/*
* Copyright 2002-2009 the original author or authors.
*
* 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.springframework.orm.hibernate3;
import java.io.Serializable;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer;
import org.junit.Test;
import org.springframework.beans.BeanUtils;
/**
* Test for compatibility of Spring's BeanUtils and its BridgeMethodResolver use
* when operating on a Hibernate-generated CGLIB proxy class.
*
* @author Arnout Engelen
* @author Juergen Hoeller
*/
public class CglibProxyBridgeMethodTests {
@Test
public void introspectHibernateProxyForGenericClass() {
BeanUtils.getPropertyDescriptor(CglibInstantieMedewerker.class, "organisatie");
Class<?> clazz = CGLIBLazyInitializer.getProxyFactory(
CglibInstantieMedewerker.class, new Class[] {HibernateProxy.class});
BeanUtils.getPropertyDescriptor(clazz, "organisatie");
}
public interface CglibIOrganisatie {
}
public class CglibOrganisatie implements CglibIOrganisatie {
}
public class CglibInstantie extends CglibOrganisatie {
}
public interface CglibIOrganisatieMedewerker<T extends CglibIOrganisatie> {
void setOrganisatie(T organisatie);
}
public class CglibOrganisatieMedewerker<T extends CglibOrganisatie> implements CglibIOrganisatieMedewerker<T> {
public void setOrganisatie(CglibOrganisatie organisatie) {
}
}
public class CglibInstantieMedewerker extends CglibOrganisatieMedewerker<CglibInstantie> implements Serializable {
}
}
/*
* Copyright 2002-2009 the original author or authors.
*
* 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.springframework.orm.hibernate3;
import java.io.Serializable;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer;
import org.junit.Test;
import org.springframework.beans.BeanUtils;
/**
* Test for compatibility of Spring's BeanUtils and its BridgeMethodResolver use
* when operating on a Hibernate-generated CGLIB proxy class.
*
* @author Arnout Engelen
* @author Juergen Hoeller
*/
public class CglibProxyBridgeMethodTests {
@Test
public void introspectHibernateProxyForGenericClass() {
BeanUtils.getPropertyDescriptor(CglibInstantieMedewerker.class, "organisatie");
Class<?> clazz = CGLIBLazyInitializer.getProxyFactory(
CglibInstantieMedewerker.class, new Class[] {HibernateProxy.class});
BeanUtils.getPropertyDescriptor(clazz, "organisatie");
}
public interface CglibIOrganisatie {
}
public class CglibOrganisatie implements CglibIOrganisatie {
}
public class CglibInstantie extends CglibOrganisatie {
}
public interface CglibIOrganisatieMedewerker<T extends CglibIOrganisatie> {
void setOrganisatie(T organisatie);
}
public class CglibOrganisatieMedewerker<T extends CglibOrganisatie> implements CglibIOrganisatieMedewerker<T> {
public void setOrganisatie(CglibOrganisatie organisatie) {
}
}
public class CglibInstantieMedewerker extends CglibOrganisatieMedewerker<CglibInstantie> implements Serializable {
}
}