public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } /** * Returns whether this factory is applicable for the type of the object. * @return whether this factory is applicable for the type of the object. */ @Override public boolean isFactoryForType(Object type) { return type instanceof EObject || supportedTypes.contains(type); } /** * This implementation substitutes the factory itself as the key for the adapter. */ @Override public Adapter adapt(Notifier notifier, Object type) { return super.adapt(notifier, this); } /** */ @Override public Object adapt(Object object, Object type) { if (isFactoryForType(type)) { Object adapter = super.adapt(object, type); if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter))) { return adapter; } } return null; } /** * This adds a listener. */ public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } /** * This removes a listener. */ public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } /** * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. */ public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(notification);
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean isFactoryForType(Object type) { return supportedTypes.contains(type) || super.isFactoryForType(type); } /** * This implementation substitutes the factory itself as the key for the adapter. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter adapt(Notifier notifier, Object type) { return super.adapt(notifier, this); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object adapt(Object object, Object type) { if (isFactoryForType(type)) { Object adapter = super.adapt(object, type); if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter))) { return adapter; } } return null; } /** * This adds a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } /** * This removes a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } /** * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(notification);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ReflectiveItemProviderAdapterFactory.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/provider/Ecore2XMLItemProviderAdapterFactory.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
1
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
2
  {
2
  {
3
    this.parentAdapterFactory = parentAdapterFactory;
3
    this.parentAdapterFactory = parentAdapterFactory;
4
  }
4
  }
5
  /**
5
  /**
6
   * Returns whether this factory is applicable for the type of the object.
6
   * 
7
   * @return whether this factory is applicable for the type of the object.
7
<!-- begin-user-doc -->
8
   * <!-- end-user-doc -->
9
   * @generated
8
   */
10
   */
9
  @Override
11
  @Override
10
  public boolean isFactoryForType(Object type)
12
  public boolean isFactoryForType(Object type)
11
  {
13
  {
12
    return type instanceof EObject || supportedTypes.contains(type);
14
    return supportedTypes.contains(type) || super.isFactoryForType(type);
13
  }
15
  }
14
  /**
16
  /**
15
   * This implementation substitutes the factory itself as the key for the adapter.
17
   * This implementation substitutes the factory itself as the key for the adapter.
18
   * <!-- begin-user-doc -->
19
   * <!-- end-user-doc -->
20
   * @generated
16
   */
21
   */
17
  @Override
22
  @Override
18
  public Adapter adapt(Notifier notifier, Object type)
23
  public Adapter adapt(Notifier notifier, Object type)
19
  {
24
  {
20
    return super.adapt(notifier, this);
25
    return super.adapt(notifier, this);
21
  }
26
  }
22
  /**
27
  /**
28
   * <!-- begin-user-doc -->
29
   * <!-- end-user-doc -->
30
   * @generated
23
   */
31
   */
24
  @Override
32
  @Override
25
  public Object adapt(Object object, Object type)
33
  public Object adapt(Object object, Object type)
26
  {
34
  {
27
    if (isFactoryForType(type))
35
    if (isFactoryForType(type))
28
    {
36
    {
29
      Object adapter = super.adapt(object, type);
37
      Object adapter = super.adapt(object, type);
30
      if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter)))
38
      if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter)))
31
      {
39
      {
32
        return adapter;
40
        return adapter;
33
      }
41
      }
34
    }
42
    }
35
    return null;
43
    return null;
36
  }
44
  }
37
  /**
45
  /**
38
   * This adds a listener.
46
   * This adds a listener.
47
   * <!-- begin-user-doc -->
48
   * <!-- end-user-doc -->
49
   * @generated
39
   */
50
   */
40
  public void addListener(INotifyChangedListener notifyChangedListener)
51
  public void addListener(INotifyChangedListener notifyChangedListener)
41
  {
52
  {
42
    changeNotifier.addListener(notifyChangedListener);
53
    changeNotifier.addListener(notifyChangedListener);
43
  }
54
  }
44
  /**
55
  /**
45
   * This removes a listener.
56
   * This removes a listener.
57
   * <!-- begin-user-doc -->
58
   * <!-- end-user-doc -->
59
   * @generated
46
   */
60
   */
47
  public void removeListener(INotifyChangedListener notifyChangedListener)
61
  public void removeListener(INotifyChangedListener notifyChangedListener)
48
  {
62
  {
49
    changeNotifier.removeListener(notifyChangedListener);
63
    changeNotifier.removeListener(notifyChangedListener);
50
  }
64
  }
51
  /**
65
  /**
52
   * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
66
   * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
67
   * <!-- begin-user-doc -->
68
   * <!-- end-user-doc -->
69
   * @generated
53
   */
70
   */
54
  public void fireNotifyChanged(Notification notification)
71
  public void fireNotifyChanged(Notification notification)
55
  {
72
  {
56
    changeNotifier.fireNotifyChanged(notification);
73
    changeNotifier.fireNotifyChanged(notification);
57
    if (parentAdapterFactory != null)
74
    if (parentAdapterFactory != null)
58
    {
75
    {
59
      parentAdapterFactory.fireNotifyChanged(notification);
76
      parentAdapterFactory.fireNotifyChanged(notification);
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0