Program: 190173
Project: 190173
Buggy source:
public PartitionControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      workspace.add(new PartitionModelImpl());
    }
    public void select(    Workspace workspace){
      model=workspace.getLookup().lookup(PartitionModelImpl.class);
      refreshPartitions=true;
      GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
      trachViewChange(gm);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().addAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().addAttributeListener(PartitionControllerImpl.this);
    }
    public void unselect(    Workspace workspace){
      model=null;
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().removeAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().removeAttributeListener(PartitionControllerImpl.this);
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      untrackViewChange(null);
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    model=pc.getCurrentWorkspace().getLookup().lookup(PartitionModelImpl.class);
    if (model == null) {
      model=new PartitionModelImpl();
      Workspace workspace=pc.getCurrentWorkspace();
      pc.getCurrentWorkspace().add(new PartitionModelImpl());
      GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
      trachViewChange(gm);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().addAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().addAttributeListener(PartitionControllerImpl.this);
    }
  }
}

Fixed version (ground truth):
public PartitionControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      workspace.add(new PartitionModelImpl());
    }
    public void select(    Workspace workspace){
      model=workspace.getLookup().lookup(PartitionModelImpl.class);
      refreshPartitions=true;
      GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
      trachViewChange(gm);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().addAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().addAttributeListener(PartitionControllerImpl.this);
    }
    public void unselect(    Workspace workspace){
      model=null;
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().removeAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().removeAttributeListener(PartitionControllerImpl.this);
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      untrackViewChange(null);
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    refreshPartitions=true;
    model=pc.getCurrentWorkspace().getLookup().lookup(PartitionModelImpl.class);
    if (model == null) {
      model=new PartitionModelImpl();
      Workspace workspace=pc.getCurrentWorkspace();
      pc.getCurrentWorkspace().add(model);
      GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
      trachViewChange(gm);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.getNodeTable().addAttributeListener(PartitionControllerImpl.this);
      attributeModel.getEdgeTable().addAttributeListener(PartitionControllerImpl.this);
    }
  }
}