File path: /jabref-2.10/src/java/net/sf/jabref/BasePanel.java | File path: /jabref-2.10/src/java/net/sf/jabref/BasePanel.java | |||
Method name: void addJournalListToAutoCompleter()
|
Method name: void addContentSelectorValuesToAutoCompleters()
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | /** | 1 | /** | |
2 | * If an autocompleter exists for the "journal" field, add all | 2 | * For all fields with both autocompletion and content selector, add content selector | |
3 | * journal names in the journal abbreviation list to this autocompleter. | 3 | * values to the autocompleter list: | |
4 | */ | 4 | */ | |
5 | public void addJournalListToAutoCompleter() { | 5 | public void addContentSelectorValuesToAutoCompleters() { | |
6 | if (autoCompleters.containsKey("journal")) { | 6 | for (String field : autoCompleters.keySet()) { | |
7 | AbstractAutoCompleter ac = autoCompleters.get("journal"); | 7 | AbstractAutoCompleter ac = autoCompleters.get(field); | |
8 | Set<String> journals = Globals.journalAbbrev.getJournals().keySet(); | 8 | if (metaData.getData(Globals.SELECTOR_META_PREFIX + field) != null) { | |
9 | for (String journal : journals) | 9 | Vector<String> items = metaData.getData(Globals.SELECTOR_META_PREFIX + field); | |
10 | ac.addWordToIndex(journal); | 10 | if (items != null) { | |
11 | } | 11 | Iterator<String> i = items.iterator(); | |
12 | 12 | while (i.hasNext()) | ||
13 | 13 | ac.addWordToIndex(i.next()); | ||
14 | } | 14 | } | |
15 | } | |||
16 | } | |||
17 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 3 |
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.500 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (String journal : journals) |
| 7 | while (i.hasNext()) | |||||||||||
5 | ac.addWordToIndex(journal); |
| 8 | ac.addWordToIndex(i.next()); |
Row | Violation |
---|---|
1 | Type java.util.Set<java.lang.String> of variable journals does not match with type java.util.Vector<java.lang.String> of variable items |
2 | Expression journal cannot be parameterized, because it has dependencies to/from statements that will be extracted |