addWidgetListener(new WidgetAdapter() { public void widgetClosing(WidgetEvent e) { SessionInfoInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(), _sessionInfoPanel.getAutoRefreshPeriod()); _sessionInfoPanel.setAutoRefresh(false); } }); Icon icon = _resources.getIcon(getClass(), "frameIcon"); //i18n if (icon != null) { setFrameIcon(icon); } OracleInternalFrameCallback cb = new OracleInternalFrameCallback() { public void createPanelAndToolBar(boolean stayOnTop, int autoRefeshPeriod) { _sessionInfoPanel = new SessionInfoPanel(getSession(), autoRefeshPeriod); _toolBar = new SessionInfoToolBar(getSession(), stayOnTop, autoRefeshPeriod); JPanel contentPanel = new JPanel(new BorderLayout()); contentPanel.add(_toolBar, BorderLayout.NORTH); contentPanel.add(_sessionInfoPanel, BorderLayout.CENTER); setContentPane(contentPanel); _sessionInfoPanel.setAutoRefreshPeriod(autoRefeshPeriod); } }; initFromPrefs(PREF_PART_INFO_FRAME, cb);
addWidgetListener(new WidgetAdapter() { public void widgetClosing(WidgetEvent e) { SGATraceInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(), _sgaTracePanel.getAutoRefreshPeriod()); _sgaTracePanel.setAutoRefresh(false); } }); Icon icon = _resources.getIcon(getClass(), "frameIcon"); //i18n if (icon != null) { setFrameIcon(icon); } OracleInternalFrameCallback cb = new OracleInternalFrameCallback() { public void createPanelAndToolBar(boolean stayOnTop, int autoRefeshPeriod) { _sgaTracePanel = new SGATracePanel(getSession(), autoRefeshPeriod); _toolBar = new SGATraceToolBar(getSession(), stayOnTop, autoRefeshPeriod); JPanel contentPanel = new JPanel(new BorderLayout()); contentPanel.add(_toolBar, BorderLayout.NORTH); contentPanel.add(_sgaTracePanel, BorderLayout.CENTER); setContentPane(contentPanel); } }; initFromPrefs(PREF_PART_SGA_FRAME, cb);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/sessioninfo/SessionInfoInternalFrame.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/SGAtrace/SGATraceInternalFrame.java
Method name: void createGUI(ISession) Method name: void createGUI()
Number of AST nodes: 6 Number of AST nodes: 6
1
addWidgetListener(new WidgetAdapter()
1
addWidgetListener(new WidgetAdapter()
2
      {
2
      {
3
         public void widgetClosing(WidgetEvent e)
3
         public void widgetClosing(WidgetEvent e)
4
         {
4
         {
5
            SessionInfoInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(), _sessionInfoPanel.getAutoRefreshPeriod());
5
            SGATraceInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(), _sgaTracePanel.getAutoRefreshPeriod());
6
            _sessionInfoPanel.setAutoRefresh(false);
6
            _sgaTracePanel.setAutoRefresh(false);
7
         }
7
         }
8
      });
8
      });
9
      Icon icon = _resources.getIcon(getClass(), "frameIcon"); //i18n
9
      Icon icon = _resources.getIcon(getClass(), "frameIcon"); //i18n
10
      if (icon != null)
10
      if (icon != null)
11
      {
11
      {
12
         setFrameIcon(icon);
12
         setFrameIcon(icon);
13
      }
13
      }
14
      OracleInternalFrameCallback cb = new OracleInternalFrameCallback()
14
      OracleInternalFrameCallback cb = new OracleInternalFrameCallback()
15
      {
15
      {
16
         public void createPanelAndToolBar(boolean stayOnTop, int autoRefeshPeriod)
16
         public void createPanelAndToolBar(boolean stayOnTop, int autoRefeshPeriod)
17
         {
17
         {
18
            _sessionInfoPanel = new SessionInfoPanel(getSession(), autoRefeshPeriod);
18
            _sgaTracePanel = new SGATracePanel(getSession(), autoRefeshPeriod);
19
            _toolBar = new SessionInfoToolBar(getSession(), stayOnTop, autoRefeshPeriod);
19
            _toolBar = new SGATraceToolBar(getSession(), stayOnTop, autoRefeshPeriod);
20
            JPanel contentPanel = new JPanel(new BorderLayout());
20
            JPanel contentPanel = new JPanel(new BorderLayout());
21
            contentPanel.add(_toolBar, BorderLayout.NORTH);
21
            contentPanel.add(_toolBar, BorderLayout.NORTH);
22
            contentPanel.add(_sessionInfoPanel, BorderLayout.CENTER);
22
            contentPanel.add(_sgaTracePanel, BorderLayout.CENTER);
23
            setContentPane(contentPanel);
23
            setContentPane(contentPanel);
24
            _sessionInfoPanel.setAutoRefreshPeriod(autoRefeshPeriod);
25
         }
24
         }
26
      };
25
      };
27
      initFromPrefs(PREF_PART_INFO_FRAME, cb);
26
      initFromPrefs(PREF_PART_SGA_FRAME, cb);
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)94.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    addWidgetListener(new WidgetAdapter() {...});
    1
    addWidgetListener(new WidgetAdapter() {...});
    1
    addWidgetListener(new WidgetAdapter() {...});
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFrame.SessionInfoToolBarnet.sourceforge.squirrel_sql.plugins.oracle.SGAtrace.SGATraceInternalFrame.SGATraceToolBarSUBCLASS_TYPE_MISMATCH
    _sessionInfoPanel_sgaTracePanelVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoPanelnet.sourceforge.squirrel_sql.plugins.oracle.SGAtrace.SGATracePanelSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoInternalFramenet.sourceforge.squirrel_sql.plugins.oracle.SGAtrace.SGATraceInternalFrameSUBCLASS_TYPE_MISMATCH
    _sessionInfoPanel_sgaTracePanelVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoPanelnet.sourceforge.squirrel_sql.plugins.oracle.SGAtrace.SGATracePanelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _sessionInfoPanel cannot be unified with expression _sgaTracePanel , because common superclass javax.swing.JPanel does not declare member(s) public int getAutoRefreshPeriod() , public void setAutoRefresh(boolean)
    Expression _sessionInfoPanel cannot be unified with expression _sgaTracePanel , because common superclass javax.swing.JPanel does not declare member(s) public int getAutoRefreshPeriod() , public void setAutoRefresh(boolean)
    Super method call addWidgetListener(new WidgetAdapter(){ public void widgetClosing( WidgetEvent e){ SessionInfoInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(),_sessionInfoPanel.getAutoRefreshPeriod()); _sessionInfoPanel.setAutoRefresh(false); } } ); cannot be extracted from method
    Super method call addWidgetListener(new WidgetAdapter(){ public void widgetClosing( WidgetEvent e){ SGATraceInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(),_sgaTracePanel.getAutoRefreshPeriod()); _sgaTracePanel.setAutoRefresh(false); } } ); cannot be extracted from method
    1
    addWidgetListener(new WidgetAdapter() {...});
    2
    Icon icon = _resources.getIcon(getClass(), "frameIcon");
    2
    Icon icon = _resources.getIcon(getClass(), "frameIcon");
    3
    if (icon != null)
    3
    if (icon != null)
    4
    setFrameIcon(icon);
    4
    setFrameIcon(icon);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    5
    OracleInternalFrameCallback cb = new OracleInternalFrameCallback() {...};
    Preondition Violations
    Unmatched statement OracleInternalFrameCallback cb=new OracleInternalFrameCallback(){ public void createPanelAndToolBar( boolean stayOnTop, int autoRefeshPeriod){ _sgaTracePanel=new SGATracePanel(getSession(),autoRefeshPeriod); _toolBar=new SGATraceToolBar(getSession(),stayOnTop,autoRefeshPeriod); JPanel contentPanel=new JPanel(new BorderLayout()); contentPanel.add(_toolBar,BorderLayout.NORTH); contentPanel.add(_sgaTracePanel,BorderLayout.CENTER); setContentPane(contentPanel); } } ; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    OracleInternalFrameCallback cb = new OracleInternalFrameCallback() {...};
    5
    OracleInternalFrameCallback cb = new OracleInternalFrameCallback() {...};
    5
    OracleInternalFrameCallback cb = new OracleInternalFrameCallback() {...};
    Preondition Violations
    Unmatched statement OracleInternalFrameCallback cb=new OracleInternalFrameCallback(){ public void createPanelAndToolBar( boolean stayOnTop, int autoRefeshPeriod){ _sessionInfoPanel=new SessionInfoPanel(getSession(),autoRefeshPeriod); _toolBar=new SessionInfoToolBar(getSession(),stayOnTop,autoRefeshPeriod); JPanel contentPanel=new JPanel(new BorderLayout()); contentPanel.add(_toolBar,BorderLayout.NORTH); contentPanel.add(_sessionInfoPanel,BorderLayout.CENTER); setContentPane(contentPanel); _sessionInfoPanel.setAutoRefreshPeriod(autoRefeshPeriod); } } ; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    6
    initFromPrefs(PREF_PART_INFO_FRAME, cb);
    6
    initFromPrefs(PREF_PART_INFO_FRAME, cb);
    6
    initFromPrefs(PREF_PART_SGA_FRAME, cb);
    Differences
    Expression1Expression2Difference
    PREF_PART_INFO_FRAMEPREF_PART_SGA_FRAMEVARIABLE_NAME_MISMATCH
    6
    initFromPrefs(PREF_PART_SGA_FRAME, cb);
    Precondition Violations (6)
    Row Violation
    1Expression _sessionInfoPanel cannot be unified with expression _sgaTracePanel , because common superclass javax.swing.JPanel does not declare member(s) public int getAutoRefreshPeriod() , public void setAutoRefresh(boolean)
    2Expression _sessionInfoPanel cannot be unified with expression _sgaTracePanel , because common superclass javax.swing.JPanel does not declare member(s) public int getAutoRefreshPeriod() , public void setAutoRefresh(boolean)
    3Super method call addWidgetListener(new WidgetAdapter(){ public void widgetClosing( WidgetEvent e){ SessionInfoInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(),_sessionInfoPanel.getAutoRefreshPeriod()); _sessionInfoPanel.setAutoRefresh(false); } } ); cannot be extracted from method
    4Super method call addWidgetListener(new WidgetAdapter(){ public void widgetClosing( WidgetEvent e){ SGATraceInternalFrame.super.internalFrameClosing(_toolBar.isStayOnTop(),_sgaTracePanel.getAutoRefreshPeriod()); _sgaTracePanel.setAutoRefresh(false); } } ); cannot be extracted from method
    5Unmatched statement OracleInternalFrameCallback cb=new OracleInternalFrameCallback(){ public void createPanelAndToolBar( boolean stayOnTop, int autoRefeshPeriod){ _sgaTracePanel=new SGATracePanel(getSession(),autoRefeshPeriod); _toolBar=new SGATraceToolBar(getSession(),stayOnTop,autoRefeshPeriod); JPanel contentPanel=new JPanel(new BorderLayout()); contentPanel.add(_toolBar,BorderLayout.NORTH); contentPanel.add(_sgaTracePanel,BorderLayout.CENTER); setContentPane(contentPanel); } } ; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement OracleInternalFrameCallback cb=new OracleInternalFrameCallback(){ public void createPanelAndToolBar( boolean stayOnTop, int autoRefeshPeriod){ _sessionInfoPanel=new SessionInfoPanel(getSession(),autoRefeshPeriod); _toolBar=new SessionInfoToolBar(getSession(),stayOnTop,autoRefeshPeriod); JPanel contentPanel=new JPanel(new BorderLayout()); contentPanel.add(_toolBar,BorderLayout.NORTH); contentPanel.add(_sessionInfoPanel,BorderLayout.CENTER); setContentPane(contentPanel); _sessionInfoPanel.setAutoRefreshPeriod(autoRefeshPeriod); } } ; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted