1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.refactoring.internal.job

File RenameJob.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
5
4
1
67
33
5
1
1.25
4
1.25

Classes

Class Line # Actions
RenameJob 38 5 0% 5 0
1.0100%
 

Contributing tests

This file is covered by 6 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.refactoring.internal.job;
21   
22    import java.util.Collection;
23   
24    import javax.inject.Named;
25   
26    import org.xwiki.component.annotation.Component;
27    import org.xwiki.model.reference.EntityReference;
28    import org.xwiki.refactoring.job.RefactoringJobs;
29   
30    /**
31    * A job that can rename entities.
32    *
33    * @version $Id: 881f002f28c8abf25e427e5e8a117c7d364f86e5 $
34    * @since 7.2M1
35    */
36    @Component
37    @Named(RefactoringJobs.RENAME)
 
38    public class RenameJob extends MoveJob
39    {
 
40  72 toggle @Override
41    public String getType()
42    {
43  72 return RefactoringJobs.RENAME;
44    }
45   
 
46  41 toggle @Override
47    protected boolean isDeleteSources()
48    {
49    // rename always delete original sources
50  41 return true;
51    }
52   
 
53  12 toggle @Override
54    protected void process(Collection<EntityReference> entityReferences)
55    {
56  12 if (entityReferences.size() == 1) {
57  11 process(entityReferences.iterator().next());
58    }
59    }
60   
 
61  21 toggle @Override
62    protected boolean processOnlySameSourceDestinationTypes()
63    {
64    // rename always process same destination types
65  21 return true;
66    }
67    }