CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
288 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
318 |
daoUtil.setString( 3 , strActionName );
daoUtil.executeQuery( );
TemporaryCode temporaryCode = null;
if ( daoUtil.next( ) )
{
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( temporaryCode );
}
}
@Override
public Optional<TemporaryCode> loadByCodeAndActionName( String strCode, String strActionName, Plugin plugin ) |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
317 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
347 |
daoUtil.setString( 1 , strCode );
daoUtil.setString( 2 , strActionName );
daoUtil.executeQuery( );
TemporaryCode temporaryCode = null;
if ( daoUtil.next( ) )
{
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( temporaryCode );
}
} |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
98 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
288 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
318 |
daoUtil.setInt( 1 , nKey );
daoUtil.executeQuery( );
TemporaryCode temporaryCode = null;
if ( daoUtil.next( ) )
{
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( temporaryCode );
}
}
/**
* {@inheritDoc }
*/
@Override
public void delete( int nKey, Plugin plugin ) |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
288 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
348 |
daoUtil.setString( 3 , strActionName );
daoUtil.executeQuery( );
TemporaryCode temporaryCode = null;
if ( daoUtil.next( ) )
{
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( temporaryCode );
}
} |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
98 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
348 |
daoUtil.setInt( 1 , nKey );
daoUtil.executeQuery( );
TemporaryCode temporaryCode = null;
if ( daoUtil.next( ) )
{
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( temporaryCode );
}
} |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
166 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
255 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
TemporaryCode temporaryCode = new TemporaryCode( );
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) );
temporaryCodeList.add( temporaryCode );
} |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeConfigDAO.java |
221 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
234 |
List<TemporaryCodeConfig> temporaryCodeConfigList = new ArrayList<>( );
StringBuilder builder = new StringBuilder( );
if ( !listIds.isEmpty( ) )
{
for( int i = 0 ; i < listIds.size(); i++ ) {
builder.append( "?," );
}
String placeHolders = builder.deleteCharAt( builder.length( ) -1 ).toString( );
String stmt = SQL_QUERY_SELECTALL_BY_IDS + placeHolders + ")";
try ( DAOUtil daoUtil = new DAOUtil( stmt, plugin ) )
{
int index = 1;
for( Integer n : listIds ) {
daoUtil.setInt( index++, n );
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{ |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
104 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
170 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
258 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
295 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
325 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
355 |
temporaryCode = new TemporaryCode();
int nIndex = 1;
temporaryCode.setId( daoUtil.getInt( nIndex++ ) );
temporaryCode.setUserId( daoUtil.getString( nIndex++ ) );
temporaryCode.setCode( daoUtil.getString( nIndex++ ) );
temporaryCode.setActionName( daoUtil.getString( nIndex++ ) );
temporaryCode.setCreatedDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setValidityDate( daoUtil.getTimestamp( nIndex++ ) );
temporaryCode.setUsed( daoUtil.getBoolean( nIndex++ ) );
temporaryCode.setComplementaryInfo( daoUtil.getString( nIndex ) ); |
File |
Line |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
70 |
fr/paris/lutece/plugins/temporarycode/business/TemporaryCodeDAO.java |
140 |
try( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, plugin ) )
{
int nIndex = 1;
daoUtil.setString( nIndex++ , temporaryCode.getUserId( ) );
daoUtil.setString( nIndex++ , temporaryCode.getCode( ) );
daoUtil.setString( nIndex++ , temporaryCode.getActionName( ) );
daoUtil.setTimestamp( nIndex++ , temporaryCode.getCreatedDate( ) );
daoUtil.setTimestamp( nIndex++ , temporaryCode.getValidityDate( ) );
daoUtil.setBoolean( nIndex++ , temporaryCode.getUsed( ) );
daoUtil.setString( nIndex++ , temporaryCode.getComplementaryInfo() );
daoUtil.executeUpdate( ); |