code format and fixing typo

This commit is contained in:
Strong Liu 2012-12-31 22:00:51 +08:00
parent 1c0b551055
commit 781133164b
6 changed files with 19 additions and 17 deletions

View File

@ -24,7 +24,7 @@ on the Jira HHH-123 : `git checkout -b HHH-123 master`
## Code
Do yo thang!
Do yo thing!
## Commit

View File

@ -66,7 +66,7 @@ public class FilterDefinition implements Serializable {
*
* @return The parameters named by this configuration.
*/
public Set getParameterNames() {
public Set<String> getParameterNames() {
return parameterTypes.keySet();
}

View File

@ -55,8 +55,8 @@ public class LoadQueryInfluencers implements Serializable {
private final SessionFactoryImplementor sessionFactory;
private String internalFetchProfile;
private Map<String,Filter> enabledFilters;
private Set<String> enabledFetchProfileNames;
private final Map<String,Filter> enabledFilters;
private final Set<String> enabledFetchProfileNames;
public LoadQueryInfluencers() {
this( null, Collections.<String, Filter>emptyMap(), Collections.<String>emptySet() );
@ -96,7 +96,7 @@ public class LoadQueryInfluencers implements Serializable {
// filter support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean hasEnabledFilters() {
return enabledFilters != null && !enabledFilters.isEmpty();
return !enabledFilters.isEmpty();
}
public Map<String,Filter> getEnabledFilters() {
@ -167,7 +167,7 @@ public class LoadQueryInfluencers implements Serializable {
// fetch profile support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean hasEnabledFetchProfiles() {
return enabledFetchProfileNames != null && !enabledFetchProfileNames.isEmpty();
return !enabledFetchProfileNames.isEmpty();
}
public Set getEnabledFetchProfileNames() {

View File

@ -120,7 +120,7 @@ public class FilterImpl implements Filter, Serializable {
if ( type == null ) {
throw new HibernateException( "Undefined filter parameter [" + name + "]" );
}
if ( values.size() > 0 ) {
if ( !values.isEmpty() ) {
Class elementClass = values.iterator().next().getClass();
if ( !type.getReturnedClass().isAssignableFrom( elementClass ) ) {
throw new HibernateException( "Incorrect type for parameter [" + name + "]" );
@ -161,9 +161,8 @@ public class FilterImpl implements Filter, Serializable {
public void validate() throws HibernateException {
// for each of the defined parameters, make sure its value
// has been set
Iterator itr = definition.getParameterNames().iterator();
while ( itr.hasNext() ) {
final String parameterName = (String) itr.next();
for ( final String parameterName : definition.getParameterNames() ) {
if ( parameters.get( parameterName ) == null ) {
throw new HibernateException(
"Filter [" + getName() + "] parameter [" + parameterName + "] value not set"

View File

@ -109,6 +109,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionOwner;
import org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl;
import org.hibernate.engine.transaction.spi.TransactionEnvironment;
import org.hibernate.engine.transaction.spi.TransactionFactory;
import org.hibernate.exception.spi.SQLExceptionConverter;
import org.hibernate.id.IdentifierGenerator;
import org.hibernate.id.UUIDGenerator;
@ -1326,11 +1327,13 @@ public final class SessionFactoryImpl
return results.toArray( new String[results.size()] );
}
@Override
public String getImportedClassName(String className) {
String result = imports.get( className );
if ( result == null ) {
try {
serviceRegistry.getService( ClassLoaderService.class ).classForName( className );
imports.put( className, className );
return className;
}
catch ( ClassLoadingException cnfe ) {
@ -1515,8 +1518,8 @@ public final class SessionFactoryImpl
return identifierGenerators.get(rootEntityName);
}
private org.hibernate.engine.transaction.spi.TransactionFactory transactionFactory() {
return serviceRegistry.getService( org.hibernate.engine.transaction.spi.TransactionFactory.class );
private TransactionFactory transactionFactory() {
return serviceRegistry.getService( TransactionFactory.class );
}
private boolean canAccessTransactionManager() {