CPD Results
The following document contains the results of PMD's CPD 5.3.5.
Duplications
File |
Line |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderDAO.java |
111 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderDAO.java |
262 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_ALL, plugin );
daoUtil.executeQuery( );
List<IFolder> listFolders = new ArrayList<IFolder>( );
while ( daoUtil.next( ) )
{
int nIndex = 1;
IFolder folder = null;
boolean bException = false;
try
{
folder = (IFolder) Class.forName( daoUtil.getString( nIndex++ ) ).newInstance( );
}
catch ( ClassNotFoundException e )
{
// class doesn't exist
AppLogService.error( e );
bException = true;
}
catch ( InstantiationException e )
{
// Class is abstract or is an interface or haven't accessible
// builder
AppLogService.error( e );
bException = true;
}
catch ( IllegalAccessException e )
{
// can't access to rhe class
AppLogService.error( e );
bException = true;
}
if ( bException )
{
daoUtil.free( );
return null;
}
folder.setIdFolder( daoUtil.getInt( nIndex++ ) );
folder.setLabel( daoUtil.getString( nIndex++ ) );
folder.setUrlIcon( daoUtil.getString( nIndex++ ) );
folder.setUserGuid( daoUtil.getString( nIndex++ ) );
listFolders.add( folder );
}
daoUtil.free( );
return listFolders;
} |
File |
Line |
fr/paris/lutece/plugins/mylutece/modules/notification/business/NotificationDAO.java |
201 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/NotificationDAO.java |
243 |
DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ), plugin );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
int nIndex = 1;
Notification notification = new Notification( );
notification.setIdNotification( daoUtil.getInt( nIndex++ ) );
notification.setIdFolder( daoUtil.getInt( nIndex++ ) );
notification.setIsRead( daoUtil.getBoolean( nIndex++ ) );
notification.setSender( daoUtil.getString( nIndex++ ) );
notification.setUserGuidReceiver( daoUtil.getString( nIndex++ ) );
notification.setObject( daoUtil.getString( nIndex++ ) );
notification.setMessage( daoUtil.getString( nIndex++ ) );
notification.setDateCreation( daoUtil.getTimestamp( nIndex++ ) );
listNotifications.add( notification );
}
daoUtil.free( );
return listNotifications;
}
/**
* {@inheritDoc}
*/
public List<Notification> selectNotificationsByFilter( NotificationFilter nFilter, Plugin plugin ) |
File |
Line |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderDAO.java |
120 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderDAO.java |
179 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderDAO.java |
271 |
boolean bException = false;
try
{
folder = (IFolder) Class.forName( daoUtil.getString( nIndex++ ) ).newInstance( );
}
catch ( ClassNotFoundException e )
{
// class doesn't exist
AppLogService.error( e );
bException = true;
}
catch ( InstantiationException e )
{
// Class is abstract or is an interface or haven't accessible
// builder
AppLogService.error( e );
bException = true;
}
catch ( IllegalAccessException e )
{
// can't access to rhe class
AppLogService.error( e );
bException = true;
}
if ( bException )
{
daoUtil.free( );
return null;
}
folder.setIdFolder( daoUtil.getInt( nIndex++ ) );
folder.setLabel( daoUtil.getString( nIndex++ ) );
folder.setUrlIcon( daoUtil.getString( nIndex++ ) );
folder.setUserGuid( daoUtil.getString( nIndex++ ) ); |
File |
Line |
fr/paris/lutece/plugins/mylutece/modules/notification/business/NotificationDAO.java |
141 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/NotificationDAO.java |
207 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/NotificationDAO.java |
249 |
notification = new Notification( );
notification.setIdNotification( daoUtil.getInt( nIndex++ ) );
notification.setIdFolder( daoUtil.getInt( nIndex++ ) );
notification.setIsRead( daoUtil.getBoolean( nIndex++ ) );
notification.setSender( daoUtil.getString( nIndex++ ) );
notification.setUserGuidReceiver( daoUtil.getString( nIndex++ ) );
notification.setObject( daoUtil.getString( nIndex++ ) );
notification.setMessage( daoUtil.getString( nIndex++ ) );
notification.setDateCreation( daoUtil.getTimestamp( nIndex++ ) ); |
File |
Line |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderArchive.java |
56 |
fr/paris/lutece/plugins/mylutece/modules/notification/business/folder/FolderInbox.java |
56 |
public static int getId( )
{
return ID_FOLDER;
}
/**
* {@inheritDoc}
*/
public boolean isEditable( )
{
return false;
}
/**
* {@inheritDoc}
*/
public void setFolderType( Locale locale )
{
FolderType folderType = new FolderType( );
folderType.setClassName( this.getClass( ).getName( ) );
folderType.setLocale( locale );
folderType.setLabelKey( PROPERTY_FOLDER_TYPE_LABEL_KEY );
setFolderType( folderType );
}
/**
* {@inheritDoc}
*/
public String getLabel( )
{
return getFolderType( ).getLabel( );
}
/**
* {@inheritDoc}
*/
public String getUserGuid( )
{
return StringUtils.EMPTY;
}
/**
* {@inheritDoc}
*/
public String getImgFolder( )
{
return IMG_FOLDER;
}
} |