signature:
public class SqlTemplate { /** * 执行一个SQL查询操作 , 结果为一组对象 。
 * @ param sql
 * 包含变量占位符的SQL
 * @ param vars
 * 变量map , 无参数时 , 可为null
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ param entity
 * 对象类型
 * @ return 对象列表 , 无查询结果时返回长度为0的List对象 */
public < T > List < T > query ( String sql , Map < String , Object > vars , Map < String , Object > params , Entity < T > entity ) { } }

implementation: Sql sqlObj = createSqlObj ( sql , params ) ; sqlObj . setCallback ( Sqls . callback . entities ( ) ) ; sqlObj . setEntity ( entity ) ; execute ( sqlObj , vars , params ) ; return sqlObj . getList ( entity . getType ( ) ) ;


signature:
public class SqlTemplate { /** * 执行一个SQL查询操作 , 结果为一组对象 。
 * @ param sql
 * 包含变量占位符的SQL
 * @ param vars
 * 变量map , 无参数时 , 可为null
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ param classOfT
 * 对象类型
 * @ return 对象列表 , 无查询结果时返回长度为0的List对象 */
public < T > List < T > queryForList ( String sql , Map < String , Object > vars , Map < String , Object > params , final Class < T > classOfT ) { } }

implementation: Sql sqlObj = createSqlObj ( sql , params ) ; sqlObj . setCallback ( new SqlCallback ( ) { public Object invoke ( Connection conn , ResultSet rs , Sql sql ) throws SQLException { List < T > list = new ArrayList < T > ( ) ; while ( rs . next ( ) ) { T result = Castors . me ( ) . castTo ( rs . getObject ( 1 ) , classOfT ) ; list . add ( result ) ; } return list ; } } ) ; execute ( sqlObj , vars , params ) ; return sqlObj . getList ( classOfT ) ;


signature:
public class SqlTemplate { /** * 执行一个SQL查询操作 , 结果为Record对象列表 。
 * @ param sql
 * 包含变量占位符的SQL
 * @ param vars
 * 变量map , 无参数时 , 可为null
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ return Record列表 , 无查询结果时返回长度为0的List对象 */
public List < Record > queryRecords ( String sql , Map < String , Object > vars , Map < String , Object > params ) { } }

implementation: Sql sqlObj = createSqlObj ( sql , params ) ; sqlObj . setCallback ( Sqls . callback . records ( ) ) ; execute ( sqlObj , vars , params ) ; return sqlObj . getList ( Record . class ) ;


signature:
public class SqlTemplate { /** * 设置sql参数并执行sql 。 */
private void execute ( Sql sqlObj , Map < String , Object > vars , Map < String , Object > params ) { } }

implementation: if ( vars != null ) sqlObj . vars ( ) . putAll ( vars ) ; if ( params != null ) { Map < String , Object > newParams = paramProcess ( params ) ; sqlObj . params ( ) . putAll ( newParams ) ; } dao ( ) . execute ( sqlObj ) ;


signature:
public class SqlTemplate { /** * 创建Sql对象 。
 * 在这里处理Array Collection类型参数 , 方便SQL IN 表达式的设置
 * @ param sql
 * 包含变量占位符的SQL
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ return Sql对象 */
private Sql createSqlObj ( String sql , Map < String , Object > params ) { } }

implementation: if ( params == null ) return Sqls . create ( sql ) ; String newSql = sqlProcess ( sql , params ) ; return Sqls . create ( newSql ) ;


signature:
public class SqlTemplate { /** * 将Array Collection类型参数对应的sql占位符进行处理
 * @ param originSql
 * 原包含变量占位符的SQL
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ return 包含处理IN表达式的sql */
private String sqlProcess ( String originSql , Map < String , Object > params ) { } }

implementation: if ( params == null || params . size ( ) == 0 ) return originSql ; String newSql = originSql ; for ( Entry < String , Object > entry : params . entrySet ( ) ) { String paramName = entry . getKey ( ) ; Object paramObj = entry . getValue ( ) ; if ( paramObj . getClass ( ) . isArray ( ) ) { String inSqlExp = inSqlProcess ( paramName , paramObj ) ; newSql = newSql . replaceAll ( "@" + paramName , inSqlExp ) ; } if ( paramObj instanceof Collection ) { Collection < ? > collection = ( Collection < ? > ) paramObj ; Object [ ] paramVals = Lang . collection2array ( collection ) ; String inSqlExp = inSqlProcess ( paramName , paramVals ) ; newSql = newSql . replaceAll ( "@" + paramName , inSqlExp ) ; } } return newSql ;


signature:
public class SqlTemplate { /** * sql参数处理 , 在这里处理Array Collection类型参数 , 方便SQL IN 表达式的设置
 * @ param params
 * 参数map , 无参数时 , 可为null
 * @ return 包含处理IN表达式的sql */
private Map < String , Object > paramProcess ( Map < String , Object > params ) { } }

implementation: if ( params == null || params . size ( ) == 0 ) return null ; Map < String , Object > newParams = new HashMap < String , Object > ( params ) ; for ( Entry < String , Object > entry : params . entrySet ( ) ) { String paramName = entry . getKey ( ) ; Object paramObj = entry . getValue ( ) ; if ( paramObj . getClass ( ) . isArray ( ) ) { inParamProcess ( paramName , paramObj , newParams ) ; newParams . remove ( paramName ) ; } if ( paramObj instanceof Collection ) { Collection < ? > collection = ( Collection < ? > ) paramObj ; Object [ ] paramVals = Lang . collection2array ( collection ) ; inParamProcess ( paramName , paramVals , newParams ) ; newParams . remove ( paramName ) ; } } return newParams ;


signature:
public class MSSQLDatabase { /** * Determines if the SQL Server instance assigns Unicode data types ( e . g . nvarchar ) to strings .
 * @ return true if the SQL Server instance uses Unicode types by default , false if not . */
public boolean sendsStringParametersAsUnicode ( ) { } }

implementation:
if ( sendsStringParametersAsUnicode == null ) { try { if ( getConnection ( ) instanceof JdbcConnection ) { PreparedStatement ps = null ; ResultSet rs = null ; try { String sql = "SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))" ; ps = ( ( JdbcConnection ) getConnection ( ) ) . prepareStatement ( sql ) ; ps . setString ( 1 , "Liquibase" ) ; rs = ps . executeQuery ( ) ; String baseType = null ; if ( rs . next ( ) ) { baseType = rs . getString ( 1 ) ; } // baseTypes starting with " n " can be something like nvarchar ( or nchar )
sendsStringParametersAsUnicode = ( baseType == null ) || baseType . startsWith ( "n" ) ; } finally { JdbcUtils . close ( rs , ps ) ; } } else if ( getConnection ( ) instanceof OfflineConnection ) { sendsStringParametersAsUnicode = ( ( OfflineConnection ) getConnection ( ) ) . getSendsStringParametersAsUnicode ( ) ; } } catch ( SQLException | DatabaseException e ) { Scope . getCurrentScope ( ) . getLog ( getClass ( ) ) . warning ( LogType . LOG , "Cannot determine whether String parameters are sent as Unicode for MSSQL" , e ) ; } } return ( sendsStringParametersAsUnicode == null ) ? true : sendsStringParametersAsUnicode ;


signature:
public class MSSQLDatabase { /** * Determines the capabilities ( " Edition " ) of the SQL Server database . Possible values are currently
 * " Personal " , " Standard " , " Enterprise " ( Developer Edition is also reported as Enterprise ) , " Express " or " Azure " .
 * @ return one of the strings above */
public String getEngineEdition ( ) { } }

implementation: try { if ( getConnection ( ) instanceof JdbcConnection ) { String sql = "SELECT CASE ServerProperty('EngineEdition')\n" + "         WHEN 1 THEN 'Personal'\n" + "         WHEN 2 THEN 'Standard'\n" + "         WHEN 3 THEN 'Enterprise'\n" + "         WHEN 4 THEN 'Express'\n" + "         WHEN 5 THEN 'Azure'\n" + "         ELSE 'Unknown'\n" + "       END" ; return ExecutorService . getInstance ( ) . getExecutor ( this ) . queryForObject ( new RawSqlStatement ( sql ) , String . class ) ; } } catch ( DatabaseException e ) { Scope . getCurrentScope ( ) . getLog ( getClass ( ) ) . warning ( LogType . LOG , "Could not determine engine edition" , e ) ; } return "Unknown" ;


signature:
public class HeaderColumnNameTranslateMappingStrategy { /** * Retrieves the column name for a given column position
 * @ param col - column position .
 * @ return - The column name . */
@ Override public String getColumnName ( int col ) { } }

implementation: return ( col < header . length ) ? columnMapping . get ( header [ col ] . toUpperCase ( ) ) : null ;


signature:
public class HeaderColumnNameTranslateMappingStrategy { /** * Sets the column mapping to those passed in .
 * @ param columnMapping - source column mapping . */
public void setColumnMapping ( Map < String , String > columnMapping ) { } }

implementation: this . columnMapping . clear ( ) ; for ( Map . Entry < String , String > entry : columnMapping . entrySet ( ) ) { this . columnMapping . put ( entry . getKey ( ) . toUpperCase ( ) , entry . getValue ( ) ) ; }


signature:
public class AbstractConfigurationContainer { /** * Returns the value for the given property cast to the passed returnType .
 * If the type of the property and the given return type are not compatible an exception will be thrown .
 * If the passed propertyName is not a defined property , an exception is thrown . */
@ Override public < T > T getValue ( String propertyName , Class < T > returnType ) { } }

implementation: return getContainer ( ) . getValue ( propertyName , returnType ) ;


signature:
public class AbstractConfigurationContainer { /** * Override default values for properties with the given ConfigurationProviders . */
@ Override public void init ( ConfigurationValueProvider ... configurationValueProviders ) { } }

implementation: if ( configurationValueProviders != null ) { for ( ConfigurationProperty property : getContainer ( ) . properties . values ( ) ) { property . init ( configurationValueProviders ) ; } }


signature:
public class SybaseASADatabase { /** * / * ( non - Javadoc )
 * @ see liquibase . database . Database # isCorrectDatabaseImplementation ( java . sql . Connection ) */
@ Override public boolean isCorrectDatabaseImplementation ( DatabaseConnection conn ) throws DatabaseException { } }

implementation: return "Adaptive Server Anywhere" . equalsIgnoreCase ( conn . getDatabaseProductName ( ) ) || "SQL Anywhere" . equalsIgnoreCase ( conn . getDatabaseProductName ( ) ) || "Adaptive Server IQ" . equalsIgnoreCase ( conn . getDatabaseProductName ( ) ) || "Sybase IQ" . equalsIgnoreCase ( conn . getDatabaseProductName ( ) ) ;


signature:
public class IOCase { /** * Factory method to create an IOCase from a name .
 * @ param name the name to find
 * @ return the IOCase object
 * @ throws IllegalArgumentException if the name is invalid */
public static IOCase forName ( String name ) { } }

implementation: if ( IOCase . SENSITIVE . name . equals ( name ) ) { return IOCase . SENSITIVE ; } if ( IOCase . INSENSITIVE . name . equals ( name ) ) { return IOCase . INSENSITIVE ; } if ( IOCase . SYSTEM . name . equals ( name ) ) { return IOCase . SYSTEM ; } throw new IllegalArgumentException ( "Invalid IOCase name: " + name ) ;


signature:
public class IOCase { /** * Compares two strings using the case - sensitivity rule .
 * This method mimics { @ link String # compareTo } but takes case - sensitivity
 * into account .
 * @ param str1 the first string to compare , not null
 * @ param str2 the second string to compare , not null
 * @ return true if equal using the case rules
 * @ throws NullPointerException if either string is null */
public int checkCompareTo ( String str1 , String str2 ) { } }

implementation: if ( ( str1 == null ) || ( str2 == null ) ) { throw new NullPointerException ( "The strings must not be null" ) ; } return isSensitive ? str1 . compareTo ( str2 ) : str1 . compareToIgnoreCase ( str2 ) ;


signature:
public class IOCase { /** * Compares two strings using the case - sensitivity rule .
 * This method mimics { @ link String # equals } but takes case - sensitivity
 * into account .
 * @ param str1 the first string to compare , not null
 * @ param str2 the second string to compare , not null
 * @ return true if equal using the case rules
 * @ throws NullPointerException if either string is null */
public boolean checkEquals ( String str1 , String str2 ) { } }

implementation: if ( ( str1 == null ) || ( str2 == null ) ) { throw new NullPointerException ( "The strings must not be null" ) ; } return isSensitive ? str1 . equals ( str2 ) : str1 . equalsIgnoreCase ( str2 ) ;


signature:
public class IOCase { /** * Checks if one string starts with another using the case - sensitivity rule .
 * This method mimics { @ link String # startsWith ( String ) } but takes case - sensitivity
 * into account .
 * @ param str the string to check , not null
 * @ param start the start to compare against , not null
 * @ return true if equal using the case rules
 * @ throws NullPointerException if either string is null */
public boolean checkStartsWith ( String str , String start ) { } }

implementation: return str . regionMatches ( ! isSensitive , 0 , start , 0 , start . length ( ) ) ;


signature:
public class IOCase { /** * Checks if one string ends with another using the case - sensitivity rule .
 * This method mimics { @ link String # endsWith } but takes case - sensitivity
 * into account .
 * @ param str the string to check , not null
 * @ param end the end to compare against , not null
 * @ return true if equal using the case rules
 * @ throws NullPointerException if either string is null */
public boolean checkEndsWith ( String str , String end ) { } }

implementation: int endLen = end . length ( ) ; return str . regionMatches ( ! isSensitive , str . length ( ) - endLen , end , 0 , endLen ) ;


signature:
public class IOCase { /** * Checks if one string contains another at a specific index using the case - sensitivity rule .
 * This method mimics parts of { @ link String # regionMatches ( boolean , int , String , int , int ) }
 * but takes case - sensitivity into account .
 * @ param str the string to check , not null
 * @ param strStartIndex the index to start at in str
 * @ param search the start to search for , not null
 * @ return true if equal using the case rules
 * @ throws NullPointerException if either string is null */
public boolean checkRegionMatches ( String str , int strStartIndex , String search ) { } }

implementation: return str . regionMatches ( ! isSensitive , strStartIndex , search , 0 , search . length ( ) ) ;


signature:
public class IOCase { /** * Converts the case of the input String to a standard format .
 * Subsequent operations can then use standard String methods .
 * @ param str the string to convert , null returns null
 * @ return the lower - case version if case - insensitive */
String convertCase ( String str ) { } }

implementation: if ( str == null ) { return null ; } return isSensitive ? str : str . toLowerCase ( ) ;


signature:
public class ChangeParameterMetaData { /** * Returns the current value of this parameter for the given Change . */
public Object getCurrentValue ( Change change ) { } }

implementation: try { for ( PropertyDescriptor descriptor : PropertyUtils . getInstance ( ) . getDescriptors ( change . getClass ( ) ) ) { if ( descriptor . getDisplayName ( ) . equals ( this . parameterName ) ) { Method readMethod = descriptor . getReadMethod ( ) ; if ( readMethod == null ) { readMethod = change . getClass ( ) . getMethod ( "is" + StringUtil . upperCaseFirst ( descriptor . getName ( ) ) ) ; } return readMethod . invoke ( change ) ; } } throw new RuntimeException ( "Could not find readMethod for " + this . parameterName ) ; } catch ( Exception e ) { throw new UnexpectedLiquibaseException ( e ) ; }


signature:
public class ChangeParameterMetaData { /** * Sets the value of this parameter on the given change . */
public void setValue ( Change change , Object value ) { } }

implementation: if ( ( value instanceof String ) && ( ! "string" . equals ( dataType ) ) ) { try { switch ( dataType ) { case "bigInteger" : value = new BigInteger ( ( String ) value ) ; break ; case "databaseFunction" : value = new DatabaseFunction ( ( String ) value ) ; break ; default : throw new UnexpectedLiquibaseException ( "Unknown data type: " + dataType ) ; } } catch ( Exception e ) { throw new UnexpectedLiquibaseException ( "Cannot convert string value '" + value + "' to " + dataType + ": " + e . getMessage ( ) ) ; } } try { for ( PropertyDescriptor descriptor : PropertyUtils . getInstance ( ) . getDescriptors ( change . getClass ( ) ) ) { if ( descriptor . getDisplayName ( ) . equals ( this . parameterName ) ) { Method writeMethod = descriptor . getWriteMethod ( ) ; if ( writeMethod == null ) { throw new UnexpectedLiquibaseException ( "Could not find writeMethod for " + this . parameterName ) ; } Class < ? > expectedWriteType = writeMethod . getParameterTypes ( ) [ 0 ] ; if ( ( value != null ) && ! expectedWriteType . isAssignableFrom ( value . getClass ( ) ) ) { if ( expectedWriteType . equals ( String . class ) ) { value = value . toString ( ) ; } else { throw new UnexpectedLiquibaseException ( "Could not convert " + value . getClass ( ) . getName ( ) + " to " + expectedWriteType . getName ( ) ) ; } } writeMethod . invoke ( change , value ) ; } } } catch ( Exception e ) { throw new UnexpectedLiquibaseException ( "Error setting " + this . parameterName + " to " + value , e ) ; }


signature:
public class CollectionUtil { /** * Returns passed currentValue if it is not null and creates a new ArrayList if it is null .
 * < br > < br >
 * Example : values = createIfNull ( values ) */
public static < T > List < T > createIfNull ( List < T > currentValue ) { } }

implementation: if ( currentValue == null ) { return new ArrayList < T > ( ) ; } else { return currentValue ; }


signature:
public class CollectionUtil { /** * Returns a new empty array if the passed array is null . */
public static < T > T [ ] createIfNull ( T [ ] arguments ) { } }

implementation: if ( arguments == null ) { return ( T [ ] ) new Object [ 0 ] ; } else { return arguments ; }


signature:
public class CollectionUtil { /** * Returns a new empty set if the passed array is null . */
public static < T > Set < T > createIfNull ( Set < T > currentValue ) { } }

implementation: if ( currentValue == null ) { return new HashSet < > ( ) ; } else { return currentValue ; }


signature:
public class CreateIndexGenerator { /** * Generate a CREATE INDEX SQL statement .
 * Here , we are walking on thin ice , because the SQL Foundation standard ( ISO / IEC 9075-2 ) does not concern itself
 * with indexes at all and leaves them as an implementation - specific detail at the discretion of each RDBMS vendor .
 * However , there is some common ground to most RDBMS , and we try to make an educated guess on how a CREATE INDEX
 * statement might look like if we have no specific handler for the DBMS .
 * @ param statement A CreateIndexStatement with the desired properties of the SQL to be generated
 * @ param database The DBMS for whose SQL dialect the statement is to be made
 * @ param sqlGeneratorChain The other SQL generators in the same chain ( but this method is not interested in them )
 * @ return An array of Sql objects containing the generated SQL statement ( s ) . */
@ Override public Sql [ ] generateSql ( CreateIndexStatement statement , Database database , SqlGeneratorChain sqlGeneratorChain ) { } }

implementation:
if ( database instanceof OracleDatabase ) { /* * Oracle automatically creates indexes for PRIMARY KEY and UNIQUE constraints , but does not do so
 * for FOREIGN KEY constraints , though it is highly recommended to do to avoid potentially severe
 * performance problems when deleting rows from the parent table or changing the key column ( s ) in the
 * parent table . */
List < String > associatedWith = StringUtil . splitAndTrim ( statement . getAssociatedWith ( ) , "," ) ; if ( ( associatedWith != null ) && ( associatedWith . contains ( Index . MARK_PRIMARY_KEY ) || associatedWith . contains ( Index . MARK_UNIQUE_CONSTRAINT ) ) ) { return new Sql [ 0 ] ; } } else { // Default filter of index creation :
// creation of all indexes with associations are switched off .
List < String > associatedWith = StringUtil . splitAndTrim ( statement . getAssociatedWith ( ) , "," ) ; if ( ( associatedWith != null ) && ( associatedWith . contains ( Index . MARK_PRIMARY_KEY ) || associatedWith . contains ( Index . MARK_UNIQUE_CONSTRAINT ) || associatedWith . contains ( Index . MARK_FOREIGN_KEY ) ) ) { return new Sql [ 0 ] ; } } StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "CREATE " ) ; if ( ( statement . isUnique ( ) != null ) && statement . isUnique ( ) ) { buffer . append ( "UNIQUE " ) ; } if ( database instanceof MSSQLDatabase ) { if ( statement . isClustered ( ) != null ) { if ( statement . isClustered ( ) ) { buffer . append ( "CLUSTERED " ) ; } else { buffer . append ( "NONCLUSTERED " ) ; } } } buffer . append ( "INDEX " ) ; if ( statement . getIndexName ( ) != null ) { String indexSchema = statement . getTableSchemaName ( ) ; buffer . append ( database . escapeIndexName ( statement . getTableCatalogName ( ) , indexSchema , statement . getIndexName ( ) ) ) . append ( " " ) ; } buffer . append ( "ON " ) ; if ( ( database instanceof OracleDatabase ) && ( statement . isClustered ( ) != null ) && statement . isClustered ( ) ) { buffer . append ( "CLUSTER " ) ; } buffer . append ( database . escapeTableName ( statement . getTableCatalogName ( ) , statement . getTableSchemaName ( ) , statement . getTableName ( ) ) ) . append ( "(" ) ; Iterator < AddColumnConfig > iterator = Arrays . asList ( statement . getColumns ( ) ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { AddColumnConfig column = iterator . next ( ) ; if ( column . getComputed ( ) == null ) { buffer . append ( database . escapeColumnName ( statement . getTableCatalogName ( ) , statement . getTableSchemaName ( ) , statement . getTableName ( ) , column . getName ( ) , false ) ) ; } else { if ( column . getComputed ( ) ) { buffer . append ( column . getName ( ) ) ; } else { buffer . append ( database . escapeColumnName ( statement . getTableCatalogName ( ) , statement . getTableSchemaName ( ) , statement . getTableName ( ) , column . getName ( ) ) ) ; } } if ( ( column . getDescending ( ) != null ) && column . getDescending ( ) ) { buffer . append ( " DESC" ) ; } if ( iterator . hasNext ( ) ) { buffer . append ( ", " ) ; } } buffer . append ( ")" ) ; if ( ( StringUtil . trimToNull ( statement . getTablespace ( ) ) != null ) && database . supportsTablespaces ( ) ) { if ( ( database instanceof MSSQLDatabase ) || ( database instanceof SybaseASADatabase ) ) { buffer . append ( " ON " ) . append ( statement . getTablespace ( ) ) ; } else if ( ( database instanceof AbstractDb2Database ) || ( database instanceof InformixDatabase ) ) { buffer . append ( " IN " ) . append ( statement . getTablespace ( ) ) ; } else { buffer . append ( " TABLESPACE " ) . append ( statement . getTablespace ( ) ) ; } } if ( ( database instanceof AbstractDb2Database ) && ( statement . isClustered ( ) != null ) && statement . isClustered ( ) ) { buffer . append ( " CLUSTER" ) ; } return new Sql [ ] { new UnparsedSql ( buffer . toString ( ) , getAffectedIndex ( statement ) ) } ;


signature:
public class YamlChangeLogParser { /** * Extract the global parameter from the properties .
 * @ param property the map of props
 * @ return the global param */
private Boolean getGlobalParam ( Map property ) { } }

implementation:
Boolean global = null ; Object globalObj = property . get ( "global" ) ; if ( globalObj == null ) { // default behaviour before liquibase 3.4
global = true ; } else { global = ( Boolean ) globalObj ; } return global ;


signature:
public class ExecutablePreparedStatementBase { /** * Sets the list of bind variables for the execution of a DML statement
 * @ param cols a list of columns with their designated values
 * @ param stmt the PreparedStatement to which the values are to be attached
 * @ throws SQLException if JDBC objects to a setting ( non - existent bind number , wrong column type etc . )
 * @ throws DatabaseException if an I / O error occurs during the read of LOB values */
protected void attachParams ( List < ColumnConfig > cols , PreparedStatement stmt ) throws SQLException , DatabaseException { } }

implementation:
int i = 1 ; // index starts from 1
for ( ColumnConfig col : cols ) { LOG . fine ( LogType . LOG , "Applying column parameter = " + i + " for column " + col . getName ( ) ) ; applyColumnParameter ( stmt , i , col ) ; i ++ ; }


signature:
public class ExecutablePreparedStatementBase { /** * Sets a single bind variable for a statement to its designated value
 * @ param stmt the PreparedStatement whose parameter is to be set
 * @ param i the parameter index ( first bind variable is 1)
 * @ param col a ColumnConfig with information about the column , its type , and the desired value
 * @ throws SQLException if JDBC objects to a setting ( non - existent bind number , wrong column type etc . )
 * @ throws DatabaseException if an I / O error occurs during the read of LOB values */
private void applyColumnParameter ( PreparedStatement stmt , int i , ColumnConfig col ) throws SQLException , DatabaseException { } }

implementation:
if ( col . getValue ( ) != null ) { LOG . fine ( LogType . LOG , "value is string = " + col . getValue ( ) ) ; if ( col . getType ( ) != null && col . getType ( ) . equalsIgnoreCase ( LoadDataChange . LOAD_DATA_TYPE . UUID . name ( ) ) ) { stmt . setObject ( i , UUID . fromString ( col . getValue ( ) ) ) ; } else { stmt . setString ( i , col . getValue ( ) ) ; } } else if ( col . getValueBoolean ( ) != null ) { LOG . fine ( LogType . LOG , "value is boolean = " + col . getValueBoolean ( ) ) ; stmt . setBoolean ( i , col . getValueBoolean ( ) ) ; } else if ( col . getValueNumeric ( ) != null ) { LOG . fine ( LogType . LOG , "value is numeric = " + col . getValueNumeric ( ) ) ; Number number = col . getValueNumeric ( ) ; if ( number instanceof ColumnConfig . ValueNumeric ) { ColumnConfig . ValueNumeric valueNumeric = ( ColumnConfig . ValueNumeric ) number ; number = valueNumeric . getDelegate ( ) ; } if ( number instanceof Long ) { stmt . setLong ( i , number . longValue ( ) ) ; } else if ( number instanceof Integer ) { stmt . setInt ( i , number . intValue ( ) ) ; } else if ( number instanceof Double ) { stmt . setDouble ( i , number . doubleValue ( ) ) ; } else if ( number instanceof Float ) { stmt . setFloat ( i , number . floatValue ( ) ) ; } else if ( number instanceof BigDecimal ) { stmt . setBigDecimal ( i , ( BigDecimal ) number ) ; } else if ( number instanceof BigInteger ) { stmt . setInt ( i , number . intValue ( ) ) ; } else { throw new UnexpectedLiquibaseException ( String . format ( coreBundle . getString ( "jdbc.bind.parameter.unknown.numeric.value.type" ) , col . getName ( ) , col . getValueNumeric ( ) . toString ( ) , col . getValueNumeric ( ) . getClass ( ) . getName ( ) ) ) ; } } else if ( col . getValueDate ( ) != null ) { LOG . fine ( LogType . LOG , "value is date = " + col . getValueDate ( ) ) ; if ( col . getValueDate ( ) instanceof Timestamp ) { stmt . setTimestamp ( i , ( Timestamp ) col . getValueDate ( ) ) ; } else if ( col . getValueDate ( ) instanceof Time ) { stmt . setTime ( i , ( Time ) col . getValueDate ( ) ) ; } else { stmt . setDate ( i , new java . sql . Date ( col . getValueDate ( ) . getTime ( ) ) ) ; } } else if ( col . getValueBlobFile ( ) != null ) { LOG . fine ( LogType . LOG , "value is blob = " + col . getValueBlobFile ( ) ) ; try { LOBContent < InputStream > lob = toBinaryStream ( col . getValueBlobFile ( ) ) ; if ( lob . length <= Integer . MAX_VALUE ) { stmt . setBinaryStream ( i , lob . content , ( int ) lob . length ) ; } else { stmt . setBinaryStream ( i , lob . content , lob . length ) ; } } catch ( IOException | LiquibaseException e ) { throw new DatabaseException ( e . getMessage ( ) , e ) ; // wrap
} } else if ( col . getValueClobFile ( ) != null ) { try { LOG . fine ( LogType . LOG , "value is clob = " + col . getValueClobFile ( ) ) ; LOBContent < Reader > lob = toCharacterStream ( col . getValueClobFile ( ) , col . getEncoding ( ) ) ; if ( lob . length <= Integer . MAX_VALUE ) { stmt . setCharacterStream ( i , lob . content , ( int ) lob . length ) ; } else { stmt . setCharacterStream ( i , lob . content , lob . length ) ; } } catch ( IOException | LiquibaseException e ) { throw new DatabaseException ( e . getMessage ( ) , e ) ; // wrap
} } else { // NULL values might intentionally be set into a change , we must also add them to the prepared statement
LOG . fine ( LogType . LOG , "value is explicit null" ) ; stmt . setNull ( i , java . sql . Types . NULL ) ; }


signature:
public class ExecutablePreparedStatementBase { /** * Gets absolute and normalized path for path .
 * If path is relative , absolute path is calculated relative to change log file .
 * @ param path Absolute or relative path .
 * @ return Absolute and normalized path . */
public String getAbsolutePath ( String path ) { } }

implementation: String p = path ; File f = new File ( p ) ; if ( ! f . isAbsolute ( ) ) { String basePath = FilenameUtils . getFullPath ( changeSet . getChangeLog ( ) . getPhysicalFilePath ( ) ) ; p = FilenameUtils . normalize ( basePath + p ) ; } return p ;


signature:
public class CheckSum { /** * Parse the given storedCheckSum string value and return a new CheckSum object . */
public static CheckSum parse ( String checksumValue ) { } }

implementation:
if ( checksumValue == null ) { return null ; } // The general layout of a checksum is :
// < 1 digit : algorithm version number > : < 1 . . n characters alphanumeric checksum >
// Example : 7:2cdf9876e74347162401315d34b83746
Matcher matcher = CHECKSUM_PATTERN . matcher ( checksumValue ) ; if ( matcher . find ( ) ) { return new CheckSum ( matcher . group ( 2 ) , Integer . parseInt ( matcher . group ( 1 ) ) ) ; } else { // No version information found
return new CheckSum ( checksumValue , 1 ) ; }


signature:
public class CheckSum { /** * Compute a storedCheckSum of the given string . */
public static CheckSum compute ( String valueToChecksum ) { } }

implementation:
return new CheckSum ( MD5Util . computeMD5 ( // remove " Unknown " unicode char 65533
Normalizer . normalize ( StringUtil . standardizeLineEndings ( valueToChecksum ) . replace ( "\uFFFD" , "" ) , Normalizer . Form . NFC ) ) , getCurrentVersion ( ) ) ;


signature:
public class CheckSum { /** * Compute a CheckSum of the given data stream ( no normalization of line endings ! ) */
public static CheckSum compute ( final InputStream stream , boolean standardizeLineEndings ) { } }

implementation: InputStream newStream = stream ; if ( standardizeLineEndings ) { newStream = new InputStream ( ) { private boolean isPrevR = false ; @ Override public int read ( ) throws IOException { int read = stream . read ( ) ; if ( read == '\r' ) { isPrevR = true ; return '\n' ; } else if ( read == '\n' && isPrevR ) { isPrevR = false ; return read ( ) ; } else { isPrevR = false ; return read ; } } } ; } return new CheckSum ( MD5Util . computeMD5 ( newStream ) , getCurrentVersion ( ) ) ;


signature:
public class AbstractLiquibaseMojo { /** * Returns an isolated classloader .
 * @ return ClassLoader
 * @ noinspection unchecked */
protected ClassLoader getClassLoaderIncludingProjectClasspath ( ) throws MojoExecutionException { } }

implementation: try { List classpathElements = project . getCompileClasspathElements ( ) ; classpathElements . add ( project . getBuild ( ) . getOutputDirectory ( ) ) ; URL urls [ ] = new URL [ classpathElements . size ( ) ] ; for ( int i = 0 ; i < classpathElements . size ( ) ; ++ i ) { urls [ i ] = new File ( ( String ) classpathElements . get ( i ) ) . toURI ( ) . toURL ( ) ; } return new URLClassLoader ( urls , getMavenArtifactClassLoader ( ) ) ; } catch ( Exception e ) { throw new MojoExecutionException ( "Failed to create project classloader" , e ) ; }


signature:
public class AbstractLiquibaseMojo { /** * Prints the settings that have been set of defaulted for the plugin . These will only
 * be shown in verbose mode .
 * @ param indent The indent string to use when printing the settings . */
protected void printSettings ( String indent ) { } }

implementation: if ( indent == null ) { indent = "" ; } getLog ( ) . info ( indent + "driver: " + driver ) ; getLog ( ) . info ( indent + "url: " + url ) ; getLog ( ) . info ( indent + "username: " + username ) ; getLog ( ) . info ( indent + "password: " + "*****" ) ; getLog ( ) . info ( indent + "use empty password: " + emptyPassword ) ; getLog ( ) . info ( indent + "properties file: " + propertyFile ) ; getLog ( ) . info ( indent + "properties file will override? " + propertyFileWillOverride ) ; getLog ( ) . info ( indent + "prompt on non-local database? " + promptOnNonLocalDatabase ) ; getLog ( ) . info ( indent + "clear checksums? " + clearCheckSums ) ;


signature:
public class AbstractLiquibaseMojo { /** * Parses a properties file and sets the associated fields in the plugin .
 * @ param propertiesInputStream The input stream which is the Liquibase properties that
 * needs to be parsed .
 * @ throws org . apache . maven . plugin . MojoExecutionException If there is a problem parsing
 * the file . */
protected void parsePropertiesFile ( InputStream propertiesInputStream ) throws MojoExecutionException { } }

implementation: if ( propertiesInputStream == null ) { throw new MojoExecutionException ( "Properties file InputStream is null." ) ; } Properties props = new Properties ( ) ; try { props . load ( propertiesInputStream ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Could not load the properties Liquibase file" , e ) ; } for ( Iterator it = props . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String key = null ; try { key = ( String ) it . next ( ) ; Field field = MavenUtils . getDeclaredField ( this . getClass ( ) , key ) ; if ( propertyFileWillOverride ) { getLog ( ) . debug ( "  properties file setting value: " + field . getName ( ) ) ; setFieldValue ( field , props . get ( key ) . toString ( ) ) ; } else { if ( ! isCurrentFieldValueSpecified ( field ) ) { getLog ( ) . debug ( "  properties file setting value: " + field . getName ( ) ) ; setFieldValue ( field , props . get ( key ) . toString ( ) ) ; } } } catch ( Exception e ) { getLog ( ) . info ( "  '" + key + "' in properties file is not being used by this " + "task." ) ; } }


signature:
public class AbstractLiquibaseMojo { /** * This method will check to see if the user has specified a value different to that of
 * the default value . This is not an ideal solution , but should cover most situations in
 * the use of the plugin .
 * @ param f The Field to check if a user has specified a value for .
 * @ return < code > true < / code > if the user has specified a value . */
private boolean isCurrentFieldValueSpecified ( Field f ) throws IllegalAccessException { } }

implementation:
Object currentValue = f . get ( this ) ; if ( currentValue == null ) { return false ; } Object defaultValue = getDefaultValue ( f ) ; if ( defaultValue == null ) { return currentValue != null ; } else { // There is a default value , check to see if the user has selected something other
// than the default
return ! defaultValue . equals ( f . get ( this ) ) ; }


signature:
public class CSVWriter { /** * Writes the entire list to a CSV file . The list is assumed to be a
 * String [ ]
 * @ param allLines a List of String [ ] , with each String [ ] representing a line of
 * the file .
 * @ param applyQuotesToAll true if all values are to be quoted . false if quotes only
 * to be applied to values which contain the separator , escape ,
 * quote or new line characters . */
public void writeAll ( List < String [ ] > allLines , boolean applyQuotesToAll ) { } }

implementation: for ( String [ ] line : allLines ) { writeNext ( line , applyQuotesToAll ) ; }


signature:
public class CSVWriter { /** * Writes the next line to the file .
 * @ param nextLine a string array with each comma - separated element as a separate
 * entry .
 * @ param applyQuotesToAll true if all values are to be quoted . false applies quotes only
 * to values which contain the separator , escape , quote or new line characters . */
public void writeNext ( String [ ] nextLine , boolean applyQuotesToAll ) { } }

implementation:
if ( nextLine == null ) { return ; } StringBuilder sb = new StringBuilder ( nextLine . length * 2 ) ; // This is for the worse case where all elements have to be escaped .
for ( int i = 0 ; i < nextLine . length ; i ++ ) { if ( i != 0 ) { sb . append ( separator ) ; } String nextElement = nextLine [ i ] ; if ( nextElement == null ) { continue ; } Boolean stringContainsSpecialCharacters = stringContainsSpecialCharacters ( nextElement ) ; if ( ( applyQuotesToAll || stringContainsSpecialCharacters ) && ( quotechar != NO_QUOTE_CHARACTER ) ) { sb . append ( quotechar ) ; } if ( stringContainsSpecialCharacters ) { sb . append ( processLine ( nextElement ) ) ; } else { sb . append ( nextElement ) ; } if ( ( applyQuotesToAll || stringContainsSpecialCharacters ) && ( quotechar != NO_QUOTE_CHARACTER ) ) { sb . append ( quotechar ) ; } } sb . append ( lineEnd ) ; pw . write ( sb . toString ( ) ) ;


signature:
public class CSVWriter { /** * checks to see if the line contains special characters .
 * @ param line - element of data to check for special characters .
 * @ return true if the line contains the quote , escape , separator , newline or return . */
protected boolean stringContainsSpecialCharacters ( String line ) { } }

implementation: return ( line . indexOf ( quotechar ) != - 1 ) || ( line . indexOf ( escapechar ) != - 1 ) || ( line . indexOf ( separator ) != - 1 ) || line . contains ( DEFAULT_LINE_END ) || line . contains ( "\r" ) ;


signature:
public class CSVWriter { /** * Processes all the characters in a line .
 * @ param nextElement - element to process .
 * @ return a StringBuilder with the elements data . */
protected StringBuilder processLine ( String nextElement ) { } }

implementation:
StringBuilder sb = new StringBuilder ( nextElement . length ( ) * 2 ) ; // this is for the worse case where all elements have to be escaped .
for ( int j = 0 ; j < nextElement . length ( ) ; j ++ ) { char nextChar = nextElement . charAt ( j ) ; processCharacter ( sb , nextChar ) ; } return sb ;


signature:
public class CSVWriter { /** * Appends the character to the StringBuilder adding the escape character if needed .
 * @ param sb - StringBuffer holding the processed character .
 * @ param nextChar - character to process */
private void processCharacter ( StringBuilder sb , char nextChar ) { } }

implementation: if ( ( escapechar != NO_ESCAPE_CHARACTER ) && checkCharactersToEscape ( nextChar ) ) { sb . append ( escapechar ) . append ( nextChar ) ; } else { sb . append ( nextChar ) ; }


signature:
public class DatabaseObjectCollection { /** * Returns the object described by the passed example if it is already included in this snapshot . */
public < DatabaseObjectType extends DatabaseObject > DatabaseObjectType get ( DatabaseObjectType example , CompareControl . SchemaComparison [ ] schemaComparisons ) { } }

implementation:
Map < String , Set < DatabaseObject > > databaseObjectsByHash = cache . get ( example . getClass ( ) ) ; if ( databaseObjectsByHash == null ) { return null ; } String [ ] hashes = DatabaseObjectComparatorFactory . getInstance ( ) . hash ( example , null , database ) ; SortedSet < Set < DatabaseObject > > objectSets = new TreeSet < > ( new Comparator < Set < DatabaseObject > > ( ) { @ Override public int compare ( Set < DatabaseObject > o1 , Set < DatabaseObject > o2 ) { int sizeComparison = Integer . valueOf ( o1 . size ( ) ) . compareTo ( o2 . size ( ) ) ; if ( sizeComparison == 0 ) { return o1 . toString ( ) . compareTo ( o2 . toString ( ) ) ; } return sizeComparison ; } } ) ; for ( String hash : hashes ) { Set < DatabaseObject > databaseObjects = databaseObjectsByHash . get ( hash ) ; if ( databaseObjects != null ) { objectSets . add ( databaseObjects ) ; } } for ( Set < DatabaseObject > databaseObjects : objectSets ) { for ( DatabaseObject obj : databaseObjects ) { if ( DatabaseObjectComparatorFactory . getInstance ( ) . isSameObject ( obj , example , schemaComparisons , database ) ) { // noinspection unchecked
return ( DatabaseObjectType ) obj ; } } } return null ;


signature:
public class DatabaseObjectCollection { /** * Returns all objects of the given type that are already included in this snapshot . */
public < DatabaseObjectType extends DatabaseObject > Set < DatabaseObjectType > get ( Class < DatabaseObjectType > type ) { } }

implementation: Set < DatabaseObject > returnSet = new HashSet < > ( ) ; Map < String , Set < DatabaseObject > > allFound = cache . get ( type ) ; if ( allFound != null ) { for ( Set < DatabaseObject > objects : allFound . values ( ) ) { returnSet . addAll ( objects ) ; } } return ( Set < DatabaseObjectType > ) Collections . unmodifiableSet ( returnSet ) ;


signature:
public class LiquibaseServletListener { /** * Checks if the update is supposed to be executed . That depends on several conditions :
 * < ol >
 * < li > if liquibase . shouldRun is < code > false < / code > the update will not be executed . < / li >
 * < li > if { @ value LiquibaseServletListener # LIQUIBASE _ HOST _ INCLUDES } contains the current hostname , the the update will be executed . < / li >
 * < li > if { @ value LiquibaseServletListener # LIQUIBASE _ HOST _ EXCLUDES } contains the current hostname , the the update will not be executed . < / li >
 * < / ol > */
private boolean checkPreconditions ( ServletContext servletContext , InitialContext ic ) { } }

implementation: GlobalConfiguration globalConfiguration = LiquibaseConfiguration . getInstance ( ) . getConfiguration ( GlobalConfiguration . class ) ; if ( ! globalConfiguration . getShouldRun ( ) ) { Scope . getCurrentScope ( ) . getLog ( getClass ( ) ) . info ( LogType . LOG , "Liquibase did not run on " + hostName + " because " + LiquibaseConfiguration . getInstance ( ) . describeValueLookupLogic ( globalConfiguration . getProperty ( GlobalConfiguration . SHOULD_RUN ) ) + " was set to false" ) ; return false ; } String machineIncludes = ( String ) servletValueContainer . getValue ( LIQUIBASE_HOST_INCLUDES ) ; String machineExcludes = ( String ) servletValueContainer . getValue ( LIQUIBASE_HOST_EXCLUDES ) ; boolean shouldRun = false ; if ( ( machineIncludes == null ) && ( machineExcludes == null ) ) { shouldRun = true ; } else if ( machineIncludes != null ) { for ( String machine : machineIncludes . split ( "," ) ) { machine = machine . trim ( ) ; if ( hostName . equalsIgnoreCase ( machine ) ) { shouldRun = true ; } } } else if ( machineExcludes != null ) { shouldRun = true ; for ( String machine : machineExcludes . split ( "," ) ) { machine = machine . trim ( ) ; if ( hostName . equalsIgnoreCase ( machine ) ) { shouldRun = false ; } } } if ( globalConfiguration . getShouldRun ( ) && globalConfiguration . getProperty ( GlobalConfiguration . SHOULD_RUN ) . getWasOverridden ( ) ) { shouldRun = true ; servletContext . log ( "ignoring " + LIQUIBASE_HOST_INCLUDES + " and " + LIQUIBASE_HOST_EXCLUDES + ", since " + LiquibaseConfiguration . getInstance ( ) . describeValueLookupLogic ( globalConfiguration . getProperty ( GlobalConfiguration . SHOULD_RUN ) ) + "=true" ) ; } if ( ! shouldRun ) { servletContext . log ( "LiquibaseServletListener did not run due to " + LIQUIBASE_HOST_INCLUDES + " and/or " + LIQUIBASE_HOST_EXCLUDES + "" ) ; return false ; } return true ;


signature:
public class LiquibaseServletListener { /** * Executes the Liquibase update . */
private void executeUpdate ( ServletContext servletContext , InitialContext ic ) throws NamingException , SQLException , LiquibaseException { } }

implementation: setDataSource ( ( String ) servletValueContainer . getValue ( LIQUIBASE_DATASOURCE ) ) ; if ( getDataSource ( ) == null ) { throw new RuntimeException ( "Cannot run Liquibase, " + LIQUIBASE_DATASOURCE + " is not set" ) ; } setChangeLogFile ( ( String ) servletValueContainer . getValue ( LIQUIBASE_CHANGELOG ) ) ; if ( getChangeLogFile ( ) == null ) { throw new RuntimeException ( "Cannot run Liquibase, " + LIQUIBASE_CHANGELOG + " is not set" ) ; } setContexts ( ( String ) servletValueContainer . getValue ( LIQUIBASE_CONTEXTS ) ) ; setLabels ( ( String ) servletValueContainer . getValue ( LIQUIBASE_LABELS ) ) ; this . defaultSchema = StringUtil . trimToNull ( ( String ) servletValueContainer . getValue ( LIQUIBASE_SCHEMA_DEFAULT ) ) ; Connection connection = null ; Database database = null ; try { DataSource dataSource = ( DataSource ) ic . lookup ( this . dataSourceName ) ; connection = dataSource . getConnection ( ) ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader contextClassLoader = currentThread . getContextClassLoader ( ) ; ResourceAccessor threadClFO = new ClassLoaderResourceAccessor ( contextClassLoader ) ; ResourceAccessor clFO = new ClassLoaderResourceAccessor ( ) ; ResourceAccessor fsFO = new FileSystemResourceAccessor ( ) ; database = DatabaseFactory . getInstance ( ) . findCorrectDatabaseImplementation ( new JdbcConnection ( connection ) ) ; database . setDefaultSchemaName ( getDefaultSchema ( ) ) ; Liquibase liquibase = new Liquibase ( getChangeLogFile ( ) , new CompositeResourceAccessor ( clFO , fsFO , threadClFO ) , database ) ; @ SuppressWarnings ( "unchecked" ) Enumeration < String > initParameters = servletContext . getInitParameterNames ( ) ; while ( initParameters . hasMoreElements ( ) ) { String name = initParameters . nextElement ( ) . trim ( ) ; if ( name . startsWith ( LIQUIBASE_PARAMETER + "." ) ) { liquibase . setChangeLogParameter ( name . substring ( LIQUIBASE_PARAMETER . length ( ) + 1 ) , servletValueContainer . getValue ( name ) ) ; } } liquibase . update ( new Contexts ( getContexts ( ) ) , new LabelExpression ( getLabels ( ) ) ) ; } finally { if ( database != null ) { database . close ( ) ; } else if ( connection != null ) { connection . close ( ) ; } }


signature:
public class AbstractSqlGenerator { /** * Tries to find out if a given value ( part a database - specific SQL statement ) is just a simple literal
 * ( e . g . ' Jones ' , 149.99 or false ) or if it is a call to a function within the database ( e . g .
 * TO _ DATE ( ' 28.12.2017 ' , ' dd . mm . yyyy ' ) in Oracle DB ) .
 * This method is often used to determine if we need to quote literals which are Strings , e . g . if we determine
 * " Dr . Jones " to be a literal , then we generate
 * < pre > < code > { @ code INSERT INTO customers ( last _ name ) VALUES ( ' Dr . Jones ' ) } < / code > < / pre >
 * but if the value is a function call , we may not quote it , e . g . for " TO _ DATE ( ' 28.12.2017 ' , ' dd . mm . yyyy ' ) " , we
 * need to generate ( note the absence of the apostrophes ! ) :
 * < pre > < code > { @ code INSERT INTO bookings ( booking _ date ) VALUES ( TO _ DATE ( ' 28.12.2017 ' , ' dd . mm . yyyy ' ) ) } < / code > < / pre >
 * @ param value The string to test
 * @ param database the database object to test against
 * @ return true if value looks like a function call , false if it looks like a literal . */
public boolean looksLikeFunctionCall ( String value , Database database ) { } }

implementation:
// TODO : SYSIBM looks DB2 - specific , we should move that out of AbstractSqlGenerator into a DB2 - specific class .
return value . startsWith ( "\"SYSIBM\"" ) || value . startsWith ( "to_date(" ) || value . equalsIgnoreCase ( database . getCurrentDateTimeFunction ( ) ) ;


signature:
public class OracleDatabase { /** * < p > Returns an Oracle date literal with the same value as a string formatted using ISO 8601 . < / p >
 * < p > Convert an ISO8601 date string to one of the following results :
 * to _ date ( ' 1995-05-23 ' , ' YYYY - MM - DD ' )
 * to _ date ( ' 1995-05-23 09:23:59 ' , ' YYYY - MM - DD HH24 : MI : SS ' ) < / p >
 * Implementation restriction : < br >
 * Currently , only the following subsets of ISO8601 are supported : < br >
 * < ul >
 * < li > YYYY - MM - DD < / li >
 * < li > YYYY - MM - DDThh : mm : ss < / li >
 * < / ul > */
@ Override public String getDateLiteral ( String isoDate ) { } }

implementation:
String normalLiteral = super . getDateLiteral ( isoDate ) ; if ( isDateOnly ( isoDate ) ) { StringBuffer val = new StringBuffer ( ) ; // noinspection HardCodedStringLiteral
val . append ( "TO_DATE(" ) ; val . append ( normalLiteral ) ; // noinspection HardCodedStringLiteral
val . append ( ", 'YYYY-MM-DD')" ) ; return val . toString ( ) ; } else if ( isTimeOnly ( isoDate ) ) { StringBuffer val = new StringBuffer ( ) ; // noinspection HardCodedStringLiteral
val . append ( "TO_DATE(" ) ; val . append ( normalLiteral ) ; // noinspection HardCodedStringLiteral
val . append ( ", 'HH24:MI:SS')" ) ; return val . toString ( ) ; } else if ( isTimestamp ( isoDate ) ) { StringBuffer val = new StringBuffer ( 26 ) ; // noinspection HardCodedStringLiteral
val . append ( "TO_TIMESTAMP(" ) ; val . append ( normalLiteral ) ; // noinspection HardCodedStringLiteral
val . append ( ", 'YYYY-MM-DD HH24:MI:SS.FF')" ) ; return val . toString ( ) ; } else if ( isDateTime ( isoDate ) ) { int seppos = normalLiteral . lastIndexOf ( '.' ) ; if ( seppos != - 1 ) { normalLiteral = normalLiteral . substring ( 0 , seppos ) + "'" ; } StringBuffer val = new StringBuffer ( 26 ) ; // noinspection HardCodedStringLiteral
val . append ( "TO_DATE(" ) ; val . append ( normalLiteral ) ; // noinspection HardCodedStringLiteral
val . append ( ", 'YYYY-MM-DD HH24:MI:SS')" ) ; return val . toString ( ) ; } // noinspection HardCodedStringLiteral
return "UNSUPPORTED:" + isoDate ;


signature:
public class OracleDatabase { /** * Tests if the given String would be a valid identifier in Oracle DBMS . In Oracle , a valid identifier has
 * the following form ( case - insensitive comparison ) :
 * 1st character : A - Z
 * 2 . . n characters : A - Z0-9 $ _ #
 * The maximum length of an identifier differs by Oracle version and object type . */
public boolean isValidOracleIdentifier ( String identifier , Class < ? extends DatabaseObject > type ) { } }

implementation:
if ( ( identifier == null ) || ( identifier . length ( ) < 1 ) ) return false ; if ( ! identifier . matches ( "^(i?)[A-Z][A-Z0-9\\$\\_\\#]*$" ) ) return false ; /* * @ todo It seems we currently do not have a class for tablespace identifiers , and all other classes
 * we do know seem to be supported as 12cR2 long identifiers , so : */
return ( identifier . length ( ) <= LONG_IDENTIFIERS_LEGNTH ) ;


signature:
public class OracleDatabase { /** * Returns the maximum number of bytes ( NOT : characters ) for an identifier . For Oracle < = 12c Release 20 , this
 * is 30 bytes , and starting from 12cR2 , up to 128 ( except for tablespaces , PDB names and some other rather rare
 * object types ) .
 * @ return the maximum length of an object identifier , in bytes */
public int getIdentifierMaximumLength ( ) { } }

implementation: try { if ( getDatabaseMajorVersion ( ) < ORACLE_12C_MAJOR_VERSION ) { return SHORT_IDENTIFIERS_LENGTH ; } else if ( ( getDatabaseMajorVersion ( ) == ORACLE_12C_MAJOR_VERSION ) && ( getDatabaseMinorVersion ( ) <= 1 ) ) { return SHORT_IDENTIFIERS_LENGTH ; } else { return LONG_IDENTIFIERS_LEGNTH ; } } catch ( DatabaseException ex ) { throw new UnexpectedLiquibaseException ( "Cannot determine the Oracle database version number" , ex ) ; }


signature:
public class AbstractPluginFactory { /** * Finds the plugin for which { @ link # getPriority ( Plugin , Object . . . ) } returns the highest value for the given scope and args .
 * This method is called by a public implementation - specific methods .
 * Normally this does not need to be overridden , instead override { @ link # getPriority ( Plugin , Object . . . ) } to compute the priority of each object for the scope and arguments passed to this method .
 * @ return null if no plugins are found or have a priority greater than zero . */
protected T getPlugin ( final Object ... args ) { } }

implementation: TreeSet < T > applicable = new TreeSet < > ( ( o1 , o2 ) -> { Integer o1Priority = getPriority ( o1 , args ) ; Integer o2Priority = getPriority ( o2 , args ) ; int i = o2Priority . compareTo ( o1Priority ) ; if ( i == 0 ) { return o1 . getClass ( ) . getName ( ) . compareTo ( o2 . getClass ( ) . getName ( ) ) ; } return i ; } ) ; for ( T plugin : findAllInstances ( ) ) { if ( getPriority ( plugin , args ) >= 0 ) { applicable . add ( plugin ) ; } } if ( applicable . size ( ) == 0 ) { return null ; } return applicable . iterator ( ) . next ( ) ;


signature:
public class AbstractPluginFactory { /** * Finds implementations of the given interface or class and returns instances of them .
 * Standard implementation uses { @ link ServiceLoader } to find implementations and caches results in { @ link # allInstances } which means the same objects are always returned .
 * If the instances should not be treated as singletons , clone the objects before returning them from { @ link # getPlugin ( Object . . . ) } . */
protected synchronized Collection < T > findAllInstances ( ) { } }

implementation: if ( this . allInstances == null ) { this . allInstances = new ArrayList < > ( ) ; ServiceLocator serviceLocator = Scope . getCurrentScope ( ) . getServiceLocator ( ) ; this . allInstances . addAll ( serviceLocator . findInstances ( getPluginClass ( ) ) ) ; } return this . allInstances ;


signature:
public class ConfigurationProperty { /** * Initialize this property with values in the given ConfigurationProvers . If the configurationValueProviders do not contain
 * a default value , the property is initialized with the value set by { @ link # setDefaultValue ( Object ) } .
 * If multiple configurationValueProviders contain values , the first in the list wins . */
protected void init ( ConfigurationValueProvider [ ] configurationValueProviders ) { } }

implementation: Object containerValue = null ; for ( ConfigurationValueProvider container : configurationValueProviders ) { containerValue = container . getValue ( namespace , name ) ; for ( String alias : aliases ) { if ( containerValue != null ) { break ; } containerValue = container . getValue ( namespace , alias ) ; } } if ( containerValue == null ) { value = defaultValue ; } else { try { value = valueOf ( containerValue ) ; wasOverridden = true ; } catch ( NumberFormatException e ) { throw new UnexpectedLiquibaseException ( "Error parsing " + containerValue + " as a " + type . getSimpleName ( ) ) ; } }


signature:
public class ConfigurationProperty { /** * Converts an object of a different type to the type used by this property . If types are not convertible , an exception is thrown . */
protected Object valueOf ( Object value ) { } }

implementation: if ( value == null ) { return value ; } else if ( type . isAssignableFrom ( value . getClass ( ) ) ) { return value ; } else if ( value instanceof String ) { if ( type . equals ( Boolean . class ) ) { return Boolean . valueOf ( ( String ) value ) ; } else if ( type . equals ( Integer . class ) ) { return Integer . valueOf ( ( String ) value ) ; } else if ( type . equals ( BigDecimal . class ) ) { return new BigDecimal ( ( String ) value ) ; } else if ( type . equals ( Long . class ) ) { return Long . valueOf ( ( String ) value ) ; } else if ( type . equals ( List . class ) ) { return StringUtil . splitAndTrim ( ( String ) value , "," ) ; } else { throw new UnexpectedLiquibaseException ( "Cannot parse property " + value . getClass ( ) . getSimpleName ( ) + " to a " + type . getSimpleName ( ) ) ; } } else { throw new UnexpectedLiquibaseException ( "Could not convert " + value . getClass ( ) . getSimpleName ( ) + " to a " + type . getSimpleName ( ) ) ; }


signature:
public class ConfigurationProperty { /** * Returns the value currently stored in this property cast to the given type . */
public < T > T getValue ( Class < T > type ) { } }

implementation: if ( ! this . type . isAssignableFrom ( type ) ) { throw new UnexpectedLiquibaseException ( "Property " + name + " on is of type " + this . type . getSimpleName ( ) + ", not " + type . getSimpleName ( ) ) ; } return ( T ) value ;


signature:
public class ConfigurationProperty { /** * Overwrites the value currently stored in this property . It he passed type is not compatible with the defined type , an exception is thrown . */
public void setValue ( Object value ) { } }

implementation: if ( ( value != null ) && ! type . isAssignableFrom ( value . getClass ( ) ) ) { throw new UnexpectedLiquibaseException ( "Property " + name + " on is of type " + type . getSimpleName ( ) + ", not " + value . getClass ( ) . getSimpleName ( ) ) ; } this . value = value ; wasOverridden = true ;


signature:
public class ConfigurationProperty { /** * Adds an alias for this property . An alias is an alternate to the " name " field that can be used by the ConfigurationProvers to look up starting values . */
public ConfigurationProperty addAlias ( String ... aliases ) { } }

implementation: if ( aliases != null ) { this . aliases . addAll ( Arrays . asList ( aliases ) ) ; } return this ;


signature:
public class ConfigurationProperty { /** * Sets the default value to use if no ConfigurationProviders override it . Throws an exception if the given object is not compatible with the defined type . */
public ConfigurationProperty setDefaultValue ( Object defaultValue ) { } }

implementation: if ( ( defaultValue != null ) && ! type . isAssignableFrom ( defaultValue . getClass ( ) ) ) { if ( ( type == Long . class ) && ( defaultValue instanceof Integer ) ) { return setDefaultValue ( ( ( Integer ) defaultValue ) . longValue ( ) ) ; } throw new UnexpectedLiquibaseException ( "Property " + name + " on is of type " + type . getSimpleName ( ) + ", not " + defaultValue . getClass ( ) . getSimpleName ( ) ) ; } this . defaultValue = defaultValue ; return this ;


signature:
public class CreateIndexGeneratorFirebird { /** * Generate a CREATE INDEX SQL statement for Firebird databases .
 * @ param statement A CreateIndexStatement with the desired properties of the SQL to be generated
 * @ param database A database object ( must be of FirebirdDatabase type , or we will error out )
 * @ param sqlGeneratorChain The other generators in the current chain ( ignored by this implementation )
 * @ return An array with one entry containing the generated CREATE INDEX statement for Firebird . */
@ Override public Sql [ ] generateSql ( CreateIndexStatement statement , Database database , SqlGeneratorChain sqlGeneratorChain ) { } }

implementation:
/* * According to https : / / firebirdsql . org / refdocs / langrefupd20 - create - table . html # langrefupd20 - ct - using - index ,
 * Firebird automatically creates indexes for PRIMARY KEY , UNIQUE KEY and FOREIGN KEY constraints ,
 * so we should not duplicate that functionality ( = we should not issue CREATE INDEX statements for them ) */
List < String > associatedWith = StringUtil . splitAndTrim ( statement . getAssociatedWith ( ) , "," ) ; if ( ( associatedWith != null ) && ( associatedWith . contains ( Index . MARK_PRIMARY_KEY ) || associatedWith . contains ( Index . MARK_UNIQUE_CONSTRAINT ) || associatedWith . contains ( Index . MARK_FOREIGN_KEY ) ) ) { return new Sql [ 0 ] ; } StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "CREATE " ) ; // If the statement wants a UNIQUE index , issue a CREATE UNIQUE . . . INDEX statement .
if ( ( statement . isUnique ( ) != null ) && statement . isUnique ( ) ) { buffer . append ( "UNIQUE " ) ; } /* * Examine the direction ( ASCending or DESCending ) of all columns of the planned index . If _ all _ of them
 * are DESC , issue a CREATE DESCENDING INDEX statement . If all of them are ASC , we do not need to do anything
 * special ( ASCENDING is the default ) . However , since Firebird does not seem to support mixed ASC / DESC
 * columns within a single index , we must error out .
 * The syntax we want to create is this :
 * CREATE [ UNIQUE ] [ ASC [ ENDING ] | DESC [ ENDING ] ] INDEX index _ name ON table _ name
 * { ( col [ , col . . . ] ) | COMPUTED BY ( < expression > ) } ; */
ColumnAnalysisResult result = analyseColumns ( statement , database ) ; if ( result . isFoundDescColumns ( ) ) buffer . append ( "DESCENDING " ) ; buffer . append ( "INDEX " ) ; if ( statement . getIndexName ( ) != null ) { String indexSchema = statement . getTableSchemaName ( ) ; buffer . append ( database . escapeIndexName ( statement . getTableCatalogName ( ) , indexSchema , statement . getIndexName ( ) ) ) . append ( " " ) ; } buffer . append ( "ON " ) ; // append table name
buffer . append ( database . escapeTableName ( statement . getTableCatalogName ( ) , statement . getTableSchemaName ( ) , statement . getTableName ( ) ) ) ; if ( result . getNumComputedCols ( ) > 0 ) buffer . append ( "COMPUTED BY " ) ; buffer . append ( String . format ( "(%s)" , result . getColumnExpression ( ) ) ) ; return new Sql [ ] { new UnparsedSql ( buffer . toString ( ) , getAffectedIndex ( statement ) ) } ;


signature:
public class CreateIndexGeneratorFirebird { /** * Analyzes the column list for the statement and returns a ColumnAnalysisResult which contains :
 * - The final column list ( or computed expression )
 * - How many regular columns were found
 * - How many computed expressions were found
 * - If any column had an ASCending sorting
 * - If any column had a DESCending sorting
 * @ param statement the CreateIndexStatement to analyse
 * @ param database the Database object ( FirebirdDatabase is expected )
 * @ return the result of the analysis */
private ColumnAnalysisResult analyseColumns ( CreateIndexStatement statement , Database database ) { } }

implementation:
ColumnAnalysisResult result = new ColumnAnalysisResult ( ) ; StringBuffer idxColsBuf = new StringBuffer ( ) ; result . foundAscColumns = false ; result . foundDescColumns = false ; result . numComputedCols = 0 ; result . numRegularCols = 0 ; Iterator < AddColumnConfig > iterator = Arrays . asList ( statement . getColumns ( ) ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { AddColumnConfig column = iterator . next ( ) ; boolean columnExpressionIsComputed ; if ( column . getComputed ( ) == null ) { /* We absolutely must know whether we have a column identifier or something else ( expression index )
 * in front of us , because the correct syntax depends on it . */
columnExpressionIsComputed = applyIsComputedExpressionHeuristic ( column , database ) ; } else { columnExpressionIsComputed = column . getComputed ( ) ; } if ( columnExpressionIsComputed ) { idxColsBuf . append ( column . getName ( ) ) ; // Use the expression as - is
result . setNumComputedCols ( result . getNumComputedCols ( ) + 1 ) ; } else { result . setNumRegularCols ( ( result . getNumRegularCols ( ) ) + 1 ) ; idxColsBuf . append ( database . escapeColumnName ( statement . getTableCatalogName ( ) , statement . getTableSchemaName ( ) , statement . getTableName ( ) , column . getName ( ) ) ) ; } if ( ( column . getDescending ( ) != null ) && column . getDescending ( ) ) { result . setFoundDescColumns ( true ) ; } else { result . setFoundAscColumns ( true ) ; } if ( iterator . hasNext ( ) ) { idxColsBuf . append ( ", " ) ; } } result . setColumnExpression ( idxColsBuf . toString ( ) ) ; return result ;


signature:
public class CreateIndexGeneratorFirebird { /** * An imperfect heuristic to determine if an expression is more likely a column name or a computed expression .
 * @ return true if it is more likely an expression , false if it is more likely a column name ( identifier ) . */
private boolean applyIsComputedExpressionHeuristic ( ColumnConfig column , Database database ) { } }

implementation:
String expr = column . getName ( ) ; /* * https : / / firebirdsql . org / file / documentation / reference _ manuals / fblangref25 - en / html / fblangref25 - structure - identifiers . html
 * says the following about what makes a valid identifier in Firebird :
 * - At most 31 chars
 * - Starts with a 7 - bit character
 * - After that , letters , digits , underscores or dollar signs are valid characters */
String regex = "^(?i)[ABCDEFGHIJKLMNOPQRSTUVWXYZ]" // Starting character
+ "[ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$]{0,30}$" ; // following characters
if ( ! expr . matches ( regex ) ) return true ; /* At this point , we know that expr at least has the form of an identifier . If it is a function , it must
 * be in the list of database functions . */
if ( database . isFunction ( expr ) ) return true ; else return false ;


signature:
public class StreamUtil { /** * Returns the given stream as a string using the given encoding .
 * If encoding is null , use { @ link Scope # getFileEncoding ( ) } */
public static String readStreamAsString ( InputStream stream , String encoding ) throws IOException { } }

implementation: StringBuilder result = new StringBuilder ( ) ; try ( Reader reader = readStreamWithReader ( stream , encoding ) ) { char [ ] buffer = new char [ 2048 ] ; int read ; while ( ( read = reader . read ( buffer ) ) > - 1 ) { result . append ( buffer , 0 , read ) ; } return result . toString ( ) ; }


signature: public class YamlSnapshotSerializer { @ Override protected Object toMap ( final LiquibaseSerializable object ) { } }

implementation: if ( object instanceof DatabaseObject ) { if ( alreadySerializingObject ) { String snapshotId = ( ( DatabaseObject ) object ) . getSnapshotId ( ) ; if ( snapshotId == null ) { String name = ( ( DatabaseObject ) object ) . getName ( ) ; Object table = ( ( DatabaseObject ) object ) . getAttribute ( "table" , Object . class ) ; if ( table == null ) { table = ( ( DatabaseObject ) object ) . getAttribute ( "relation" , Object . class ) ; } if ( table != null ) { name = table . toString ( ) + "." + name ; } if ( ( ( DatabaseObject ) object ) . getSchema ( ) != null ) { name = ( ( DatabaseObject ) object ) . getSchema ( ) . toString ( ) + "." + name ; } throw new UnexpectedLiquibaseException ( "Found a null snapshotId for " + StringUtil . lowerCaseFirst ( object . getClass ( ) . getSimpleName ( ) ) + " " + name ) ; } return ( ( DatabaseObject ) object ) . getClass ( ) . getName ( ) + "#" + snapshotId ; } else { alreadySerializingObject = true ; Object map = super . toMap ( object ) ; alreadySerializingObject = false ; return map ; } } if ( object instanceof DatabaseObjectCollection ) { SortedMap < String , Object > returnMap = new TreeMap < > ( ) ; for ( Map . Entry < Class < ? extends DatabaseObject > , Set < ? extends DatabaseObject > > entry : ( ( DatabaseObjectCollection ) object ) . toMap ( ) . entrySet ( ) ) { ArrayList value = new ArrayList ( entry . getValue ( ) ) ; Collections . sort ( value , new DatabaseObjectComparator ( ) ) ; returnMap . put ( entry . getKey ( ) . getName ( ) , value ) ; } return returnMap ; } return super . toMap ( object ) ;


signature:
public class ValidationErrors { /** * < p > Checks if a field is forbidden in combination with a given Database ( most often because that database
 * does not implement the features required by the field / value combination ) . If a " forbidden " use is detected ,
 * a validation error is added to the current list of ValidationErrors . < / p >
 * Note :
 * < ul >
 * < li > if value = = null , the field is ALLOWED for all DBs < / li >
 * < li > if the disallowedDatabases list does not at least contain 1 entry , the field is NOT allowed < / li >
 * < / ul >
 * @ param disallowedFieldName field whose value is checked
 * @ param value value that might be disallowed
 * @ param database database the object / value combination is checked against
 * @ param disallowedDatabases a list of " forbidden " databases that do not allow this field / value combination */
@ SafeVarargs public final void checkDisallowedField ( String disallowedFieldName , Object value , Database database , Class < ? extends Database > ... disallowedDatabases ) { } }

implementation: boolean isDisallowed = false ; if ( ( disallowedDatabases == null ) || ( disallowedDatabases . length == 0 ) ) { isDisallowed = true ; } else { for ( Class < ? extends Database > databaseClass : disallowedDatabases ) { if ( databaseClass . isAssignableFrom ( database . getClass ( ) ) ) { isDisallowed = true ; } } } if ( isDisallowed && ( value != null ) ) { addError ( disallowedFieldName + " is not allowed on " + ( database == null ? "unknown" : database . getShortName ( ) ) ) ; }


signature:
public class Liquibase { /** * Drops all database objects in the passed schema ( s ) . */
public final void dropAll ( CatalogAndSchema ... schemas ) throws DatabaseException { } }

implementation: if ( ( schemas == null ) || ( schemas . length == 0 ) ) { schemas = new CatalogAndSchema [ ] { new CatalogAndSchema ( getDatabase ( ) . getDefaultCatalogName ( ) , getDatabase ( ) . getDefaultSchemaName ( ) ) } ; } DropAllCommand dropAll = ( DropAllCommand ) CommandFactory . getInstance ( ) . getCommand ( "dropAll" ) ; dropAll . setDatabase ( this . getDatabase ( ) ) ; dropAll . setSchemas ( schemas ) ; try { dropAll . execute ( ) ; } catch ( CommandExecutionException e ) { throw new DatabaseException ( e ) ; }


signature:
public class Liquibase { /** * ' Tags ' the database for future rollback */
public void tag ( String tagString ) throws LiquibaseException { } }

implementation: LockService lockService = LockServiceFactory . getInstance ( ) . getLockService ( database ) ; lockService . waitForLock ( ) ; try { ChangeLogHistoryServiceFactory . getInstance ( ) . getChangeLogService ( database ) . generateDeploymentId ( ) ; checkLiquibaseTables ( false , null , new Contexts ( ) , new LabelExpression ( ) ) ; getDatabase ( ) . tag ( tagString ) ; } finally { try { lockService . releaseLock ( ) ; } catch ( LockException e ) { LOG . severe ( LogType . LOG , MSG_COULD_NOT_RELEASE_LOCK , e ) ; } }


signature:
public class Liquibase { /** * Display change log lock information . */
public DatabaseChangeLogLock [ ] listLocks ( ) throws LiquibaseException { } }

implementation: checkLiquibaseTables ( false , null , new Contexts ( ) , new LabelExpression ( ) ) ; return LockServiceFactory . getInstance ( ) . getLockService ( database ) . listLocks ( ) ;


signature:
public class Liquibase { /** * Returns the ChangeSetStatuses of all changesets in the change log file and history in the order they
 * would be ran . */
public List < ChangeSetStatus > getChangeSetStatuses ( Contexts contexts , LabelExpression labelExpression , boolean checkLiquibaseTables ) throws LiquibaseException { } }

implementation: changeLogParameters . setContexts ( contexts ) ; changeLogParameters . setLabels ( labelExpression ) ; DatabaseChangeLog changeLog = getDatabaseChangeLog ( ) ; if ( checkLiquibaseTables ) { checkLiquibaseTables ( true , changeLog , contexts , labelExpression ) ; } changeLog . validate ( database , contexts , labelExpression ) ; ChangeLogIterator logIterator = getStandardChangelogIterator ( contexts , labelExpression , changeLog ) ; StatusVisitor visitor = new StatusVisitor ( database ) ; logIterator . run ( visitor , new RuntimeEnvironment ( database , contexts , labelExpression ) ) ; return visitor . getStatuses ( ) ;


signature:
public class Liquibase { /** * Sets checksums to null so they will be repopulated next run */
public void clearCheckSums ( ) throws LiquibaseException { } }

implementation: LOG . info ( LogType . LOG , "Clearing database change log checksums" ) ; LockService lockService = LockServiceFactory . getInstance ( ) . getLockService ( database ) ; lockService . waitForLock ( ) ; try { checkLiquibaseTables ( false , null , new Contexts ( ) , new LabelExpression ( ) ) ; UpdateStatement updateStatement = new UpdateStatement ( getDatabase ( ) . getLiquibaseCatalogName ( ) , getDatabase ( ) . getLiquibaseSchemaName ( ) , getDatabase ( ) . getDatabaseChangeLogTableName ( ) ) ; updateStatement . addNewColumnValue ( "MD5SUM" , null ) ; ExecutorService . getInstance ( ) . getExecutor ( database ) . execute ( updateStatement ) ; getDatabase ( ) . commit ( ) ; } finally { try { lockService . releaseLock ( ) ; } catch ( LockException e ) { LOG . severe ( LogType . LOG , MSG_COULD_NOT_RELEASE_LOCK , e ) ; } } resetServices ( ) ;


signature:
public class CsvToBean { /** * parse the values from a csvReader constructed from the passed in Reader .
 * @ param mapper - mapping strategy for the bean .
 * @ param reader - Reader used to construct a CSVReader
 * @ return List of Objects . */
public List < T > parse ( MappingStrategy < T > mapper , Reader reader ) { } }

implementation: return parse ( mapper , new CSVReader ( reader ) ) ;


signature:
public class CsvToBean { /** * parse the values from the csvReader .
 * @ param mapper - mapping strategy for the bean .
 * @ param csv - CSVReader
 * @ return List of Objects . */
public List < T > parse ( MappingStrategy < T > mapper , CSVReader csv ) { } }

implementation: return parse ( mapper , csv , null ) ;


signature:
public class CsvToBean { /** * parse the values from the csvReader .
 * @ param mapper - mapping strategy for the bean .
 * @ param csv - CSVReader
 * @ param filter - CsvToBeanFilter to apply - null if no filter .
 * @ return List of Objects . */
public List < T > parse ( MappingStrategy < T > mapper , CSVReader csv , CsvToBeanFilter filter ) { } }

implementation: long lineProcessed = 0 ; String [ ] line = null ; try { mapper . captureHeader ( csv ) ; } catch ( Exception e ) { throw new RuntimeException ( "Error capturing CSV header!" , e ) ; } try { List < T > list = new ArrayList < > ( ) ; while ( null != ( line = csv . readNext ( ) ) ) { lineProcessed ++ ; processLine ( mapper , filter , line , list ) ; } return list ; } catch ( Exception e ) { throw new RuntimeException ( "Error parsing CSV line: " + lineProcessed + " values: " + Arrays . toString ( line ) , e ) ; }


signature:
public class CsvToBean { /** * Creates a single object from a line from the csv file .
 * @ param mapper - MappingStrategy
 * @ param line - array of Strings from the csv file .
 * @ return - object containing the values .
 * @ throws ReflectiveOperationException - thrown on error accessing bean .
 * @ throws IntrospectionException - thrown on error getting the PropertyDescriptor . */
protected T processLine ( MappingStrategy < T > mapper , String [ ] line ) throws ReflectiveOperationException , IntrospectionException { } }

implementation: T bean = mapper . createBean ( ) ; for ( int col = 0 ; col < line . length ; col ++ ) { if ( mapper . isAnnotationDriven ( ) ) { processField ( mapper , line , bean , col ) ; } else { processProperty ( mapper , line , bean , col ) ; } } return bean ;


signature:
public class CsvToBean { /** * Attempt to find custom property editor on descriptor first , else try the propery editor manager .
 * @ param desc - PropertyDescriptor .
 * @ return - the PropertyEditor for the given PropertyDescriptor .
 * @ throws ReflectiveOperationException - thrown when getting the PropertyEditor for the class . */
protected PropertyEditor getPropertyEditor ( PropertyDescriptor desc ) throws ReflectiveOperationException { } }

implementation: Class < ? > cls = desc . getPropertyEditorClass ( ) ; if ( null != cls ) { return ( PropertyEditor ) cls . getConstructor ( ) . newInstance ( ) ; } return getPropertyEditorValue ( desc . getPropertyType ( ) ) ;


signature:
public class DefaultPackageScanClassResolver { /** * Strategy to get the resources by the given classloader .
 * Notice that in WebSphere platforms there is a { @ link WebSpherePackageScanClassResolver }
 * to take care of WebSphere ' s odditiy of resource loading .
 * @ param loader the classloader
 * @ param packageName the packagename for the package to load
 * @ return URL ' s for the given package
 * @ throws IOException is thrown by the classloader */
protected Enumeration < URL > getResources ( ClassLoader loader , String packageName ) throws IOException { } }

implementation:
log . fine ( LogType . LOG , "Getting resource URL for package: " + packageName + " with classloader: " + loader ) ; // If the URL is a jar , the URLClassloader . getResources ( ) seems to require a trailing slash . The
// trailing slash is harmless for other URLs
if ( ! packageName . endsWith ( "/" ) ) { packageName = packageName + "/" ; } return loader . getResources ( packageName ) ;


signature:
public class DefaultPackageScanClassResolver { /** * Finds matches in a physical directory on a filesystem . Examines all files
 * within a directory - if the File object is not a directory , and ends with
 * < i > . class < / i > the file is loaded . Operates recursively to find classes within a
 * folder structure matching the package structure .
 * @ param parent the package name up to this directory in the package
 * hierarchy . E . g . if / classes is in the classpath and we wish to
 * examine files in / classes / org / apache then the values of
 * < i > parent < / i > would be < i > org / apache < / i >
 * @ param location a File object representing a directory */
private void loadImplementationsInDirectory ( String parent , File location , ClassLoader classLoader ) { } }

implementation: Set < String > classFiles = classFilesByLocation . get ( location . toString ( ) ) ; if ( classFiles == null ) { classFiles = new HashSet < String > ( ) ; File [ ] files = location . listFiles ( ) ; StringBuilder builder = null ; for ( File file : files ) { builder = new StringBuilder ( 100 ) ; String name = file . getName ( ) ; if ( name != null ) { name = name . trim ( ) ; builder . append ( parent ) . append ( "/" ) . append ( name ) ; String packageOrClass = ( parent == null ) ? name : builder . toString ( ) ; if ( file . isDirectory ( ) ) { loadImplementationsInDirectory ( packageOrClass , file , classLoader ) ; } else if ( name . endsWith ( ".class" ) ) { classFiles . add ( packageOrClass ) ; } } } } for ( String packageOrClass : classFiles ) { this . loadClass ( packageOrClass , classLoader ) ; }


signature:
public class DefaultPackageScanClassResolver { /** * Finds matching classes within a jar files that contains a folder
 * structure matching the package structure . If the File is not a JarFile or
 * does not exist a warning will be logged , but no error will be raised .
 * Any nested JAR files found inside this JAR will be assumed to also be
 * on the classpath and will be recursively examined for classes in ` parentPackage ` .
 * @ param parentPackage the parent package under which classes must be in order to
 * be considered
 * @ param parentFileStream the inputstream of the jar file to be examined for classes
 * @ param loader a classloader which can load classes contained within the JAR file
 * @ param parentFileName a unique name for the parentFileStream , to be used for caching .
 * This is the URL of the parentFileStream , if it comes from a URL ,
 * or a composite ID if we are currently examining a nested JAR . */
protected void loadImplementationsInJar ( String parentPackage , InputStream parentFileStream , ClassLoader loader , String parentFileName , String grandparentFileName ) throws IOException { } }

implementation:
Set < String > classFiles = classFilesByLocation . get ( parentFileName ) ; if ( classFiles == null ) { classFiles = new HashSet < String > ( ) ; classFilesByLocation . put ( parentFileName , classFiles ) ; Set < String > grandparentClassFiles = classFilesByLocation . get ( grandparentFileName ) ; if ( grandparentClassFiles == null ) { grandparentClassFiles = new HashSet < String > ( ) ; classFilesByLocation . put ( grandparentFileName , grandparentClassFiles ) ; } JarInputStream jarStream ; if ( parentFileStream instanceof JarInputStream ) { jarStream = ( JarInputStream ) parentFileStream ; } else { jarStream = new JarInputStream ( parentFileStream ) ; } JarEntry entry ; while ( ( entry = jarStream . getNextJarEntry ( ) ) != null ) { String name = entry . getName ( ) ; if ( name != null ) { if ( name . endsWith ( ".jar" ) ) { // in a nested jar
log . fine ( LogType . LOG , "Found nested jar " + name ) ; // To avoid needing to unzip ' parentFile ' in its entirety , as that
// may take a very long time ( see CORE - 2115 ) or not even be possible
// ( see CORE - 2595 ) , we load the nested JAR from the classloader and
// read it as a zip .
// It is safe to assume that the nested JAR is readable by the classloader
// as a resource stream , because we have reached this point by scanning
// through packages located from ` classloader ` by using ` getResource ` .
// If loading this nested JAR as a resource fails , then certainly loading
// classes from inside it with ` classloader ` would fail and we are safe
// to exclude it form the PackageScan .
InputStream nestedJarResourceStream = loader . getResourceAsStream ( name ) ; if ( nestedJarResourceStream != null ) { JarInputStream nestedJarStream = new JarInputStream ( nestedJarResourceStream ) ; try { loadImplementationsInJar ( parentPackage , nestedJarStream , loader , parentFileName + "!" + name , parentFileName ) ; } finally { nestedJarStream . close ( ) ; } } } else if ( ! entry . isDirectory ( ) && name . endsWith ( ".class" ) ) { classFiles . add ( name . trim ( ) ) ; grandparentClassFiles . add ( name . trim ( ) ) ; } } } } for ( String name : classFiles ) { if ( name . contains ( parentPackage ) ) { loadClass ( name , loader ) ; } }


signature:
public class DefaultPackageScanClassResolver { /** * Add the class designated by the fully qualified class name provided to
 * the set of resolved classes if and only if it is approved by the Test
 * supplied .
 * @ param test the test used to determine if the class matches
 * @ param fqn the fully qualified name of a class */
protected void addIfMatching ( PackageScanFilter test , String fqn , Set < Class < ? > > classes ) { } }

implementation:
try { String externalName = fqn . substring ( 0 , fqn . indexOf ( '.' ) ) . replace ( '/' , '.' ) ; Set < ClassLoader > set = getClassLoaders ( ) ; boolean found = false ; for ( ClassLoader classLoader : set ) { log . fine ( LogType . LOG , "Testing that class " + externalName + " matches criteria [" + test + "] using classloader:" + classLoader ) ; try { Class < ? > type = classLoader . loadClass ( externalName ) ; log . fine ( LogType . LOG , "Loaded the class: " + type + " in classloader: " + classLoader ) ; if ( test . matches ( type ) ) { log . fine ( LogType . LOG , "Found class: " + type + " which matches the filter in classloader: " + classLoader ) ; classes . add ( type ) ; } found = true ; break ; } catch ( ClassNotFoundException e ) { log . fine ( LogType . LOG , "Cannot find class '" + fqn + "' in classloader: " + classLoader + ". Reason: " + e , e ) ; } catch ( LinkageError e ) { log . fine ( LogType . LOG , "Cannot find the class definition '" + fqn + "' in classloader: " + classLoader + ". Reason: " + e , e ) ; } catch ( Exception e ) { log . severe ( LogType . LOG , "Cannot load class '" + fqn + "' in classloader: " + classLoader + ".  Reason: " + e , e ) ; } } if ( ! found ) { // use debug to avoid being noisy in logs
log . fine ( LogType . LOG , "Cannot find class '" + fqn + "' in any classloaders: " + set ) ; } } catch ( Exception e ) { log . warning ( LogType . LOG , "Cannot examine class '" + fqn + "' due to a " + e . getClass ( ) . getName ( ) + " with message: " + e . getMessage ( ) , e ) ; }


signature:
public class ObjectUtil { /** * For a given object , try to find the appropriate reader method and return the value , if set
 * for the object . If the property is currently not set for the object , an
 * { @ link UnexpectedLiquibaseException } run - time exception occurs .
 * @ param object the object to examine
 * @ param propertyName the property name for which the value should be read
 * @ return the stored value */
public static Object getProperty ( Object object , String propertyName ) throws UnexpectedLiquibaseException { } }

implementation: Method readMethod = getReadMethod ( object , propertyName ) ; if ( readMethod == null ) { throw new UnexpectedLiquibaseException ( String . format ( "Property [%s] was not found for object type [%s]" , propertyName , object . getClass ( ) . getName ( ) ) ) ; } try { return readMethod . invoke ( object ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { throw new UnexpectedLiquibaseException ( e ) ; }


signature:
public class ObjectUtil { /** * Tried to determine the appropriate reader method for a given propertyName of a given object and , if found ,
 * returns the class of its return type .
 * @ param object the object to examine
 * @ param propertyName the property name whose reading method should be searched
 * @ return the class name of the return type if the reading method is found , null if it is not found . */
public static Class getPropertyType ( Object object , String propertyName ) { } }

implementation: Method readMethod = getReadMethod ( object , propertyName ) ; if ( readMethod == null ) { return null ; } return readMethod . getReturnType ( ) ;


signature:
public class ObjectUtil { /** * Examines the given object ' s class and returns true if reader and writer methods both exist for the
 * given property name .
 * @ param object the object for which the class should be examined
 * @ param propertyName the property name to search
 * @ return true if both reader and writer methods exist */
public static boolean hasProperty ( Object object , String propertyName ) { } }

implementation: return hasReadProperty ( object , propertyName ) && hasWriteProperty ( object , propertyName ) ;


signature:
public class ObjectUtil { /** * Tries to guess the " real " data type of propertyValue by the given propertyName , then sets the
 * selected property of the given object to that value .
 * @ param object the object whose property should be set
 * @ param propertyName name of the property to set
 * @ param propertyValue new value of the property , as String */
public static void setProperty ( Object object , String propertyName , String propertyValue ) { } }

implementation: Method method = getWriteMethod ( object , propertyName ) ; if ( method == null ) { throw new UnexpectedLiquibaseException ( String . format ( "Property [%s] was not found for object type [%s]" , propertyName , object . getClass ( ) . getName ( ) ) ) ; } Class < ? > parameterType = method . getParameterTypes ( ) [ 0 ] ; Object finalValue = propertyValue ; if ( parameterType . equals ( Boolean . class ) || parameterType . equals ( boolean . class ) ) { finalValue = Boolean . valueOf ( propertyValue ) ; } else if ( parameterType . equals ( Integer . class ) ) { finalValue = Integer . valueOf ( propertyValue ) ; } else if ( parameterType . equals ( Long . class ) ) { finalValue = Long . valueOf ( propertyValue ) ; } else if ( parameterType . equals ( BigInteger . class ) ) { finalValue = new BigInteger ( propertyValue ) ; } else if ( parameterType . equals ( BigDecimal . class ) ) { finalValue = new BigDecimal ( propertyValue ) ; } else if ( parameterType . equals ( DatabaseFunction . class ) ) { finalValue = new DatabaseFunction ( propertyValue ) ; } else if ( parameterType . equals ( SequenceNextValueFunction . class ) ) { finalValue = new SequenceNextValueFunction ( propertyValue ) ; } else if ( parameterType . equals ( SequenceCurrentValueFunction . class ) ) { finalValue = new SequenceCurrentValueFunction ( propertyValue ) ; } else if ( Enum . class . isAssignableFrom ( parameterType ) ) { finalValue = Enum . valueOf ( ( Class < Enum > ) parameterType , propertyValue ) ; } try { method . invoke ( object , finalValue ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { throw new UnexpectedLiquibaseException ( e ) ; } catch ( IllegalArgumentException e ) { throw new UnexpectedLiquibaseException ( "Cannot call " + method . toString ( ) + " with value of type " + finalValue . getClass ( ) . getName ( ) ) ; }


signature:
public class ObjectUtil { /** * Sets the selected property of the given object to propertyValue . A run - time exception will occur if the
 * type of value is incompatible with the reader / writer method signatures of the given propertyName .
 * @ param object the object whose property should be set
 * @ param propertyName name of the property to set
 * @ param propertyValue new value of the property */
public static void setProperty ( Object object , String propertyName , Object propertyValue ) { } }

implementation: Method method = getWriteMethod ( object , propertyName ) ; if ( method == null ) { throw new UnexpectedLiquibaseException ( String . format ( "Property [%s] was not found for object type [%s]" , propertyName , object . getClass ( ) . getName ( ) ) ) ; } try { if ( propertyValue == null ) { setProperty ( object , propertyName , null ) ; return ; } if ( ! method . getParameterTypes ( ) [ 0 ] . isAssignableFrom ( propertyValue . getClass ( ) ) ) { setProperty ( object , propertyName , propertyValue . toString ( ) ) ; return ; } method . invoke ( object , propertyValue ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { throw new UnexpectedLiquibaseException ( e ) ; } catch ( IllegalArgumentException e ) { throw new UnexpectedLiquibaseException ( "Cannot call " + method . toString ( ) + " with value of type " + ( propertyValue == null ? "null" : propertyValue . getClass ( ) . getName ( ) ) ) ; }


signature:
public class ObjectUtil { /** * Tries to find the Java method to read a given propertyName for the given object .
 * @ param object the object whose class will be examined
 * @ param propertyName the property name for which the read method should be searched
 * @ return the { @ link Method } if found , null in all other cases . */
private static Method getReadMethod ( Object object , String propertyName ) { } }

implementation: String getMethodName = "get" + propertyName . substring ( 0 , 1 ) . toUpperCase ( Locale . ENGLISH ) + propertyName . substring ( 1 ) ; String isMethodName = "is" + propertyName . substring ( 0 , 1 ) . toUpperCase ( Locale . ENGLISH ) + propertyName . substring ( 1 ) ; Method [ ] methods = getMethods ( object ) ; for ( Method method : methods ) { if ( ( method . getName ( ) . equals ( getMethodName ) || method . getName ( ) . equals ( isMethodName ) ) && ( method . getParameterTypes ( ) . length == 0 ) ) { return method ; } } return null ;


signature:
public class ObjectUtil { /** * Tries to find the Java method to write a new value for a given propertyName to the given object .
 * @ param object the object whose class will be examined
 * @ param propertyName the property name for which the write method is to be searched
 * @ return the { @ link Method } if found , null in all other cases . */
private static Method getWriteMethod ( Object object , String propertyName ) { } }

implementation: String methodName = "set" + propertyName . substring ( 0 , 1 ) . toUpperCase ( Locale . ENGLISH ) + propertyName . substring ( 1 ) ; Method [ ] methods = getMethods ( object ) ; for ( Method method : methods ) { if ( method . getName ( ) . equals ( methodName ) && ( method . getParameterTypes ( ) . length == 1 ) ) { return method ; } } return null ;


signature:
public class ObjectUtil { /** * Determines the class of a given object and returns an array of that class ' s methods . The information might come
 * from a cache .
 * @ param object the object to examine
 * @ return a list of methods belonging to the class of the object */
private static Method [ ] getMethods ( Object object ) { } }

implementation: Method [ ] methods = methodCache . get ( object . getClass ( ) ) ; if ( methods == null ) { methods = object . getClass ( ) . getMethods ( ) ; methodCache . put ( object . getClass ( ) , methods ) ; } return methods ;


signature:
public class ObjectUtil { /** * Converts the given object to the targetClass */
public static < T > T convert ( Object object , Class < T > targetClass ) throws IllegalArgumentException { } }

implementation:
if ( object == null ) { return null ; } if ( targetClass . isAssignableFrom ( object . getClass ( ) ) ) { return ( T ) object ; } try { if ( Enum . class . isAssignableFrom ( targetClass ) ) { return ( T ) Enum . valueOf ( ( Class < Enum > ) targetClass , object . toString ( ) ) ; } else if ( Number . class . isAssignableFrom ( targetClass ) ) { if ( object instanceof Number ) { Number number = ( Number ) object ; String numberAsString = number . toString ( ) ; numberAsString = numberAsString . replaceFirst ( "\\.0+$" , "" ) ; // remove zero decimal so int / long / etc . can parse it correctly .
if ( targetClass . equals ( Byte . class ) ) { long value = Long . valueOf ( numberAsString ) ; if ( value < Byte . MIN_VALUE || value > Byte . MAX_VALUE ) { raiseOverflowException ( number , targetClass ) ; } return ( T ) ( Byte ) number . byteValue ( ) ; } else if ( targetClass . equals ( Short . class ) ) { long value = Long . valueOf ( numberAsString ) ; if ( value < Short . MIN_VALUE || value > Short . MAX_VALUE ) { raiseOverflowException ( number , targetClass ) ; } return ( T ) ( Short ) number . shortValue ( ) ; } else if ( targetClass . equals ( Integer . class ) ) { long value = Long . valueOf ( numberAsString ) ; if ( value < Integer . MIN_VALUE || value > Integer . MAX_VALUE ) { raiseOverflowException ( number , targetClass ) ; } return ( T ) ( Integer ) number . intValue ( ) ; } else if ( targetClass . equals ( Long . class ) ) { return ( T ) Long . valueOf ( numberAsString ) ; } else if ( targetClass . equals ( Float . class ) ) { return ( T ) ( Float ) number . floatValue ( ) ; } else if ( targetClass . equals ( Double . class ) ) { return ( T ) ( Double ) number . doubleValue ( ) ; } else if ( targetClass . equals ( BigInteger . class ) ) { return ( T ) new BigInteger ( numberAsString ) ; } else if ( targetClass . equals ( BigDecimal . class ) ) { // using BigDecimal ( String ) here , to avoid unpredictability of BigDecimal ( double )
// ( see BigDecimal javadoc for details )
return ( T ) new BigDecimal ( numberAsString ) ; } else { return raiseUnknownConversionException ( object , targetClass ) ; } } else if ( object instanceof String ) { String string = ( String ) object ; if ( string . contains ( "." ) ) { string = string . replaceFirst ( "\\.0+$" , "" ) ; } if ( string . equals ( "" ) ) { string = "0" ; } if ( targetClass . equals ( Byte . class ) ) { return ( T ) Byte . decode ( string ) ; } else if ( targetClass . equals ( Short . class ) ) { return ( T ) Short . decode ( string ) ; } else if ( targetClass . equals ( Integer . class ) ) { return ( T ) Integer . decode ( string ) ; } else if ( targetClass . equals ( Long . class ) ) { return ( T ) Long . decode ( string ) ; } else if ( targetClass . equals ( Float . class ) ) { return ( T ) Float . valueOf ( string ) ; } else if ( targetClass . equals ( Double . class ) ) { return ( T ) Double . valueOf ( string ) ; } else if ( targetClass . equals ( BigInteger . class ) ) { return ( T ) new BigInteger ( string ) ; } else if ( targetClass . equals ( BigDecimal . class ) ) { return ( T ) new BigDecimal ( string ) ; } else { return raiseUnknownConversionException ( object , targetClass ) ; } } else { return raiseUnknownConversionException ( object , targetClass ) ; } } else if ( targetClass . isAssignableFrom ( Boolean . class ) ) { String lowerCase = object . toString ( ) . toLowerCase ( ) ; return ( T ) ( Boolean ) ( lowerCase . equals ( "true" ) || lowerCase . equals ( "t" ) || lowerCase . equals ( "1" ) || lowerCase . equals ( "1.0" ) || lowerCase . equals ( "yes" ) ) ; } else if ( targetClass . isAssignableFrom ( String . class ) ) { return ( T ) object . toString ( ) ; } else if ( targetClass . isAssignableFrom ( List . class ) ) { if ( object instanceof List ) { return ( T ) object ; } else if ( object instanceof Collection ) { return ( T ) new ArrayList ( ( Collection ) object ) ; } else if ( object instanceof Object [ ] ) { return ( T ) new ArrayList ( Arrays . asList ( ( Object [ ] ) object ) ) ; } else { return ( T ) object ; } } else if ( targetClass . isAssignableFrom ( StringClauses . class ) ) { return ( T ) new StringClauses ( ) . append ( object . toString ( ) ) ; } else if ( targetClass . isAssignableFrom ( Class . class ) ) { try { return ( T ) Class . forName ( object . toString ( ) ) ; } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException ( e ) ; } } return ( T ) object ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( e ) ; }


signature:
public class ObjectDifferences { /** * Sometimes an attribute in one object is a single - entity collection and on the other it is just the object .
 * Check the passed potentialCollection and if it is a single - entry collection of the same type as the otherObject , return just the collection element .
 * Otherwise , return the original collection . */
protected Object undoCollection ( Object potentialCollection , Object otherObject ) { } }

implementation: if ( ( potentialCollection != null ) && ( otherObject != null ) && ( potentialCollection instanceof Collection ) && ! ( otherObject instanceof Collection ) ) { if ( ( ( ( Collection ) potentialCollection ) . size ( ) == 1 ) && ( ( Collection ) potentialCollection ) . iterator ( ) . next ( ) . getClass ( ) . equals ( otherObject . getClass ( ) ) ) { potentialCollection = ( ( Collection ) potentialCollection ) . iterator ( ) . next ( ) ; } } return potentialCollection ;


signature:
public class Table { /** * Returns the list of all outgoing FOREIGN KEYS from this table */
public List < ForeignKey > getOutgoingForeignKeys ( ) { } }

implementation: List < ForeignKey > fkList = getAttribute ( "outgoingForeignKeys" , List . class ) ; return ( ( fkList == null ) ? new ArrayList < ForeignKey > ( 0 ) : fkList ) ;


signature:
public class SchemesCDIConfigBuilder { /** * API method . */
public CDILiquibaseConfig createCDILiquibaseConfig ( ) { } }

implementation: final String id = UUID . randomUUID ( ) . toString ( ) ; log . fine ( LogType . LOG , String . format ( "[id = %s] createConfig(). Date: '%s'" , id , new Date ( ) ) ) ; final InputStream is = SchemesCDIConfigBuilder . class . getResourceAsStream ( SCHEMA_NAME ) ; try { return jvmLocked ( id , new Callable < CDILiquibaseConfig > ( ) { public CDILiquibaseConfig call ( ) throws Exception { return createCDILiquibaseConfig ( id , is ) ; } } ) ; } catch ( Exception ex ) { log . warning ( LogType . LOG , String . format ( "[id = %s] Unable to initialize liquibase where '%s'." , id , ex . getMessage ( ) ) , ex ) ; return null ; } finally { try { is . close ( ) ; } catch ( IOException ioe ) { log . warning ( LogType . LOG , String . format ( "[id = %s] IOException during closing an input stream '%s'." , id , ioe . getMessage ( ) ) , ioe ) ; } }