Program: 70572
Project: 70572
Buggy source:
private javax.swing.JToolBar buildToolBar(){
  panelToolbar=new javax.swing.JToolBar();
  panelToolbar.setLayout(new java.awt.GridBagLayout());
  panelToolbar.setEnabled(true);
  panelToolbar.setFloatable(false);
  panelToolbar.setRollover(true);
  panelToolbar.setPreferredSize(new java.awt.Dimension(1000,30));
  panelToolbar.setFont(new java.awt.Font("String_Node_Str",java.awt.Font.PLAIN,12));
  panelToolbar.setName("String_Node_Str");
  viewSelectedButton=new JButton("String_Node_Str");
  viewSelectedButton.setEnabled(false);
  ZapPropertiesManager.INSTANCE.setViewSelectedButton(viewSelectedButton);
  JButton optionsButton=new JButton("String_Node_Str");
  JButton importFromSourceButton=new JButton("String_Node_Str");
  importFromSourceButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean configured=OptionsDialog.ValidateSource(view);
      boolean completed=false;
      viewSelectedButton.setEnabled(false);
      ZapPropertiesManager.INSTANCE.setEndpointDecorator(null);
      if (configured) {
        try {
          EndpointDecorator[] endpoints=getEndpointsFromSource(ZapPropertiesManager.INSTANCE.getSourceFolder());
          EndpointDecorator comparePoints[]=null;
          String oldSourceFolder=ZapPropertiesManager.INSTANCE.getOldSourceFolder();
          if (oldSourceFolder != null && !oldSourceFolder.isEmpty())           comparePoints=getEndpointsFromSource(oldSourceFolder);
          if ((endpoints == null) || (endpoints.length == 0))           view.showWarningDialog("String_Node_Str");
 else {
            if (comparePoints != null && comparePoints.length != 0)             endpoints=compareEndpoints(endpoints,comparePoints,view);
            fillEndpointsToTable(endpoints);
            buildNodesFromEndpoints(endpoints);
            String url=ZapPropertiesManager.INSTANCE.getTargetUrl();
            if (url != null) {
              completed=attackUrl(url,view);
              if (!completed)               view.showWarningDialog("String_Node_Str");
            }
 else             view.showMessageDialog("String_Node_Str");
          }
        }
 catch (        Exception ex) {
          LOGGER.debug(ex.getStackTrace());
          JOptionPane.showMessageDialog(view.getMainFrame(),"String_Node_Str");
        }
      }
      if (completed)       view.showMessageDialog("String_Node_Str");
    }
  }
);
  JButton importFromJsonButton=new JButton("String_Node_Str");
  importFromJsonButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean configured=OptionsDialog.ValidateJson(view);
      boolean completed=false;
      viewSelectedButton.setEnabled(false);
      ZapPropertiesManager.INSTANCE.setEndpointDecorator(null);
      if (configured) {
        try {
          EndpointDecorator[] endpoints=getEndpointsFromJson(ZapPropertiesManager.INSTANCE.getJsonFile());
          EndpointDecorator comparePoints[]=null;
          String oldJsonFile=ZapPropertiesManager.INSTANCE.getOldJsonFile();
          if (oldJsonFile != null && !oldJsonFile.isEmpty())           comparePoints=getEndpointsFromJson(oldJsonFile);
          if ((endpoints == null) || (endpoints.length == 0))           view.showWarningDialog("String_Node_Str");
 else {
            if (comparePoints != null && comparePoints.length != 0)             endpoints=compareEndpoints(endpoints,comparePoints,view);
            fillEndpointsToTable(endpoints);
            buildNodesFromEndpoints(endpoints);
            String url=ZapPropertiesManager.INSTANCE.getTargetUrl();
            if (url != null) {
              completed=attackUrl(url,view);
              if (!completed)               view.showWarningDialog("String_Node_Str");
            }
 else             view.showMessageDialog("String_Node_Str");
          }
        }
 catch (        Exception ex) {
          LOGGER.debug(ex.getStackTrace());
          JOptionPane.showMessageDialog(view.getMainFrame(),"String_Node_Str");
        }
      }
      if (completed)       view.showMessageDialog("String_Node_Str");
    }
  }
);
  optionsButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean shouldContinue=OptionsDialog.show(view);
    }
  }
);
  viewSelectedButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      JPanel detailPanel=new JPanel();
      detailPanel.setLayout(new GridBagLayout());
      JLabel displayArea=new JLabel();
      String displayStr=new String();
      int y=0;
      GridBagConstraints gridBagConstraints1=new GridBagConstraints();
      gridBagConstraints1.gridx=0;
      gridBagConstraints1.gridy=y++;
      gridBagConstraints1.weightx=1.0D;
      gridBagConstraints1.insets=new java.awt.Insets(4,4,4,4);
      gridBagConstraints1.fill=java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints1.anchor=java.awt.GridBagConstraints.NORTHWEST;
      EndpointDecorator decorator=ZapPropertiesManager.INSTANCE.getEndpointDecorator();
      Endpoint.Info endpoint=decorator.getEndpoint();
      if (endpoint != null) {
        if (decorator.getStatus() == EndpointDecorator.Status.NEW) {
          displayStr="String_Node_Str";
          displayStr=displayStr + "String_Node_Str";
        }
 else         displayStr=displayStr + "String_Node_Str";
        displayStr=displayStr + "String_Node_Str" + endpoint.getUrlPath()+ "String_Node_Str";
        if (endpoint.getHttpMethod().length() > 4)         displayStr=displayStr + endpoint.getHttpMethod().substring(14);
 else         displayStr=displayStr + endpoint.getHttpMethod();
        displayStr=displayStr + "String_Node_Str";
        if (decorator.getStatus() == EndpointDecorator.Status.CHANGED) {
          for (          Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
            boolean found=false;
            for (            Map.Entry<String,RouteParameter> compParameter : decorator.getComparePoint().getParameters().entrySet()) {
              if (parameter.getKey().equalsIgnoreCase(compParameter.getKey())) {
                found=true;
                if (!parameter.getValue().getDataType().getDisplayName().equals(compParameter.getValue().getDataType().getDisplayName()))                 displayStr=displayStr + "String_Node_Str" + parameter.getKey()+ "String_Node_Str"+ compParameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
 else                 displayStr=displayStr + parameter.getKey() + "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName()+ "String_Node_Str";
                break;
              }
            }
            if (!found)             displayStr=displayStr + "String_Node_Str" + parameter.getKey()+ "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
          }
          for (          Map.Entry<String,RouteParameter> compParameter : decorator.getComparePoint().getParameters().entrySet()) {
            boolean found=false;
            for (            Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
              if (parameter.getKey().equalsIgnoreCase(compParameter.getKey())) {
                found=true;
                break;
              }
            }
            if (!found)             displayStr=displayStr + "String_Node_Str" + compParameter.getKey()+ "String_Node_Str"+ compParameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
          }
        }
 else {
          for (          Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
            displayStr=displayStr + parameter.getKey() + "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName()+ "String_Node_Str";
          }
        }
        displayStr=displayStr + "String_Node_Str";
        displayArea.setText(displayStr);
        detailPanel.add(displayArea,gridBagConstraints1);
      }
 else       detailPanel.add(new JLabel("String_Node_Str"));
      JOptionPane.showMessageDialog(view.getMainFrame(),detailPanel,"String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
    }
  }
);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new GridBagLayout());
  int x=0;
  GridBagConstraints gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(4,4,4,4);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(importFromSourceButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(4,4,4,4);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(importFromJsonButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  gridBagConstraints.weightx=1.0;
  gridBagConstraints.weighty=1.0;
  buttonPanel.add(viewSelectedButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(optionsButton,gridBagConstraints);
  GridBagConstraints toolConstraints=new GridBagConstraints();
  toolConstraints.gridx=0;
  toolConstraints.gridy=0;
  toolConstraints.insets=new java.awt.Insets(4,4,4,4);
  toolConstraints.anchor=GridBagConstraints.WEST;
  toolConstraints.weightx=1.0;
  toolConstraints.weighty=1.0;
  panelToolbar.add(buttonPanel,toolConstraints);
  return panelToolbar;
}

Fixed version (ground truth):
private javax.swing.JToolBar buildToolBar(){
  panelToolbar=new javax.swing.JToolBar();
  panelToolbar.setLayout(new java.awt.GridBagLayout());
  panelToolbar.setEnabled(true);
  panelToolbar.setFloatable(false);
  panelToolbar.setRollover(true);
  panelToolbar.setPreferredSize(new java.awt.Dimension(1000,30));
  panelToolbar.setMinimumSize(new java.awt.Dimension(1000,30));
  panelToolbar.setMaximumSize(new java.awt.Dimension(1000,30));
  panelToolbar.setFont(new java.awt.Font("String_Node_Str",java.awt.Font.PLAIN,12));
  panelToolbar.setName("String_Node_Str");
  viewSelectedButton=new JButton("String_Node_Str");
  viewSelectedButton.setEnabled(false);
  ZapPropertiesManager.INSTANCE.setViewSelectedButton(viewSelectedButton);
  JButton optionsButton=new JButton("String_Node_Str");
  JButton importFromSourceButton=new JButton("String_Node_Str");
  importFromSourceButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean configured=OptionsDialog.ValidateSource(view);
      boolean completed=false;
      viewSelectedButton.setEnabled(false);
      ZapPropertiesManager.INSTANCE.setEndpointDecorator(null);
      if (configured) {
        try {
          EndpointDecorator[] endpoints=getEndpointsFromSource(ZapPropertiesManager.INSTANCE.getSourceFolder());
          EndpointDecorator comparePoints[]=null;
          String oldSourceFolder=ZapPropertiesManager.INSTANCE.getOldSourceFolder();
          if (oldSourceFolder != null && !oldSourceFolder.isEmpty())           comparePoints=getEndpointsFromSource(oldSourceFolder);
          if ((endpoints == null) || (endpoints.length == 0))           view.showWarningDialog("String_Node_Str");
 else {
            if (comparePoints != null && comparePoints.length != 0)             endpoints=compareEndpoints(endpoints,comparePoints,view);
            fillEndpointsToTable(endpoints);
            buildNodesFromEndpoints(endpoints);
            String url=ZapPropertiesManager.INSTANCE.getTargetUrl();
            if (url != null) {
              completed=attackUrl(url,view);
              if (!completed)               view.showWarningDialog("String_Node_Str");
            }
 else             view.showMessageDialog("String_Node_Str");
          }
        }
 catch (        Exception ex) {
          LOGGER.debug(ex.getStackTrace());
          JOptionPane.showMessageDialog(view.getMainFrame(),"String_Node_Str");
        }
      }
      if (completed)       view.showMessageDialog("String_Node_Str");
    }
  }
);
  JButton importFromJsonButton=new JButton("String_Node_Str");
  importFromJsonButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean configured=OptionsDialog.ValidateJson(view);
      boolean completed=false;
      viewSelectedButton.setEnabled(false);
      ZapPropertiesManager.INSTANCE.setEndpointDecorator(null);
      if (configured) {
        try {
          EndpointDecorator[] endpoints=getEndpointsFromJson(ZapPropertiesManager.INSTANCE.getJsonFile());
          EndpointDecorator comparePoints[]=null;
          String oldJsonFile=ZapPropertiesManager.INSTANCE.getOldJsonFile();
          if (oldJsonFile != null && !oldJsonFile.isEmpty())           comparePoints=getEndpointsFromJson(oldJsonFile);
          if ((endpoints == null) || (endpoints.length == 0))           view.showWarningDialog("String_Node_Str");
 else {
            if (comparePoints != null && comparePoints.length != 0)             endpoints=compareEndpoints(endpoints,comparePoints,view);
            fillEndpointsToTable(endpoints);
            buildNodesFromEndpoints(endpoints);
            String url=ZapPropertiesManager.INSTANCE.getTargetUrl();
            if (url != null) {
              completed=attackUrl(url,view);
              if (!completed)               view.showWarningDialog("String_Node_Str");
            }
 else             view.showMessageDialog("String_Node_Str");
          }
        }
 catch (        Exception ex) {
          LOGGER.debug(ex.getStackTrace());
          JOptionPane.showMessageDialog(view.getMainFrame(),"String_Node_Str");
        }
      }
      if (completed)       view.showMessageDialog("String_Node_Str");
    }
  }
);
  optionsButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      boolean shouldContinue=OptionsDialog.show(view);
    }
  }
);
  viewSelectedButton.addActionListener(new java.awt.event.ActionListener(){
    @Override public void actionPerformed(    java.awt.event.ActionEvent e){
      JPanel detailPanel=new JPanel();
      detailPanel.setLayout(new GridBagLayout());
      JLabel displayArea=new JLabel();
      String displayStr=new String();
      int y=0;
      GridBagConstraints gridBagConstraints1=new GridBagConstraints();
      gridBagConstraints1.gridx=0;
      gridBagConstraints1.gridy=y++;
      gridBagConstraints1.weightx=1.0D;
      gridBagConstraints1.insets=new java.awt.Insets(4,4,4,4);
      gridBagConstraints1.fill=java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints1.anchor=java.awt.GridBagConstraints.NORTHWEST;
      EndpointDecorator decorator=ZapPropertiesManager.INSTANCE.getEndpointDecorator();
      Endpoint.Info endpoint=decorator.getEndpoint();
      if (endpoint != null) {
        if (decorator.getStatus() == EndpointDecorator.Status.NEW) {
          displayStr="String_Node_Str";
          displayStr=displayStr + "String_Node_Str";
        }
 else         displayStr=displayStr + "String_Node_Str";
        displayStr=displayStr + "String_Node_Str" + endpoint.getUrlPath()+ "String_Node_Str";
        if (endpoint.getHttpMethod().length() > 4)         displayStr=displayStr + endpoint.getHttpMethod().substring(14);
 else         displayStr=displayStr + endpoint.getHttpMethod();
        displayStr=displayStr + "String_Node_Str";
        if (decorator.getStatus() == EndpointDecorator.Status.CHANGED) {
          for (          Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
            boolean found=false;
            for (            Map.Entry<String,RouteParameter> compParameter : decorator.getComparePoint().getParameters().entrySet()) {
              if (parameter.getKey().equalsIgnoreCase(compParameter.getKey())) {
                found=true;
                if (!parameter.getValue().getDataType().getDisplayName().equals(compParameter.getValue().getDataType().getDisplayName()))                 displayStr=displayStr + "String_Node_Str" + parameter.getKey()+ "String_Node_Str"+ compParameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
 else                 displayStr=displayStr + parameter.getKey() + "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName()+ "String_Node_Str";
                break;
              }
            }
            if (!found)             displayStr=displayStr + "String_Node_Str" + parameter.getKey()+ "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
          }
          for (          Map.Entry<String,RouteParameter> compParameter : decorator.getComparePoint().getParameters().entrySet()) {
            boolean found=false;
            for (            Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
              if (parameter.getKey().equalsIgnoreCase(compParameter.getKey())) {
                found=true;
                break;
              }
            }
            if (!found)             displayStr=displayStr + "String_Node_Str" + compParameter.getKey()+ "String_Node_Str"+ compParameter.getValue().getDataType().getDisplayName().toUpperCase()+ "String_Node_Str";
          }
        }
 else {
          for (          Map.Entry<String,RouteParameter> parameter : endpoint.getParameters().entrySet()) {
            displayStr=displayStr + parameter.getKey() + "String_Node_Str"+ parameter.getValue().getDataType().getDisplayName()+ "String_Node_Str";
          }
        }
        displayStr=displayStr + "String_Node_Str";
        displayArea.setText(displayStr);
        detailPanel.add(displayArea,gridBagConstraints1);
      }
 else       detailPanel.add(new JLabel("String_Node_Str"));
      JOptionPane.showMessageDialog(view.getMainFrame(),detailPanel,"String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
    }
  }
);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new GridBagLayout());
  int x=0;
  GridBagConstraints gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(importFromSourceButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(importFromJsonButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  gridBagConstraints.weightx=1.0;
  gridBagConstraints.weighty=1.0;
  buttonPanel.add(viewSelectedButton,gridBagConstraints);
  gridBagConstraints=new GridBagConstraints();
  gridBagConstraints.gridx=x++;
  gridBagConstraints.gridy=0;
  gridBagConstraints.insets=new java.awt.Insets(0,0,0,0);
  gridBagConstraints.anchor=GridBagConstraints.WEST;
  buttonPanel.add(optionsButton,gridBagConstraints);
  GridBagConstraints toolConstraints=new GridBagConstraints();
  toolConstraints.gridx=0;
  toolConstraints.gridy=0;
  toolConstraints.insets=new java.awt.Insets(4,4,4,4);
  toolConstraints.anchor=GridBagConstraints.WEST;
  toolConstraints.weightx=1.0;
  toolConstraints.weighty=1.0;
  panelToolbar.add(buttonPanel,toolConstraints);
  return panelToolbar;
}