try { prop.store(new FileOutputStream(file), "FirebirdManager - Backup properties"); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED); log.error(e.getLocalizedMessage()); } catch (IOException e) { JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED); log.error(e.getLocalizedMessage()); }
try { prop.load(new FileInputStream(file)); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.LOAD_PROP_FAILED); log.error(e.getLocalizedMessage()); } catch (IOException e) { JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.LOAD_PROP_FAILED); log.error(e.getLocalizedMessage()); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerBackupRestoreFrame.java File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerCreateDatabaseFrame.java
Method name: void saveBackupProperties() Method name: void loadProperties()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
					prop.store(new FileOutputStream(file),
2
				prop.load(new FileInputStream(file)
3
							"FirebirdManager - Backup properties");
3
);
4
				} catch (FileNotFoundException e) {
4
			} catch (FileNotFoundException e) {
5
					JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);
5
	            JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.LOAD_PROP_FAILED);
6
					log.error(e.getLocalizedMessage());
6
				log.error(e.getLocalizedMessage());
7
				} catch (IOException e) {
7
			} catch (IOException e) {
8
					JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);
8
	            JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.LOAD_PROP_FAILED);
9
					log.error(e.getLocalizedMessage());
9
				log.error(e.getLocalizedMessage());
10
				}
10
			}
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.7
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    try
    21
    try
    5
    try
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18nnet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18nVARIABLE_TYPE_MISMATCH
    SAVE_PROP_FAILEDLOAD_PROP_FAILEDVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18nnet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18nVARIABLE_TYPE_MISMATCH
    SAVE_PROP_FAILEDLOAD_PROP_FAILEDVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n and net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n extend a common superclass
    Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n and net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n extend a common superclass
    5
    try
    22
    prop.store(new FileOutputStream(file), "FirebirdManager - Backup properties");
    22
    prop.store(new FileOutputStream(file), "FirebirdManager - Backup properties");
    6
    prop.load(new FileInputStream(file));
    Differences
    Expression1Expression2Difference
    storeloadMETHOD_INVOCATION_NAME_MISMATCH
    prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties")prop.load(new FileInputStream(file))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression prop.load(new FileInputStream(file)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a void method call, and thus it cannot be parameterized
    Expression prop.load(new FileInputStream(file)) is a void method call, and thus it cannot be parameterized
    Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression prop.load(new FileInputStream(file)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a void method call, and thus it cannot be parameterized
    Expression prop.load(new FileInputStream(file)) is a void method call, and thus it cannot be parameterized
    6
    prop.load(new FileInputStream(file));
    Precondition Violations (10)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n
    2Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n
    3Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression prop.load(new FileInputStream(file)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a void method call, and thus it cannot be parameterized
    6Expression prop.load(new FileInputStream(file)) is a void method call, and thus it cannot be parameterized
    7Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    8Expression prop.load(new FileInputStream(file)) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    9Expression prop.store(new FileOutputStream(file),"FirebirdManager - Backup properties") is a void method call, and thus it cannot be parameterized
    10Expression prop.load(new FileInputStream(file)) is a void method call, and thus it cannot be parameterized