Minor code cleanup.

pull/84/head
Brett Wooldridge 11 years ago
parent 262cf1ff92
commit 0fa08d0011

@ -708,17 +708,13 @@ public class HikariConfig implements HikariConfigMBean
{ {
LOGGER.debug("HikariCP pool {} configuration:", poolName); LOGGER.debug("HikariCP pool {} configuration:", poolName);
Set<String> propertyNames = new TreeSet<String>(PropertyBeanSetter.getPropertyNames(HikariConfig.class)); Set<String> propertyNames = new TreeSet<String>(PropertyBeanSetter.getPropertyNames(HikariConfig.class));
StringBuilder sb = new StringBuilder();
for (String prop : propertyNames) for (String prop : propertyNames)
{ {
try try
{ {
sb.append(prop).append("................................................");
sb.setLength(32);
Object value = PropertyBeanSetter.getProperty(prop, this); Object value = PropertyBeanSetter.getProperty(prop, this);
sb.append((value != null ? value : "")); prop = (prop + "................................................").substring(0, 32);
LOGGER.debug(sb.toString()); LOGGER.debug(prop + (value != null ? value : ""));
sb.setLength(0);
} }
catch (Exception e) catch (Exception e)
{ {

@ -43,12 +43,12 @@ public final class FastList<T>
/** /**
* Construct a FastList with a specfied size. * Construct a FastList with a specfied size.
* @param clazz the Class stored in the collection * @param clazz the Class stored in the collection
* @param size the initial size of the FastList * @param capacity the initial size of the FastList
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public FastList(Class<?> clazz, int size) public FastList(Class<?> clazz, int capacity)
{ {
this.elementData = (T[]) Array.newInstance(clazz, size); this.elementData = (T[]) Array.newInstance(clazz, capacity);
} }
/** /**
@ -69,7 +69,7 @@ public final class FastList<T>
final int oldCapacity = elementData.length; final int oldCapacity = elementData.length;
final int newCapacity = oldCapacity << 1; final int newCapacity = oldCapacity << 1;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final T[] newElementData = (T[]) Array.newInstance(element.getClass(), newCapacity); //new Statement[newCapacity]; final T[] newElementData = (T[]) Array.newInstance(element.getClass(), newCapacity);
System.arraycopy(elementData, 0, newElementData, 0, oldCapacity); System.arraycopy(elementData, 0, newElementData, 0, oldCapacity);
newElementData[size++] = element; newElementData[size++] = element;
elementData = newElementData; elementData = newElementData;

Loading…
Cancel
Save