ISession activeSession = getApplication().getSessionManager().getActiveSession(); if (activeSession == null) throw new IllegalArgumentException("This method should not be called with a null activeSession"); final SessionInfoInternalFrame sif = new SessionInfoInternalFrame(activeSession, _resources); getApplication().getMainFrame().addWidget(sif); // If we don't invokeLater here no Short-Cut-Key is sent // to the internal frame // seen under java version "1.4.1_01" and Linux SwingUtilities.invokeLater(new Runnable() { public void run() { sif.setVisible(true); } });
ISession activeSession = getApplication().getSessionManager().getActiveSession(); if (activeSession == null) throw new IllegalArgumentException("This method should not be called with a null activeSession"); final DBOutputInternalFrame sif = new DBOutputInternalFrame(activeSession, _resources); getApplication().getMainFrame().addWidget(sif); // If we don't invokeLater here no Short-Cut-Key is sent // to the internal frame // seen under java version "1.4.1_01" and Linux SwingUtilities.invokeLater(new Runnable() { public void run() { sif.setVisible(true); } });
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/sessioninfo/NewSessionInfoWorksheetAction.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/dboutput/NewDBOutputWorksheetAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 6 Number of AST nodes: 6
1
ISession activeSession = getApplication().getSessionManager().getActiveSession();
1
ISession activeSession = getApplication().getSessionManager().getActiveSession();
2
          if (activeSession == null)
2
          if (activeSession == null)
3
            throw new IllegalArgumentException("This method should not be called with a null activeSession");
3
            throw new IllegalArgumentException("This method should not be called with a null activeSession");
4
          final SessionInfoInternalFrame sif = new SessionInfoInternalFrame(activeSession, _resources);
4
          final DBOutputInternalFrame sif = new DBOutputInternalFrame(activeSession, _resources);
5
          getApplication().getMainFrame().addWidget(sif);
5
          getApplication().getMainFrame().addWidget(sif);
6
          // If we don't invokeLater here no Short-Cut-Key is sent
6
          // If we don't invokeLater here no Short-Cut-Key is sent
7
          // to the internal frame
7
          // to the internal frame
8
          // seen under java version "1.4.1_01" and Linux
8
          // seen under java version "1.4.1_01" and Linux
9
          SwingUtilities.invokeLater(new Runnable()
9
          SwingUtilities.invokeLater(new Runnable()
10
          {
10
          {
11
                  public void run()
11
                  public void run()
12
                  {
12
                  {
13
                          sif.setVisible(true);
13
                          sif.setVisible(true);
14
                  }
14
                  }
15
          });
15
          });
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)36.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ISession activeSession = getApplication().getSessionManager().getActiveSession();
    1
    ISession activeSession = getApplication().getSessionManager().getActiveSession();
    2
    if (activeSession == null)
    2
    if (activeSession == null)
    3
    throw new IllegalArgumentException("This method should not be called with a null activeSession");
    3
    throw new IllegalArgumentException("This method should not be called with a null activeSession");
    4
    final SessionInfoInternalFrame sif = new SessionInfoInternalFrame(activeSession, _resources);
    4
    final SessionInfoInternalFrame sif = new SessionInfoInternalFrame(activeSession, _resources);
    4
    final DBOutputInternalFrame sif = new DBOutputInternalFrame(activeSession, _resources);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.dboutput.DBOutputInternalFrameSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.dboutput.DBOutputInternalFrameSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.dboutput.DBOutputInternalFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new SessionInfoInternalFrame(activeSession,_resources) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DBOutputInternalFrame(activeSession,_resources) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    final DBOutputInternalFrame sif = new DBOutputInternalFrame(activeSession, _resources);
    5
    getApplication().getMainFrame().addWidget(sif);
    5
    getApplication().getMainFrame().addWidget(sif);
    5
    getApplication().getMainFrame().addWidget(sif);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.dboutput.DBOutputInternalFrameSUBCLASS_TYPE_MISMATCH
    5
    getApplication().getMainFrame().addWidget(sif);
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.dboutput.DBOutputInternalFrameSUBCLASS_TYPE_MISMATCH
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    Precondition Violations (2)
    Row Violation
    1Expression new SessionInfoInternalFrame(activeSession,_resources) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new DBOutputInternalFrame(activeSession,_resources) cannot be parameterized, because it has dependencies to/from statements that will be extracted