Program: 12103
Project: 12103
Buggy source:
public GodClassDiagram(GodClassVisualizationData data,Composite parent){
  root=new LayeredPane();
  primary=new Layer();
  primary.setLayoutManager(new XYLayout());
  root.setFont(parent.getFont());
  root.add(primary,"String_Node_Str");
  connections=new ConnectionLayer();
  int classWidth=200;
  final ClassFigure source=new ClassFigure(data.getSourceClass().getName(),ClassFigure.classColor);
  source.setToolTip(new Label("String_Node_Str"));
  source.addTwoCompartments();
  final ClassFigure extractedClass=new ClassFigure("String_Node_Str",ClassFigure.classColor);
  extractedClass.addTwoCompartments();
  extractedClass.setToolTip(new Label("String_Node_Str"));
  for (  FieldObject field : data.getExtractedFields()) {
    EntityFigure fieldFigure=new EntityFigure(field.getName(),EntityFigure.FIELD);
    extractedClass.getFieldsCompartment().add(fieldFigure);
  }
  for (  MethodObject method : data.getExtractedMethods()) {
    EntityFigure methodFigure=new EntityFigure(method.getName(),EntityFigure.METHOD);
    extractedClass.getMethodsCompartment().add(methodFigure);
  }
  Set<Entry<MethodObject,Map<MethodInvocationObject,Integer>>> internalMethodInvocation=data.getInternalMethodInvocationMap().entrySet();
  for (  Entry<MethodObject,Map<MethodInvocationObject,Integer>> entry : internalMethodInvocation) {
    MethodObject extractedMethod=entry.getKey();
    Map<MethodInvocationObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<MethodInvocationObject,Integer> map : connectionMap.entrySet()) {
      MethodInvocationObject method=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure methodFigure=new EntityFigure(method.getMethodName(),EntityFigure.METHOD);
      for (      Object child : extractedClass.getMethodsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(methodFigure.getName())) {
          connections.add(connectionSource.addToSameClassMethodConnectionRR(ConnectionType.METHOD_CALL_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<MethodInvocationObject,Integer>> entry : data.getExternalMethodInvocationMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<MethodInvocationObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<MethodInvocationObject,Integer> map : connectionMap.entrySet()) {
      MethodInvocationObject method=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure methodFigure=new EntityFigure(method.getMethodName(),EntityFigure.METHOD);
      boolean contains=false;
      for (      Object child : source.getMethodsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(methodFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceMethodConnection(ConnectionType.METHOD_CALL_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getMethodsCompartment().add(methodFigure);
        connections.add(connectionSource.addToSourceMethodConnection(ConnectionType.METHOD_CALL_SOURCE,methodFigure,occurences));
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getInternalFieldReadMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),EntityFigure.FIELD);
      for (      Object child : extractedClass.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          connections.add(connectionSource.addToSameClassReadConnectionRR(ConnectionType.READ_FIELD_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getInternalFieldWriteMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),EntityFigure.FIELD);
      for (      Object child : extractedClass.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          connections.add(connectionSource.addToSameClassWriteConnectionRR(ConnectionType.WRITE_FIELD_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getExternalFieldReadMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),EntityFigure.FIELD);
      boolean contains=false;
      for (      Object child : source.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceWeakReadConnection(ConnectionType.READ_FIELD_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getFieldsCompartment().add(fieldFigure);
        connections.add(connectionSource.addToSourceWeakReadConnection(ConnectionType.READ_FIELD_SOURCE,fieldFigure,occurences));
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getExternalFieldWriteMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),EntityFigure.FIELD);
      boolean contains=false;
      for (      Object child : source.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceWeakWriteConnection(ConnectionType.WRITE_FIELD_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getFieldsCompartment().add(fieldFigure);
        connections.add(connectionSource.addToSourceWeakWriteConnection(ConnectionType.WRITE_FIELD_SOURCE,fieldFigure,occurences));
      }
    }
  }
  int startPointX=100;
  int startPointY=50;
  int gap=300;
  primary.add(source,new Rectangle(startPointX,startPointY,classWidth,-1));
  primary.add(extractedClass,new Rectangle(startPointX + classWidth + gap,startPointY,classWidth,-1));
  root.add(connections,"String_Node_Str");
  this.canvas=new FigureCanvas(parent,SWT.DOUBLE_BUFFERED);
}

Fixed version (ground truth):
public GodClassDiagram(GodClassVisualizationData data,Composite parent){
  root=new LayeredPane();
  primary=new Layer();
  primary.setLayoutManager(new XYLayout());
  root.setFont(parent.getFont());
  root.add(primary,"String_Node_Str");
  connections=new ConnectionLayer();
  int classWidth=200;
  final ClassFigure source=new ClassFigure(data.getSourceClass().getName(),DecorationConstants.classColor);
  source.setToolTip(new Label("String_Node_Str"));
  source.addTwoCompartments();
  final ClassFigure extractedClass=new ClassFigure("String_Node_Str",DecorationConstants.classColor);
  extractedClass.addTwoCompartments();
  extractedClass.setToolTip(new Label("String_Node_Str"));
  for (  FieldObject field : data.getExtractedFields()) {
    EntityFigure fieldFigure=new EntityFigure(field.getName(),DecorationConstants.FIELD);
    extractedClass.getFieldsCompartment().add(fieldFigure);
  }
  for (  MethodObject method : data.getExtractedMethods()) {
    EntityFigure methodFigure=new EntityFigure(method.getName(),DecorationConstants.METHOD);
    extractedClass.getMethodsCompartment().add(methodFigure);
  }
  Set<Entry<MethodObject,Map<MethodInvocationObject,Integer>>> internalMethodInvocation=data.getInternalMethodInvocationMap().entrySet();
  for (  Entry<MethodObject,Map<MethodInvocationObject,Integer>> entry : internalMethodInvocation) {
    MethodObject extractedMethod=entry.getKey();
    Map<MethodInvocationObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<MethodInvocationObject,Integer> map : connectionMap.entrySet()) {
      MethodInvocationObject method=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure methodFigure=new EntityFigure(method.getMethodName(),DecorationConstants.METHOD);
      for (      Object child : extractedClass.getMethodsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(methodFigure.getName())) {
          connections.add(connectionSource.addToSameClassMethodConnectionRR(ConnectionType.METHOD_CALL_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<MethodInvocationObject,Integer>> entry : data.getExternalMethodInvocationMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<MethodInvocationObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<MethodInvocationObject,Integer> map : connectionMap.entrySet()) {
      MethodInvocationObject method=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure methodFigure=new EntityFigure(method.getMethodName(),DecorationConstants.METHOD);
      boolean contains=false;
      for (      Object child : source.getMethodsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(methodFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceMethodConnection(ConnectionType.METHOD_CALL_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getMethodsCompartment().add(methodFigure);
        connections.add(connectionSource.addToSourceMethodConnection(ConnectionType.METHOD_CALL_SOURCE,methodFigure,occurences));
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getInternalFieldReadMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),DecorationConstants.FIELD);
      for (      Object child : extractedClass.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          connections.add(connectionSource.addToSameClassReadConnectionRR(ConnectionType.READ_FIELD_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getInternalFieldWriteMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),DecorationConstants.FIELD);
      for (      Object child : extractedClass.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          connections.add(connectionSource.addToSameClassWriteConnectionRR(ConnectionType.WRITE_FIELD_TARGET,entity,occurences,classWidth));
        }
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getExternalFieldReadMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),DecorationConstants.FIELD);
      boolean contains=false;
      for (      Object child : source.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceWeakReadConnection(ConnectionType.READ_FIELD_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getFieldsCompartment().add(fieldFigure);
        connections.add(connectionSource.addToSourceWeakReadConnection(ConnectionType.READ_FIELD_SOURCE,fieldFigure,occurences));
      }
    }
  }
  for (  Entry<MethodObject,Map<FieldInstructionObject,Integer>> entry : data.getExternalFieldWriteMap().entrySet()) {
    MethodObject extractedMethod=entry.getKey();
    Map<FieldInstructionObject,Integer> connectionMap=entry.getValue();
    EntityFigure connectionSource=null;
    for (    Object child : extractedClass.getMethodsCompartment().getChildren()) {
      EntityFigure entity=(EntityFigure)child;
      if (entity.getName().equals(extractedMethod.getName()))       connectionSource=entity;
    }
    for (    Entry<FieldInstructionObject,Integer> map : connectionMap.entrySet()) {
      FieldInstructionObject field=map.getKey();
      Integer occurences=map.getValue();
      EntityFigure fieldFigure=new EntityFigure(field.getName(),DecorationConstants.FIELD);
      boolean contains=false;
      for (      Object child : source.getFieldsCompartment().getChildren()) {
        EntityFigure entity=(EntityFigure)child;
        if (entity.getName().equals(fieldFigure.getName())) {
          contains=true;
          connections.add(connectionSource.addToSourceWeakWriteConnection(ConnectionType.WRITE_FIELD_SOURCE,entity,occurences));
        }
      }
      if (!contains) {
        source.getFieldsCompartment().add(fieldFigure);
        connections.add(connectionSource.addToSourceWeakWriteConnection(ConnectionType.WRITE_FIELD_SOURCE,fieldFigure,occurences));
      }
    }
  }
  int startPointX=100;
  int startPointY=50;
  int gap=300;
  primary.add(source,new Rectangle(startPointX,startPointY,classWidth,-1));
  primary.add(extractedClass,new Rectangle(startPointX + classWidth + gap,startPointY,classWidth,-1));
  root.add(connections,"String_Node_Str");
  this.canvas=new FigureCanvas(parent,SWT.DOUBLE_BUFFERED);
}