if(cache.actionsURI != null) { actions = new ActionSet(this,null,null, cache.actionsURI); actions.load(); cache.cachedActionNames = actions.getCacheableActionNames(); cache.cachedActionToggleFlags = new boolean[ cache.cachedActionNames.length]; for(int i = 0; i < cache.cachedActionNames.length; i++) { cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedActionNames[i] + ".toggle"); } }
browserActions = new ActionSet(this,null,null, cache.browserActionsURI); browserActions.load(); VFSBrowser.getActionContext().addActionSet(browserActions); cache.cachedBrowserActionNames = browserActions.getCacheableActionNames(); cache.cachedBrowserActionToggleFlags = new boolean[ cache.cachedBrowserActionNames.length]; for(int i = 0; i < cache.cachedBrowserActionNames.length; i++) { cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty( cache.cachedBrowserActionNames[i] + ".toggle"); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/PluginJAR.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/PluginJAR.java
Method name: PluginCacheEntry generateCache() Method name: PluginCacheEntry generateCache()
Number of AST nodes: 7 Number of AST nodes: 7
1
if(cache.actionsURI != null)
2
		{
3
			actions = new ActionSet(this,null,null,
1
browserActions = new ActionSet(this,null,null,
4
				cache.actionsURI);
2
				cache.browserActionsURI);
5
			actions.load();
3
			browserActions.load();
6
			
4
			VFSBrowser.getActionContext().addActionSet(browserActions);
7
cache.cachedActionNames =
5
			cache.cachedBrowserActionNames =
8
				actions.getCacheableActionNames();
6
				browserActions.getCacheableActionNames();
9
			cache.cachedActionToggleFlags = new boolean[
7
			cache.cachedBrowserActionToggleFlags = new boolean[
10
				cache.cachedActionNames.length];
8
				cache.cachedBrowserActionNames.length];
11
			for(int i = 0; 
9
			for(int i = 0;
12
i < cache.cachedActionNames.length; 
10
				i < cache.cachedBrowserActionNames.length;
13
i++)
11
				i++)
14
			{
12
			{
15
				 cache.cachedActionToggleFlags[i]
13
				 cache.cachedBrowserActionToggleFlags[i]
16
				 	= jEdit.getBooleanProperty(
14
				 	= jEdit.getBooleanProperty(
17
					cache.cachedActionNames[i]
15
					cache.cachedBrowserActionNames[i]
18
					+ ".toggle");
16
					+ ".toggle");
19
			}
17
			}
20
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same method
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    52
    actions = new ActionSet(this, null, null, cache.actionsURI);
    52
    actions = new ActionSet(this, null, null, cache.actionsURI);
    59
    browserActions = new ActionSet(this, null, null, cache.browserActionsURI);
    Differences
    Expression1Expression2Difference
    actionsbrowserActionsVARIABLE_NAME_MISMATCH
    actionsURIbrowserActionsURIVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression actions is a field being modified, and thus it cannot be parameterized
    Expression browserActions is a field being modified, and thus it cannot be parameterized
    59
    browserActions = new ActionSet(this, null, null, cache.browserActionsURI);
    53
    actions.load();
    53
    actions.load();
    60
    browserActions.load();
    Differences
    Expression1Expression2Difference
    actionsbrowserActionsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    60
    browserActions.load();
                                                                                                                                  
    61
    VFSBrowser.getActionContext().addActionSet(browserActions);
    54
    cache.cachedActionNames = actions.getCacheableActionNames();
    54
    cache.cachedActionNames = actions.getCacheableActionNames();
    62
    cache.cachedBrowserActionNames = browserActions.getCacheableActionNames();
    Differences
    Expression1Expression2Difference
    cachedActionNamescachedBrowserActionNamesVARIABLE_NAME_MISMATCH
    actionsbrowserActionsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    62
    cache.cachedBrowserActionNames = browserActions.getCacheableActionNames();
    55
    cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length];
    55
    cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length];
    63
    cache.cachedBrowserActionToggleFlags = new boolean[cache.cachedBrowserActionNames.length];
    Differences
    Expression1Expression2Difference
    cachedActionToggleFlagscachedBrowserActionToggleFlagsVARIABLE_NAME_MISMATCH
    cachedActionNamescachedBrowserActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    63
    cache.cachedBrowserActionToggleFlags = new boolean[cache.cachedBrowserActionNames.length];
    56
    for (int i = 0; i < cache.cachedActionNames.length; i++)
    56
    for (int i = 0; i < cache.cachedActionNames.length; i++)
    64
    for (int i = 0; i < cache.cachedBrowserActionNames.length; i++)
    Differences
    Expression1Expression2Difference
    cachedActionNamescachedBrowserActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    64
    for (int i = 0; i < cache.cachedBrowserActionNames.length; i++)
    57
    cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedActionNames[i] + ".toggle");
    57
    cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedActionNames[i] + ".toggle");
    65
    cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedBrowserActionNames[i] + ".toggle");
    Differences
    Expression1Expression2Difference
    cachedActionToggleFlagscachedBrowserActionToggleFlagsVARIABLE_NAME_MISMATCH
    cachedActionNamescachedBrowserActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedBrowserActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    65
    cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedBrowserActionNames[i] + ".toggle");
    Precondition Violations (14)
    Row Violation
    1Expression actions is a field being modified, and thus it cannot be parameterized
    2Expression browserActions is a field being modified, and thus it cannot be parameterized
    3Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression cache.cachedActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression cache.cachedBrowserActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted