HHH-11651 - Fix checkstyle errors
This commit is contained in:
parent
5566b423e3
commit
7a897d5285
|
@ -71,11 +71,16 @@ public class ConnectionProviderBuilder implements DialectCheck {
|
|||
try {
|
||||
Class dataSourceClass = ReflectHelper.classForName( DATA_SOURCE, ConnectionProviderBuilder.class );
|
||||
DataSource actualDataSource = (DataSource) dataSourceClass.newInstance();
|
||||
ReflectHelper.findSetterMethod( dataSourceClass, "URL", String.class ).invoke( actualDataSource, String.format( URL, dbName ) );
|
||||
ReflectHelper.findSetterMethod( dataSourceClass, "URL", String.class ).invoke(
|
||||
actualDataSource,
|
||||
String.format( URL, dbName )
|
||||
);
|
||||
ReflectHelper.findSetterMethod( dataSourceClass, "user", String.class ).invoke( actualDataSource, USER );
|
||||
ReflectHelper.findSetterMethod( dataSourceClass, "password", String.class ).invoke( actualDataSource, PASS );
|
||||
ReflectHelper.findSetterMethod( dataSourceClass, "password", String.class )
|
||||
.invoke( actualDataSource, PASS );
|
||||
|
||||
final DataSourceInvocationHandler dataSourceInvocationHandler = new DataSourceInvocationHandler( actualDataSource );
|
||||
final DataSourceInvocationHandler dataSourceInvocationHandler = new DataSourceInvocationHandler(
|
||||
actualDataSource );
|
||||
|
||||
DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl() {
|
||||
@Override
|
||||
|
@ -85,10 +90,11 @@ public class ConnectionProviderBuilder implements DialectCheck {
|
|||
};
|
||||
|
||||
connectionProvider.configure(
|
||||
Collections.singletonMap( Environment.DATASOURCE,
|
||||
Collections.singletonMap(
|
||||
Environment.DATASOURCE,
|
||||
Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class[] { DataSource.class },
|
||||
new Class[] {DataSource.class},
|
||||
dataSourceInvocationHandler
|
||||
)
|
||||
)
|
||||
|
|
|
@ -368,13 +368,17 @@ public class TransactionUtil {
|
|||
.openSession();
|
||||
txn = session.getTransaction();
|
||||
txn.begin();
|
||||
function.accept(session);
|
||||
function.accept( session );
|
||||
txn.commit();
|
||||
} catch (Throwable e) {
|
||||
if ( txn != null ) txn.rollback();
|
||||
}
|
||||
catch (Throwable e) {
|
||||
if ( txn != null ) {
|
||||
txn.rollback();
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
if (session != null) {
|
||||
}
|
||||
finally {
|
||||
if ( session != null ) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
@ -402,14 +406,18 @@ public class TransactionUtil {
|
|||
.openSession();
|
||||
txn = session.getTransaction();
|
||||
txn.begin();
|
||||
R returnValue = function.apply(session);
|
||||
R returnValue = function.apply( session );
|
||||
txn.commit();
|
||||
return returnValue;
|
||||
} catch (Throwable e) {
|
||||
if ( txn != null ) txn.rollback();
|
||||
}
|
||||
catch (Throwable e) {
|
||||
if ( txn != null ) {
|
||||
txn.rollback();
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
if (session != null) {
|
||||
}
|
||||
finally {
|
||||
if ( session != null ) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue