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"); }
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"); }
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: 6
1
browserActions = new ActionSet(this,null,null,
1
actions = new ActionSet(this,null,null,
2
				cache.browserActionsURI);
2
				cache.actionsURI);
3
			browserActions.load();
3
			actions.load();
4
			VFSBrowser.getActionContext().addActionSet(browserActions);
4
			
5
			cache.cachedBrowserActionNames =
5
cache.cachedActionNames =
6
				browserActions.getCacheableActionNames();
6
				actions.getCacheableActionNames();
7
			cache.cachedBrowserActionToggleFlags = new boolean[
7
			cache.cachedActionToggleFlags = new boolean[
8
				cache.cachedBrowserActionNames.length];
8
				cache.cachedActionNames.length];
9
			for(int i = 0;
9
			for(int i = 0;
10
				i < cache.cachedBrowserActionNames.length;
10
 i < cache.cachedActionNames.length;
11
				i++)
11
 i++)
12
			{
12
			{
13
				 cache.cachedBrowserActionToggleFlags[i]
13
				 cache.cachedActionToggleFlags[i]
14
				 	= jEdit.getBooleanProperty(
14
				 	= jEdit.getBooleanProperty(
15
					cache.cachedBrowserActionNames[i]
15
					cache.cachedActionNames[i]
16
					+ ".toggle");
16
					+ ".toggle");
17
			}
17
			}
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 fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    59
    browserActions = new ActionSet(this, null, null, cache.browserActionsURI);
    59
    browserActions = new ActionSet(this, null, null, cache.browserActionsURI);
    52
    actions = new ActionSet(this, null, null, cache.actionsURI);
    Differences
    Expression1Expression2Difference
    browserActionsactionsVARIABLE_NAME_MISMATCH
    browserActionsURIactionsURIVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression browserActions is a field being modified, and thus it cannot be parameterized
    Expression actions is a field being modified, and thus it cannot be parameterized
    52
    actions = new ActionSet(this, null, null, cache.actionsURI);
    60
    browserActions.load();
    60
    browserActions.load();
    53
    actions.load();
    Differences
    Expression1Expression2Difference
    browserActionsactionsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    53
    actions.load();
    61
    VFSBrowser.getActionContext().addActionSet(browserActions);
                                                                                                                                  
    62
    cache.cachedBrowserActionNames = browserActions.getCacheableActionNames();
    62
    cache.cachedBrowserActionNames = browserActions.getCacheableActionNames();
    54
    cache.cachedActionNames = actions.getCacheableActionNames();
    Differences
    Expression1Expression2Difference
    cachedBrowserActionNamescachedActionNamesVARIABLE_NAME_MISMATCH
    browserActionsactionsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    54
    cache.cachedActionNames = actions.getCacheableActionNames();
    63
    cache.cachedBrowserActionToggleFlags = new boolean[cache.cachedBrowserActionNames.length];
    63
    cache.cachedBrowserActionToggleFlags = new boolean[cache.cachedBrowserActionNames.length];
    55
    cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length];
    Differences
    Expression1Expression2Difference
    cachedBrowserActionToggleFlagscachedActionToggleFlagsVARIABLE_NAME_MISMATCH
    cachedBrowserActionNamescachedActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedBrowserActionNames 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
    55
    cache.cachedActionToggleFlags = new boolean[cache.cachedActionNames.length];
    64
    for (int i = 0; i < cache.cachedBrowserActionNames.length; i++)
    64
    for (int i = 0; i < cache.cachedBrowserActionNames.length; i++)
    56
    for (int i = 0; i < cache.cachedActionNames.length; i++)
    Differences
    Expression1Expression2Difference
    cachedBrowserActionNamescachedActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedBrowserActionNames 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
    56
    for (int i = 0; i < cache.cachedActionNames.length; i++)
    65
    cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedBrowserActionNames[i] + ".toggle");
    65
    cache.cachedBrowserActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedBrowserActionNames[i] + ".toggle");
    57
    cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedActionNames[i] + ".toggle");
    Differences
    Expression1Expression2Difference
    cachedBrowserActionToggleFlagscachedActionToggleFlagsVARIABLE_NAME_MISMATCH
    cachedBrowserActionNamescachedActionNamesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cache.cachedBrowserActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cache.cachedActionToggleFlags 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
    Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    57
    cache.cachedActionToggleFlags[i] = jEdit.getBooleanProperty(cache.cachedActionNames[i] + ".toggle");
    Precondition Violations (14)
    Row Violation
    1Expression browserActions is a field being modified, and thus it cannot be parameterized
    2Expression actions is a field being modified, and thus it cannot be parameterized
    3Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression browserActions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression actions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression cache.cachedBrowserActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression cache.cachedActionToggleFlags cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression cache.cachedBrowserActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression cache.cachedActionNames cannot be parameterized, because it has dependencies to/from statements that will be extracted