test_class.file: bonecp/src/test/java/com/jolbox/bonecp/TestPoolUtil.java
test_class.identifier: TestPoolUtil
test_case.body: @Test
  	public void testPoolUtilExceptions() throws SQLException{
  		Map<Object, Object> logParams = new LinkedHashMap<Object, Object>();
  
  		logParams.put("1", "123");
  		logParams.put("2", null);
  
  		Blob mockBlob = createNiceMock(Blob.class);
  		expect(mockBlob.length()).andThrow(new SQLException());
  		replay(mockBlob);
  
  
  		logParams.put("3", mockBlob);
  
  		Clob mockClob = createNiceMock(Clob.class);
  		expect(mockClob.length()).andThrow(new SQLException());
  		replay(mockClob);
  
  
  		logParams.put("4", mockClob);
  
  		Array mockArray = createNiceMock(java.sql.Array.class);
  		expect(mockArray.getBaseTypeName()).andThrow(new SQLException());
  		replay(mockArray);
  
  		logParams.put("5", mockArray);
  
  		Ref mockSerialRef = createNiceMock(Ref.class);
  		expect(mockSerialRef.getBaseTypeName()).andThrow(new SQLException());
  		replay(mockSerialRef);
  		logParams.put("6", mockSerialRef);
  
  		// test proper replacement/escaping
  		assertEquals("ID='123' AND FOO='?' and LALA=\"BOO\" NULL (blob of unknown length) (cblob of unknown length) (array of unknown type) (ref of unknown type) ?", PoolUtil.fillLogParams("ID=? AND FOO='?' and LALA=\"BOO\" ? ? ? ? ? ?", logParams));
  	}
test_case.class_method_signature: TestPoolUtil.testPoolUtilExceptions()
test_case.full_signature: @Test public void testPoolUtilExceptions()
test_case.identifier: testPoolUtilExceptions
test_case.invocations: put put createNiceMock andThrow expect length replay put createNiceMock andThrow expect length replay put createNiceMock andThrow expect getBaseTypeName replay put createNiceMock andThrow expect getBaseTypeName replay put assertEquals fillLogParams
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPoolUtilExceptions()
focal_class.declarator: sqlExceptionClass
focal_class.modifier: protected static
focal_class.original_string: protected static Class<Throwable> sqlExceptionClass;
focal_class.type: Class<Throwable>
focal_class.var_name: sqlExceptionClass
focal_class.declarator: exceptionClass = "java.sql.SQLException"
focal_class.modifier: private static final
focal_class.original_string: private static final String exceptionClass = "java.sql.SQLException";
focal_class.type: String
focal_class.var_name: exceptionClass
focal_class.file: bonecp/src/main/java/com/jolbox/bonecp/PoolUtil.java
focal_class.identifier: PoolUtil
focal_class.class_method_signature: PoolUtil.fillLogParams(String sql, Map<Object, Object> logParams)
focal_class.full_signature: public static String fillLogParams(String sql, Map<Object, Object> logParams)
focal_class.identifier: fillLogParams
focal_class.modifiers: public static
focal_class.parameters: (String sql, Map<Object, Object> logParams)
focal_class.return: String
focal_class.signature: String fillLogParams(String sql, Map<Object, Object> logParams)
focal_class.class_method_signature: PoolUtil.safePrint(Object... o)
focal_class.full_signature: protected static String safePrint(Object... o)
focal_class.identifier: safePrint
focal_class.modifiers: protected static
focal_class.parameters: (Object... o)
focal_class.return: String
focal_class.signature: String safePrint(Object... o)
focal_class.class_method_signature: PoolUtil.prettyPrint(Object obj)
focal_class.full_signature: protected static String prettyPrint(Object obj)
focal_class.identifier: prettyPrint
focal_class.modifiers: protected static
focal_class.parameters: (Object obj)
focal_class.return: String
focal_class.signature: String prettyPrint(Object obj)
focal_class.class_method_signature: PoolUtil.formatLogParam(Blob obj)
focal_class.full_signature: private static String formatLogParam(Blob obj)
focal_class.identifier: formatLogParam
focal_class.modifiers: private static
focal_class.parameters: (Blob obj)
focal_class.return: String
focal_class.signature: String formatLogParam(Blob obj)
focal_class.class_method_signature: PoolUtil.formatLogParam(Clob obj)
focal_class.full_signature: private static String formatLogParam(Clob obj)
focal_class.identifier: formatLogParam
focal_class.modifiers: private static
focal_class.parameters: (Clob obj)
focal_class.return: String
focal_class.signature: String formatLogParam(Clob obj)
focal_class.class_method_signature: PoolUtil.formatLogParam(Array obj)
focal_class.full_signature: private static String formatLogParam(Array obj)
focal_class.identifier: formatLogParam
focal_class.modifiers: private static
focal_class.parameters: (Array obj)
focal_class.return: String
focal_class.signature: String formatLogParam(Array obj)
focal_class.class_method_signature: PoolUtil.formatLogParam(Ref obj)
focal_class.full_signature: private static String formatLogParam(Ref obj)
focal_class.identifier: formatLogParam
focal_class.modifiers: private static
focal_class.parameters: (Ref obj)
focal_class.return: String
focal_class.signature: String formatLogParam(Ref obj)
focal_class.class_method_signature: PoolUtil.stringifyException(Throwable t)
focal_class.full_signature: public static String stringifyException(Throwable t)
focal_class.identifier: stringifyException
focal_class.modifiers: public static
focal_class.parameters: (Throwable t)
focal_class.return: String
focal_class.signature: String stringifyException(Throwable t)
focal_class.class_method_signature: PoolUtil.generateSQLException(String reason, Throwable t)
focal_class.full_signature: public static SQLException generateSQLException(String reason, Throwable t)
focal_class.identifier: generateSQLException
focal_class.modifiers: public static
focal_class.parameters: (String reason, Throwable t)
focal_class.return: SQLException
focal_class.signature: SQLException generateSQLException(String reason, Throwable t)
focal_method.body: public static String fillLogParams(String sql, Map<Object, Object> logParams) {
  		StringBuilder result = new StringBuilder();
  		Map<Object, Object> tmpLogParam = (logParams == null ? new HashMap<Object, Object>() : logParams);
  
  		Iterator<Object> it = tmpLogParam.values().iterator();
  		boolean inQuote = false;
  		boolean inQuote2 = false;
  		char[] sqlChar = sql != null ? sql.toCharArray() : new char[]{};
  
  		for (int i=0; i < sqlChar.length; i++){
  			if (sqlChar[i] == '\''){
  				inQuote = !inQuote;
  			}
  			if (sqlChar[i] == '"'){
  				inQuote2 = !inQuote2;
  			}
  
  			if (sqlChar[i] == '?' && !(inQuote || inQuote2)){
  				if (it.hasNext()){
  					result.append(prettyPrint(it.next()));
  				} else {
  					result.append('?');
  				}
  			} else {
  				result.append(sqlChar[i]);
  			}
  		}
  
  
  		return result.toString();
  	}
focal_method.class_method_signature: PoolUtil.fillLogParams(String sql, Map<Object, Object> logParams)
focal_method.full_signature: public static String fillLogParams(String sql, Map<Object, Object> logParams)
focal_method.identifier: fillLogParams
focal_method.invocations: iterator values toCharArray hasNext append prettyPrint next append append toString
focal_method.modifiers: public static
focal_method.parameters: (String sql, Map<Object, Object> logParams)
focal_method.return: String
focal_method.signature: String fillLogParams(String sql, Map<Object, Object> logParams)