changes as suggested. reverted resetBits and method.getParameterCount()

pull/539/head
Nitin 9 years ago
parent 573660dfe1
commit 99cacb33b2

@ -171,28 +171,35 @@ abstract class PoolBase
void resetConnectionState(final Connection connection, final ProxyConnection proxyConnection, final int dirtyBits) throws SQLException
{
int resetBits = 0;
if ((dirtyBits & DIRTY_BIT_READONLY) != 0 && proxyConnection.getReadOnlyState() != isReadOnly) {
connection.setReadOnly(isReadOnly);
resetBits |= DIRTY_BIT_READONLY;
}
if ((dirtyBits & DIRTY_BIT_AUTOCOMMIT) != 0 && proxyConnection.getAutoCommitState() != isAutoCommit) {
connection.setAutoCommit(isAutoCommit);
resetBits |= DIRTY_BIT_AUTOCOMMIT;
}
if ((dirtyBits & DIRTY_BIT_ISOLATION) != 0 && proxyConnection.getTransactionIsolationState() != transactionIsolation) {
connection.setTransactionIsolation(transactionIsolation);
resetBits |= DIRTY_BIT_ISOLATION;
}
if ((dirtyBits & DIRTY_BIT_CATALOG) != 0 && catalog != null && !catalog.equals(proxyConnection.getCatalogState())) {
connection.setCatalog(catalog);
resetBits |= DIRTY_BIT_CATALOG;
}
if ((dirtyBits & DIRTY_BIT_NETTIMEOUT) != 0 && proxyConnection.getNetworkTimeoutState() != networkTimeout) {
setNetworkTimeout(connection, networkTimeout);
resetBits |= DIRTY_BIT_NETTIMEOUT;
}
if (dirtyBits != 0 && LOGGER.isDebugEnabled()) {
LOGGER.debug("{} - Reset ({}) on connection {}", poolName, stringFromResetBits(dirtyBits), connection);
if (resetBits != 0 && LOGGER.isDebugEnabled()) {
LOGGER.debug("{} - Reset ({}) on connection {}", poolName, stringFromResetBits(resetBits), connection);
}
}

@ -81,7 +81,7 @@ public final class PropertyElf
Matcher matcher = GETTER_PATTERN.matcher("");
for (Method method : targetClass.getMethods()) {
String name = method.getName();
if (method.getParameterCount() == 0 && matcher.reset(name).matches()) {
if (method.getParameterTypes().length == 0 && matcher.reset(name).matches()) {
name = name.replaceFirst("(get|is)", "");
try {
if (targetClass.getMethod("set" + name, method.getReturnType()) != null) {
@ -132,7 +132,7 @@ public final class PropertyElf
String methodName = "set" + propName.substring(0, 1).toUpperCase() + propName.substring(1);
for (Method method : methods) {
if (method.getParameterCount() == 1 && method.getName().equals(methodName)) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == 1) {
writeMethod = method;
break;
}
@ -141,7 +141,7 @@ public final class PropertyElf
if (writeMethod == null) {
methodName = "set" + propName.toUpperCase();
for (Method method : methods) {
if (method.getParameterCount() == 1 && method.getName().equals(methodName)) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == 1) {
writeMethod = method;
break;
}

Loading…
Cancel
Save