File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/sql/constraint/TableConstraints.java | File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/sql/constraint/TableConstraints.java | |||
Method name: List
|
Method name: List
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | ArrayList<ForeignKeyConstraint> results = ↵ | 1 | ArrayList<CheckConstraint> results = ↵ | |
2 | new ArrayList<ForeignKeyConstraint>();↵ | 2 | new ArrayList<CheckConstraint>();↵ | |
3 | for (int i = 0; i < _constraints.size(); i++) {↵ | 3 | for (int i = 0; i < _constraints.size(); i++) {↵ | |
4 | MssqlConstraint constraint = _constraints.get(i);↵ | 4 | MssqlConstraint constraint = _constraints.get(i);↵ | |
5 | if (constraint instanceof ForeignKeyConstraint) {↵ | 5 | if (constraint instanceof CheckConstraint) {↵ | |
6 | results.add((ForeignKeyConstraint)constraint);↵ | 6 | results.add((CheckConstraint)constraint);↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return results; | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 6 |
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) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ArrayList<ForeignKeyConstraint> results = new ArrayList<ForeignKeyConstraint>(); |
| 1 | ArrayList<CheckConstraint> results = new ArrayList<CheckConstraint>(); | |||||||||||||
2 | for (int i = 0; i < _constraints.size(); i++) | 2 | for (int i = 0; i < _constraints.size(); i++) | ||||||||||||||
3 | MssqlConstraint constraint = _constraints.get(i); | 3 | MssqlConstraint constraint = _constraints.get(i); | ||||||||||||||
4 | if (constraint instanceof ForeignKeyConstraint) |
| 4 | if (constraint instanceof CheckConstraint) | |||||||||||||
5 | results.add((ForeignKeyConstraint)constraint); |
| 5 | results.add((CheckConstraint)constraint); | |||||||||||||
6 | return results; | 6 | return results; |
Row | Violation |
---|---|
1 | Expression constraint instanceof ForeignKeyConstraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression constraint instanceof CheckConstraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression (ForeignKeyConstraint)constraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression (CheckConstraint)constraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression (ForeignKeyConstraint)constraint cannot be unified with expression (CheckConstraint)constraint , because common superclass type net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.MssqlConstraint cannot be passed as an argument to public boolean add(net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.ForeignKeyConstraint) |