Skip to content

Commit

Permalink
code format and fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
stliu committed Dec 31, 2012
1 parent 1c0b551 commit 7811331
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -24,7 +24,7 @@ on the Jira HHH-123 : `git checkout -b HHH-123 master`


## Code
Do yo thang!
Do yo thing!

## Commit

Expand Down
Expand Up @@ -66,7 +66,7 @@ public String getFilterName() {
*
* @return The parameters named by this configuration.
*/
public Set getParameterNames() {
public Set<String> getParameterNames() {
return parameterTypes.keySet();
}

Expand Down
Expand Up @@ -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() );
Expand Down Expand Up @@ -96,7 +96,7 @@ public void setInternalFetchProfile(String internalFetchProfile) {
// filter support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public boolean hasEnabledFilters() {
return enabledFilters != null && !enabledFilters.isEmpty();
return !enabledFilters.isEmpty();
}

public Map<String,Filter> getEnabledFilters() {
Expand Down Expand Up @@ -167,7 +167,7 @@ public static String[] parseFilterParameterName(String filterParameterName) {
// fetch profile support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public boolean hasEnabledFetchProfiles() {
return enabledFetchProfileNames != null && !enabledFetchProfileNames.isEmpty();
return !enabledFetchProfileNames.isEmpty();
}

public Set getEnabledFetchProfileNames() {
Expand Down
Expand Up @@ -41,7 +41,7 @@ public ConnectionObserverStatsBridge(SessionFactoryImplementor sessionFactory) {

@Override
public void physicalConnectionObtained(Connection connection) {
if (sessionFactory.getStatistics().isStatisticsEnabled()) {
if ( sessionFactory.getStatistics().isStatisticsEnabled() ) {
sessionFactory.getStatisticsImplementor().connect();
}
}
Expand All @@ -56,7 +56,7 @@ public void logicalConnectionClosed() {

@Override
public void statementPrepared() {
if (sessionFactory.getStatistics().isStatisticsEnabled()) {
if ( sessionFactory.getStatistics().isStatisticsEnabled() ) {
sessionFactory.getStatisticsImplementor().prepareStatement();
}
}
Expand Down
Expand Up @@ -120,7 +120,7 @@ public Filter setParameterList(String name, Collection values) throws HibernateE
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 + "]" );
Expand Down Expand Up @@ -161,9 +161,8 @@ public Object getParameter(String name) {
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"
Expand Down
Expand Up @@ -109,6 +109,7 @@
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;
Expand Down Expand Up @@ -1326,14 +1327,16 @@ public String[] getImplementors(String className) throws MappingException {
return results.toArray( new String[results.size()] );
}

@Override
public String getImportedClassName(String className) {
String result = imports.get(className);
if (result==null) {
String result = imports.get( className );
if ( result == null ) {
try {
serviceRegistry.getService( ClassLoaderService.class ).classForName( className );
imports.put( className, className );
return className;
}
catch (ClassLoadingException cnfe) {
catch ( ClassLoadingException cnfe ) {
return null;
}
}
Expand Down Expand Up @@ -1515,8 +1518,8 @@ public IdentifierGenerator getIdentifierGenerator(String rootEntityName) {
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() {
Expand Down

0 comments on commit 7811331

Please sign in to comment.