File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java | |||
Method name: JMenu makeLanguageMenu()
|
Method name: JMenu makeLanguageMenu()
|
|||
Number of AST nodes: 48 | Number of AST nodes: 43 | |||
1 | JMenu languageMenu = new JMenu(JMeterUtils.getResString("choose_language")); //$NON-NLS-1$↵ | 1 | JMenu languageMenu = new JMenu(JMeterUtils.getResString("choose_language"));↵ | |
2 | languageMenu.setMnemonic('C');↵ | 2 | languageMenu.setMnemonic('C');↵ | |
3 | // add english↵ | 3 | // add english↵ | |
4 | JMenuItem english = new JMenuItem(JMeterUtils.getResString("en"), 'E'); //$NON-NLS-1$↵ | 4 | JMenuItem english = new JMenuItem(JMeterUtils.getResString("en"), 'E');↵ | |
5 | english.addActionListener(ActionRouter.getInstance());↵ | 5 | english.addActionListener(ReportActionRouter.getInstance());↵ | |
6 | english.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 6 | english.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
7 | english.setName(Locale.ENGLISH.getLanguage());↵ | 7 | english.setName(Locale.ENGLISH.getLanguage());↵ | |
8 | languageMenu.add(english);↵ | 8 | languageMenu.add(english);↵ | |
9 | // add Japanese↵ | 9 | // add Japanese↵ | |
10 | JMenuItem japanese = new JMenuItem(JMeterUtils.getResString("jp"), 'J'); //$NON-NLS-1$↵ | 10 | JMenuItem japanese = new JMenuItem(JMeterUtils.getResString("jp"), 'J');↵ | |
11 | japanese.addActionListener(ActionRouter.getInstance());↵ | 11 | japanese.addActionListener(ReportActionRouter.getInstance());↵ | |
12 | japanese.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 12 | japanese.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
13 | japanese.setName(Locale.JAPANESE.getLanguage());↵ | 13 | japanese.setName(Locale.JAPANESE.getLanguage());↵ | |
14 | languageMenu.add(japanese);↵ | 14 | languageMenu.add(japanese);↵ | |
15 | // add Norwegian↵ | 15 | // add Norwegian↵ | |
16 | JMenuItem norway = new JMenuItem(JMeterUtils.getResString("no"), 'N'); //$NON-NLS-1$↵ | 16 | JMenuItem norway = new JMenuItem(JMeterUtils.getResString("no"), 'N');↵ | |
17 | norway.addActionListener(ActionRouter.getInstance());↵ | 17 | norway.addActionListener(ReportActionRouter.getInstance());↵ | |
18 | norway.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 18 | norway.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
19 | norway.setName("no"); // No default for Norwegian↵ | 19 | norway.setName("no"); // No default for Norwegian↵ | |
20 | languageMenu.add(norway);↵ | 20 | languageMenu.add(norway);↵ | |
21 | // add German↵ | 21 | // add German↵ | |
22 | JMenuItem german = new JMenuItem(JMeterUtils.getResString("de"), 'G'); //$NON-NLS-1$↵ | 22 | JMenuItem german = new JMenuItem(JMeterUtils.getResString("de"), 'G');↵ | |
23 | german.addActionListener(ActionRouter.getInstance());↵ | 23 | german.addActionListener(ReportActionRouter.getInstance());↵ | |
24 | german.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 24 | german.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
25 | german.setName(Locale.GERMAN.getLanguage());↵ | 25 | german.setName(Locale.GERMAN.getLanguage());↵ | |
26 | languageMenu.add(german);↵ | 26 | languageMenu.add(german);↵ | |
27 | // add French↵ | 27 | // add French↵ | |
28 | JMenuItem french = new JMenuItem(JMeterUtils.getResString("fr"), 'F'); //$NON-NLS-1$↵ | 28 | JMenuItem french = new JMenuItem(JMeterUtils.getResString("fr"), 'F');↵ | |
29 | french.addActionListener(ActionRouter.getInstance());↵ | 29 | french.addActionListener(ReportActionRouter.getInstance());↵ | |
30 | french.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 30 | french.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
31 | french.setName(Locale.FRENCH.getLanguage());↵ | 31 | french.setName(Locale.FRENCH.getLanguage());↵ | |
32 | languageMenu.add(french);↵ | 32 | languageMenu.add(french);↵ | |
33 | // add chinese (simple)↵ | 33 | // add chinese (simple)↵ | |
34 | JMenuItem chineseSimple = new JMenuItem(JMeterUtils.getResString("zh_cn")); //$NON-NLS-1$↵ | 34 | JMenuItem chineseSimple = new JMenuItem(JMeterUtils.getResString("zh_cn"));↵ | |
35 | chineseSimple.addActionListener(ActionRouter.getInstance());↵ | 35 | chineseSimple.addActionListener(ReportActionRouter.getInstance());↵ | |
36 | chineseSimple.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 36 | chineseSimple.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
37 | chineseSimple.setName(Locale.SIMPLIFIED_CHINESE.toString());↵ | 37 | chineseSimple.setName(Locale.SIMPLIFIED_CHINESE.toString());↵ | |
38 | languageMenu.add(chineseSimple);↵ | 38 | languageMenu.add(chineseSimple);↵ | |
39 | // add chinese (traditional)↵ | 39 | // add chinese (traditional)↵ | |
40 | JMenuItem chineseTrad = new JMenuItem(JMeterUtils.getResString("zh_tw")); //$NON-NLS-1$↵ | 40 | JMenuItem chineseTrad = new JMenuItem(JMeterUtils.getResString("zh_TW"));↵ | |
41 | chineseTrad.addActionListener(ActionRouter.getInstance());↵ | 41 | chineseTrad.addActionListener(ReportActionRouter.getInstance());↵ | |
42 | chineseTrad.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 42 | chineseTrad.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
43 | chineseTrad.setName(Locale.TRADITIONAL_CHINESE.toString());↵ | 43 | chineseTrad.setName(Locale.TRADITIONAL_CHINESE.toString());↵ | |
44 | languageMenu.add(chineseTrad);↵ | 44 | languageMenu.add(chineseTrad);↵ | |
45 | // add spanish↵ | 45 | // add spanish↵ | |
46 | JMenuItem spanish = new JMenuItem(JMeterUtils.getResString("es")); //$NON-NLS-1$↵ | 46 | JMenuItem spanish = new JMenuItem(JMeterUtils.getResString("es"));↵ | |
47 | spanish.addActionListener(ActionRouter.getInstance());↵ | 47 | spanish.addActionListener(ReportActionRouter.getInstance());↵ | |
48 | spanish.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | 48 | spanish.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |
49 | spanish.setName("es"); //$NON-NLS-1$↵ | 49 | spanish.setName("es");↵ | |
50 | languageMenu.add(spanish);↵ | 50 | languageMenu.add(spanish);↵ | |
51 | // add turkish↵ | 51 | ↵ | |
52 | JMenuItem turkish = new JMenuItem(JMeterUtils.getResString("tr")); //$NON-NLS-1$↵ | |||
53 | turkish.addActionListener(ActionRouter.getInstance());↵ | |||
54 | turkish.setActionCommand(ActionNames.CHANGE_LANGUAGE);↵ | |||
55 | turkish.setName("tr"); //$NON-NLS-1$↵ | |||
56 | languageMenu.add(turkish);↵ | |||
57 | return languageMenu; | 52 |
| |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 824 |
Number of mapped statements | 43 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | JMenu languageMenu = new JMenu(JMeterUtils.getResString("choose_language")); | 1 | JMenu languageMenu = new JMenu(JMeterUtils.getResString("choose_language")); | ||||||||||||||||||
2 | languageMenu.setMnemonic('C'); | 2 | languageMenu.setMnemonic('C'); | ||||||||||||||||||
3 | JMenuItem english = new JMenuItem(JMeterUtils.getResString("en"), 'E'); | 3 | JMenuItem english = new JMenuItem(JMeterUtils.getResString("en"), 'E'); | ||||||||||||||||||
4 | english.addActionListener(ActionRouter.getInstance()); |
| 4 | english.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
5 | english.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 5 | english.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
6 | english.setName(Locale.ENGLISH.getLanguage()); | 6 | english.setName(Locale.ENGLISH.getLanguage()); | ||||||||||||||||||
7 | languageMenu.add(english); | 7 | languageMenu.add(english); | ||||||||||||||||||
8 | JMenuItem japanese = new JMenuItem(JMeterUtils.getResString("jp"), 'J'); | 8 | JMenuItem japanese = new JMenuItem(JMeterUtils.getResString("jp"), 'J'); | ||||||||||||||||||
9 | japanese.addActionListener(ActionRouter.getInstance()); |
| 9 | japanese.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
10 | japanese.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 10 | japanese.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
11 | japanese.setName(Locale.JAPANESE.getLanguage()); | 11 | japanese.setName(Locale.JAPANESE.getLanguage()); | ||||||||||||||||||
12 | languageMenu.add(japanese); | 12 | languageMenu.add(japanese); | ||||||||||||||||||
13 | JMenuItem norway = new JMenuItem(JMeterUtils.getResString("no"), 'N'); | 13 | JMenuItem norway = new JMenuItem(JMeterUtils.getResString("no"), 'N'); | ||||||||||||||||||
14 | norway.addActionListener(ActionRouter.getInstance()); |
| 14 | norway.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
15 | norway.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 15 | norway.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
16 | norway.setName("no"); | 16 | norway.setName("no"); | ||||||||||||||||||
17 | languageMenu.add(norway); | 17 | languageMenu.add(norway); | ||||||||||||||||||
18 | JMenuItem german = new JMenuItem(JMeterUtils.getResString("de"), 'G'); | 18 | JMenuItem german = new JMenuItem(JMeterUtils.getResString("de"), 'G'); | ||||||||||||||||||
19 | german.addActionListener(ActionRouter.getInstance()); |
| 19 | german.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
20 | german.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 20 | german.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
21 | german.setName(Locale.GERMAN.getLanguage()); | 21 | german.setName(Locale.GERMAN.getLanguage()); | ||||||||||||||||||
22 | languageMenu.add(german); | 22 | languageMenu.add(german); | ||||||||||||||||||
23 | JMenuItem french = new JMenuItem(JMeterUtils.getResString("fr"), 'F'); | 23 | JMenuItem french = new JMenuItem(JMeterUtils.getResString("fr"), 'F'); | ||||||||||||||||||
24 | french.addActionListener(ActionRouter.getInstance()); |
| 24 | french.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
25 | french.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 25 | french.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
26 | french.setName(Locale.FRENCH.getLanguage()); | 26 | french.setName(Locale.FRENCH.getLanguage()); | ||||||||||||||||||
27 | languageMenu.add(french); | 27 | languageMenu.add(french); | ||||||||||||||||||
28 | JMenuItem chineseSimple = new JMenuItem(JMeterUtils.getResString("zh_cn")); | 28 | JMenuItem chineseSimple = new JMenuItem(JMeterUtils.getResString("zh_cn")); | ||||||||||||||||||
29 | chineseSimple.addActionListener(ActionRouter.getInstance()); |
| 29 | chineseSimple.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
30 | chineseSimple.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 30 | chineseSimple.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
31 | chineseSimple.setName(Locale.SIMPLIFIED_CHINESE.toString()); | 31 | chineseSimple.setName(Locale.SIMPLIFIED_CHINESE.toString()); | ||||||||||||||||||
32 | languageMenu.add(chineseSimple); | 32 | languageMenu.add(chineseSimple); | ||||||||||||||||||
33 | JMenuItem chineseTrad = new JMenuItem(JMeterUtils.getResString("zh_tw")); |
| 33 | JMenuItem chineseTrad = new JMenuItem(JMeterUtils.getResString("zh_TW")); | |||||||||||||||||
34 | chineseTrad.addActionListener(ActionRouter.getInstance()); |
| 34 | chineseTrad.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
35 | chineseTrad.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 35 | chineseTrad.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
36 | chineseTrad.setName(Locale.TRADITIONAL_CHINESE.toString()); | 36 | chineseTrad.setName(Locale.TRADITIONAL_CHINESE.toString()); | ||||||||||||||||||
37 | languageMenu.add(chineseTrad); | 37 | languageMenu.add(chineseTrad); | ||||||||||||||||||
38 | JMenuItem spanish = new JMenuItem(JMeterUtils.getResString("es")); | 38 | JMenuItem spanish = new JMenuItem(JMeterUtils.getResString("es")); | ||||||||||||||||||
39 | spanish.addActionListener(ActionRouter.getInstance()); |
| 39 | spanish.addActionListener(ReportActionRouter.getInstance()); | |||||||||||||||||
40 | spanish.setActionCommand(ActionNames.CHANGE_LANGUAGE); | 40 | spanish.setActionCommand(ActionNames.CHANGE_LANGUAGE); | ||||||||||||||||||
41 | spanish.setName("es"); | 41 | spanish.setName("es"); | ||||||||||||||||||
42 | languageMenu.add(spanish); | 42 | languageMenu.add(spanish); | ||||||||||||||||||
43 | JMenuItem turkish = new JMenuItem(JMeterUtils.getResString("tr")); | | |||||||||||||||||||
44 | turkish.addActionListener(ActionRouter.getInstance()); | | |||||||||||||||||||
45 | turkish.setActionCommand(ActionNames.CHANGE_LANGUAGE); | | |||||||||||||||||||
46 | turkish.setName("tr"); | | |||||||||||||||||||
47 | languageMenu.add(turkish); | | |||||||||||||||||||
48 | return languageMenu; | 43 | return languageMenu; |
Row | Violation |
---|---|
1 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
2 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
3 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
6 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
7 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
10 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
11 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
14 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
15 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
18 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
19 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
22 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
23 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
25 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
26 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
27 | Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
28 | Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
29 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() |
30 | Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter |
31 | Clone fragment #1 returns variables languageMenu , while Clone fragment #2 returns variables |