Skip to content
Browse files

code format and fixing typo

  • Loading branch information...
1 parent 1c0b551 commit 781133164be32dcb6188227f4f8d5d5a8195c425 @stliu stliu committed Dec 31, 2012
View
2 CONTRIBUTING.md
@@ -24,7 +24,7 @@ on the Jira HHH-123 : `git checkout -b HHH-123 master`
## Code
-Do yo thang!
+Do yo thing!
## Commit
View
2 hibernate-core/src/main/java/org/hibernate/engine/spi/FilterDefinition.java
@@ -66,7 +66,7 @@ public String getFilterName() {
*
* @return The parameters named by this configuration.
*/
- public Set getParameterNames() {
+ public Set<String> getParameterNames() {
return parameterTypes.keySet();
}
View
8 hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java
@@ -55,8 +55,8 @@
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 void setInternalFetchProfile(String internalFetchProfile) {
// filter support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean hasEnabledFilters() {
- return enabledFilters != null && !enabledFilters.isEmpty();
+ return !enabledFilters.isEmpty();
}
public Map<String,Filter> getEnabledFilters() {
@@ -167,7 +167,7 @@ public Type getFilterParameterType(String filterParameterName) {
// fetch profile support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean hasEnabledFetchProfiles() {
- return enabledFetchProfileNames != null && !enabledFetchProfileNames.isEmpty();
+ return !enabledFetchProfileNames.isEmpty();
}
public Set getEnabledFetchProfileNames() {
View
4 hibernate-core/src/main/java/org/hibernate/internal/ConnectionObserverStatsBridge.java
@@ -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();
}
}
@@ -56,7 +56,7 @@ public void logicalConnectionClosed() {
@Override
public void statementPrepared() {
- if (sessionFactory.getStatistics().isStatisticsEnabled()) {
+ if ( sessionFactory.getStatistics().isStatisticsEnabled() ) {
sessionFactory.getStatisticsImplementor().prepareStatement();
}
}
View
7 hibernate-core/src/main/java/org/hibernate/internal/FilterImpl.java
@@ -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 + "]" );
@@ -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"
View
13 hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java
@@ -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;
@@ -1326,14 +1327,16 @@ public ClassMetadata getClassMetadata(String entityName) throws HibernateExcepti
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;
}
}
@@ -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() {

0 comments on commit 7811331

Please sign in to comment.
Something went wrong with that request. Please try again.