final Enumeration<IExtension> extensionEnumeration = getExtensionHandler() .getExtensionEnumeration(); while (extensionEnumeration.hasMoreElements()) { final IExtension ext = extensionEnumeration.nextElement(); IComponentPlugin p; try { p = (IComponentPlugin) ext.instanciateExtension(null); p.postStartup(); } catch (final PluginException e) { LOG.severe(e.getMessage()); if (Logging.DEBUG) { e.printStackTrace(); } } }
while (extensionEnumeration.hasMoreElements()) { final IExtension ext = extensionEnumeration.nextElement(); IComponentPlugin p; try { p = (IComponentPlugin) ext.instanciateExtension(null); p.handleCommandLineParameters(commandLine); } catch (final PluginException e) { LOG.severe(e.getMessage()); if (Logging.DEBUG) { e.printStackTrace(); } } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/component/ComponentManager.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/component/ComponentManager.java
Method name: void postStartup() Method name: void handleCommandLineParameters(CommandLine)
Number of AST nodes: 7 Number of AST nodes: 6
1
final Enumeration<IExtension> extensionEnumeration = getExtensionHandler()
2
				.getExtensionEnumeration();
3
		while (extensionEnumeration.hasMoreElements()) {
1
while (extensionEnumeration.hasMoreElements()) {
4
			final IExtension ext = extensionEnumeration.nextElement();
2
			final IExtension ext = extensionEnumeration.nextElement();
5
			IComponentPlugin p;
3
			IComponentPlugin p;
6
			try {
4
			try {
7
				p = (IComponentPlugin) ext.instanciateExtension(null);
5
				p = (IComponentPlugin) ext.instanciateExtension(null);
8
				p.postStartup();
6
				p.handleCommandLineParameters(commandLine);
9
			} catch (final PluginException e) {
7
			} catch (final PluginException e) {
10
				LOG.severe(e.getMessage());
8
				LOG.severe(e.getMessage());
11
				if (Logging.DEBUG) {
9
				if (Logging.DEBUG) {
12
					e.printStackTrace();
10
					e.printStackTrace();
13
				}
11
				}
14
			}
12
			}
15
		}
13
		}
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 declared in the same class
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)120.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    final Enumeration<IExtension> extensionEnumeration = getExtensionHandler().getExtensionEnumeration();
    1
    final Enumeration<IExtension> extensionEnumeration = getExtensionHandler().getExtensionEnumeration();
    Preondition Violations
    Unmatched statement final Enumeration<IExtension> extensionEnumeration=getExtensionHandler().getExtensionEnumeration(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                
    2
    while (extensionEnumeration.hasMoreElements())
    2
    while (extensionEnumeration.hasMoreElements())
    3
    final IExtension ext = extensionEnumeration.nextElement();
    3
    final IExtension ext = extensionEnumeration.nextElement();
    4
    IComponentPlugin p;
    4
    IComponentPlugin p;
    5
    try
    5
    try
    6
    p = (IComponentPlugin)ext.instanciateExtension(null);
    6
    p = (IComponentPlugin)ext.instanciateExtension(null);
    7
    p.postStartup();
    7
    p.postStartup();
    7
    p.handleCommandLineParameters(commandLine);
    Differences
    Expression1Expression2Difference
    postStartuphandleCommandLineParametersMETHOD_INVOCATION_NAME_MISMATCH
    p.postStartup()p.handleCommandLineParameters(commandLine)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression p.postStartup() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.handleCommandLineParameters(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.postStartup() is a void method call, and thus it cannot be parameterized
    Expression p.handleCommandLineParameters(commandLine) is a void method call, and thus it cannot be parameterized
    Expression p.postStartup() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.handleCommandLineParameters(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.postStartup() is a void method call, and thus it cannot be parameterized
    Expression p.handleCommandLineParameters(commandLine) is a void method call, and thus it cannot be parameterized
    7
    p.handleCommandLineParameters(commandLine);
    Precondition Violations (9)
    Row Violation
    1Unmatched statement final Enumeration<IExtension> extensionEnumeration=getExtensionHandler().getExtensionEnumeration(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression p.postStartup() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression p.handleCommandLineParameters(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression p.postStartup() is a void method call, and thus it cannot be parameterized
    5Expression p.handleCommandLineParameters(commandLine) is a void method call, and thus it cannot be parameterized
    6Expression p.postStartup() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression p.handleCommandLineParameters(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression p.postStartup() is a void method call, and thus it cannot be parameterized
    9Expression p.handleCommandLineParameters(commandLine) is a void method call, and thus it cannot be parameterized