File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java | |||
Method name: ListSet computeOffenders(Object)
|
Method name: ListSet computeOffenders(Object)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | /** | 1 | /** | |
2 | * @param ps the design material | 2 | * @param ps the object to check | |
3 | * @return the offenders | 3 | * @return the list of offenders | |
4 | */ | 4 | */ | |
5 | protected ListSet computeOffenders(Object ps) { | 5 | protected ListSet computeOffenders(Object ps) { | |
6 | ListSet offs = new ListSet(ps); | 6 | ListSet offs = new ListSet(ps); | |
7 | Object cs = Model.getFacade().getContainer(ps); | 7 | Object cs = Model.getFacade().getContainer(ps); | |
8 | if (cs == null) { | 8 | if (cs == null) { | |
9 | LOG.debug("null parent in still valid"); | 9 | LOG.debug("null parent in still valid"); | |
10 | return offs; | 10 | return offs; | |
11 | } | 11 | } | |
12 | Collection peers = Model.getFacade().getSubvertices(cs); | 12 | ||
13 | for (Iterator iter = peers.iterator(); iter.hasNext();) { | 13 | Collection peers = Model.getFacade().getSubvertices(cs); | |
14 | Object sv = iter.next(); | 14 | for (Object sv : peers) { | |
15 | if (Model.getFacade().isAPseudostate(sv) | 15 | if (Model.getFacade().isAPseudostate(sv) | |
16 | && Model.getFacade().equalsPseudostateKind( | 16 | && Model.getFacade().equalsPseudostateKind( | |
17 | Model.getFacade().getKind(sv), | 17 | Model.getFacade().getKind(sv), | |
18 | Model.getPseudostateKind().getDeepHistory())) { | 18 | Model.getPseudostateKind().getInitial())) { | |
19 | offs.add(sv); | 19 | offs.add(sv); | |
20 | } | 20 | } | |
21 | } | 21 | } | |
22 | return offs; | 22 | ||
23 | } | 23 | return offs; | |
24 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.818 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | for (Iterator iter = peers.iterator(); iter.hasNext(); ) | 7 | for (Object sv : peers) | |||||||||||
8 | Object sv = iter.next(); | | ||||||||||||
9 | if (Model.getFacade().isAPseudostate(sv) && Model.getFacade().equalsPseudostateKind(Model.getFacade().getKind(sv), Model.getPseudostateKind().getDeepHistory())) |
| 8 | if (Model.getFacade().isAPseudostate(sv) && Model.getFacade().equalsPseudostateKind(Model.getFacade().getKind(sv), Model.getPseudostateKind().getInitial())) | ||||||||||
10 | offs.add(sv); | 9 | offs.add(sv); |
Row | Violation |
---|