if (plugin == null) { throw new IllegalArgumentException("Null IPlugin passed"); } if (key == null) { throw new IllegalArgumentException("Null key passed"); } Map<String, Object> map = _pluginObjects.get(plugin.getInternalName()); if (map == null) { map = new HashMap<String, Object>(); _pluginObjects.put(plugin.getInternalName(), map); } return map.get(key);
if (plugin == null) { throw new IllegalArgumentException("Null IPlugin passed"); } if (key == null) { throw new IllegalArgumentException("Null key passed"); } Map<String, Object> map = _pluginObjects.get(plugin.getInternalName()); if (map == null) { map = new HashMap<String, Object>(); _pluginObjects.put(plugin.getInternalName(), map); } return map.put(key, value);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java
Method name: Object getPluginObject(IPlugin, String) Method name: Object putPluginObject(IPlugin, String, Object)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (plugin == null)
1
if (plugin == null)
2
      {
2
      {
3
         throw new IllegalArgumentException("Null IPlugin passed");
3
         throw new IllegalArgumentException("Null IPlugin passed");
4
      }
4
      }
5
      if (key == null)
5
      if (key == null)
6
      {
6
      {
7
         throw new IllegalArgumentException("Null key passed");
7
         throw new IllegalArgumentException("Null key passed");
8
      }
8
      }
9
      Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());
9
      Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());
10
      if (map == null)
10
      if (map == null)
11
      {
11
      {
12
         map = new HashMap<String, Object>();
12
         map = new HashMap<String, Object>();
13
         _pluginObjects.put(plugin.getInternalName(), map);
13
         _pluginObjects.put(plugin.getInternalName(), map);
14
      }
14
      }
15
      return map.get(key);
15
      return map.put(key, value);
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.7
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (plugin == null)
    1
    if (plugin == null)
    2
    throw new IllegalArgumentException("Null IPlugin passed");
    2
    throw new IllegalArgumentException("Null IPlugin passed");
    3
    if (key == null)
    3
    if (key == null)
    4
    throw new IllegalArgumentException("Null key passed");
    4
    throw new IllegalArgumentException("Null key passed");
    5
    Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());
    5
    Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());
    6
    if (map == null)
    6
    if (map == null)
    7
    map = new HashMap<String, Object>();
    7
    map = new HashMap<String, Object>();
    8
    _pluginObjects.put(plugin.getInternalName(), map);
    8
    _pluginObjects.put(plugin.getInternalName(), map);
    9
    return map.get(key);
    9
    return map.get(key);
    9
    return map.put(key, value);
    Differences
    Expression1Expression2Difference
    getputMETHOD_INVOCATION_NAME_MISMATCH
    map.get(key)map.put(key,value)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    return map.put(key, value);
    Precondition Violations (4)
    Row Violation
    1Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted