1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.diff.internal

File DefaultMergeResult.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
64% of files have more coverage

Code metrics

0
10
7
1
112
48
7
0.7
1.43
7
1

Classes

Class Line # Actions
DefaultMergeResult 33 10 0% 7 6
0.6470588464.7%
 

Contributing tests

This file is covered by 30 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.diff.internal;
21   
22    import java.util.List;
23   
24    import org.xwiki.diff.MergeResult;
25    import org.xwiki.logging.LogQueue;
26   
27    /**
28    * Default implementation of {@link MergeResult}.
29    *
30    * @param <E> the type of compared elements
31    * @version $Id: 54c1fb54421e952040127d294e4a803b234720a6 $
32    */
 
33    public class DefaultMergeResult<E> implements MergeResult<E>
34    {
35    /**
36    * @see #getCommonAncestor()
37    */
38    private List<E> commonAncestor;
39   
40    /**
41    * @see #getNext()
42    */
43    private List<E> next;
44   
45    /**
46    * @see #getCurrent()
47    */
48    private List<E> current;
49   
50    /**
51    * @see #getMerged()
52    */
53    private List<E> merged;
54   
55    /**
56    * @see #getLog()
57    */
58    private LogQueue log = new LogQueue();
59   
60    /**
61    * @param commonAncestor the common ancestor
62    * @param next the new version
63    * @param current the current version
64    */
 
65  198 toggle public DefaultMergeResult(List<E> commonAncestor, List<E> next, List<E> current)
66    {
67  198 this.commonAncestor = commonAncestor;
68  198 this.next = next;
69  198 this.current = current;
70   
71    // Default to current
72  198 this.merged = current;
73    }
74   
 
75  0 toggle @Override
76    public List<E> getCommonAncestor()
77    {
78  0 return this.commonAncestor;
79    }
80   
 
81  0 toggle @Override
82    public List<E> getNext()
83    {
84  0 return this.next;
85    }
86   
 
87  0 toggle @Override
88    public List<E> getCurrent()
89    {
90  0 return this.current;
91    }
92   
 
93  450 toggle @Override
94    public LogQueue getLog()
95    {
96  450 return this.log;
97    }
98   
 
99  199 toggle @Override
100    public List<E> getMerged()
101    {
102  199 return this.merged;
103    }
104   
105    /**
106    * @param merged the merged version
107    */
 
108  58 toggle public void setMerged(List<E> merged)
109    {
110  58 this.merged = merged;
111    }
112    }