File path: /jabref-2.10/src/java/net/sf/jabref/BasePanel.java | File path: /jabref-2.10/src/java/net/sf/jabref/external/PushToApplicationAction.java | |||
Method name: String getKeysForSelection()
|
Method name: String getKeyString(BibtexEntry[])
|
|||
Number of AST nodes: 8 | Number of AST nodes: 9 | |||
1 | /** | 1 | protected String getKeyString(BibtexEntry[] entries) { | |
2 | * Get a String containing a comma-separated list of the bibtex keys | 2 | StringBuffer result = new StringBuffer(); | |
3 | * of the selected entries. | 3 | String citeKey = "";//, message = ""; | |
4 | * | 4 | boolean first = true; | |
5 | * @return A comma-separated list of the keys of the selected entries. | 5 | for (int i=0; i<entries.length; i++) { | |
6 | */ | 6 | BibtexEntry bes = entries[i]; | |
7 | public String getKeysForSelection() { | 7 | citeKey = bes.getField(BibtexFields.KEY_FIELD); | |
8 | StringBuffer result = new StringBuffer(); | 8 | // if the key is empty we give a warning and ignore this entry | |
9 | String citeKey = "";//, message = ""; | 9 | if (citeKey == null || citeKey.equals("")) | |
10 | boolean first = true; | 10 | continue; | |
11 | for (BibtexEntry bes : mainTable.getSelected()){ | 11 | if (first) { | |
12 | citeKey = bes.getField(BibtexFields.KEY_FIELD); | 12 | result.append(citeKey); | |
13 | // if the key is empty we give a warning and ignore this entry | 13 | first = false; | |
14 | if (citeKey == null || citeKey.equals("")) | 14 | } else { | |
15 | continue; | 15 | result.append(",").append(citeKey); | |
16 | if (first) { | 16 | } | |
17 | result.append(citeKey); | 17 | } | |
18 | first = false; | 18 | return result.toString(); | |
19 | } else { | 19 | } | |
20 | result.append(",").append(citeKey); | |||
21 | } | |||
22 | } | |||
23 | return result.toString(); | |||
24 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 9 |
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 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (BibtexEntry bes : mainTable.getSelected()) |
| 4 | for (int i = 0; i < entries.length; i++) | |||||||||||||||
|
| 5 | BibtexEntry bes = entries[i]; | ||||||||||||||||
5 | citeKey = bes.getField(BibtexFields.KEY_FIELD); | 6 | citeKey = bes.getField(BibtexFields.KEY_FIELD); | ||||||||||||||||
6 | if (citeKey == null || citeKey.equals("")) | 7 | if (citeKey == null || citeKey.equals("")) | ||||||||||||||||
7 | continue; | 8 | continue; | ||||||||||||||||
8 | if (first) | 9 | if (first) | ||||||||||||||||
9 | result.append(citeKey); | 10 | result.append(citeKey); | ||||||||||||||||
10 | first = false; | 11 | first = false; | ||||||||||||||||
else | else | ||||||||||||||||||
11 | result.append(",").append(citeKey); | 12 | result.append(",").append(citeKey); |
Row | Violation |
---|---|
1 | Type ca.odell.glazedlists.EventList<net.sf.jabref.BibtexEntry> of variable mainTable.getSelected() does not match with type net.sf.jabref.BibtexEntry[] of variable entries |
2 | Type ca.odell.glazedlists.EventList<net.sf.jabref.BibtexEntry> of variable mainTable.getSelected() does not match with type net.sf.jabref.BibtexEntry[] of variable entries |
3 | Type ca.odell.glazedlists.EventList<net.sf.jabref.BibtexEntry> of variable mainTable.getSelected() does not match with type net.sf.jabref.BibtexEntry[] of variable entries |