	/**
	 * Gets all the file indexes from the given folder
	 *
	 * @param path
	 *          - the folder from which to get the file indexes
	 * @return a list containing the file indexes
	 */
	public List<Integer> getRows(String path) {
		List<Integer> rows = new ArrayList<>();

		for (int i = 0; i < filesStatus.size(); i++) {
			if (filesStatus.get(i).getFileLocation().contains(path)) {
				rows.add(i);
			}

		}
		return rows;
	}

	/**
	 * Gets all the file indexes from the given folder
	 *
	 * @param path
	 *          - the folder from which to get the file indexes
	 * @return a list containing the file indexes
	 */
	public List<Integer> getRows(String path) {
		List<Integer> rows = new ArrayList<Integer>();

		for (int i = 0; i < filesStatus.size(); i++) {
			if (filesStatus.get(i).getFileLocation().contains(path)) {
				rows.add(i);
			}

		}
		return rows;
	}

Replace Generic With Diamond ArrayList<Integer> with ArrayList<> in method public getRows(path String) : List<Integer> from class com.oxygenxml.git.view.StagingResourcesTableModel


	/**
	 * Return the files from the given paths
	 *
	 * @param selectedPaths
	 *          - the paths
	 * @return a list containing the files from the path
	 */
	public List<FileStatus> getFilesByPaths(List<String> selectedPaths) {
	  List<FileStatus> containingPaths = new ArrayList<>();
	  for (String path : selectedPaths) {
	    synchronized (filesStatuses) {
	      for (FileStatus fileStatus : filesStatuses) {
	        if (fileStatus.getFileLocation().startsWith(path)) {
	          containingPaths.add(new FileStatus(fileStatus));
	        }
	      }
	    }
	  }
	  return containingPaths;
	}

	/**
	 * Return the files from the given paths
	 *
	 * @param selectedPaths
	 *          - the paths
	 * @return a list containing the files from the path
	 */
	public List<FileStatus> getFilesByPaths(List<String> selectedPaths) {
	  List<FileStatus> containingPaths = new ArrayList<FileStatus>();
	  for (String path : selectedPaths) {
	    synchronized (filesStatuses) {
	      for (FileStatus fileStatus : filesStatuses) {
	        if (fileStatus.getFileLocation().startsWith(path)) {
	          containingPaths.add(new FileStatus(fileStatus));
	        }
	      }
	    }
	  }
	  return containingPaths;
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getFilesByPaths(selectedPaths List<String>) : List<FileStatus> from class com.oxygenxml.git.view.StagingResourcesTreeModel


	/**
   * Return the files corresponding to leaves from the given paths.
   *
   * @param selectedPaths The selected paths.
   *
   * @return a list containing the files from the path.
   */
	public List<FileStatus> getFileLeavesByPaths(List<String> selectedPaths) {
	  List<FileStatus> containingPaths = new ArrayList<>();
	  for (String path : selectedPaths) {
	    synchronized (filesStatuses) {
	      for (FileStatus fileStatus : filesStatuses) {
	        if (fileStatus.getFileLocation().equals(path)) {
	          containingPaths.add(new FileStatus(fileStatus));
	        }
	      }
	    }
	  }
	  return containingPaths;
	}

	/**
   * Return the files corresponding to leaves from the given paths.
   *
   * @param selectedPaths The selected paths.
   *
   * @return a list containing the files from the path.
   */
	public List<FileStatus> getFileLeavesByPaths(List<String> selectedPaths) {
	  List<FileStatus> containingPaths = new ArrayList<FileStatus>();
	  for (String path : selectedPaths) {
	    synchronized (filesStatuses) {
	      for (FileStatus fileStatus : filesStatuses) {
	        if (fileStatus.getFileLocation().equals(path)) {
	          containingPaths.add(new FileStatus(fileStatus));
	        }
	      }
	    }
	  }
	  return containingPaths;
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getFileLeavesByPaths(selectedPaths List<String>) : List<FileStatus> from class com.oxygenxml.git.view.StagingResourcesTreeModel


	/**
	 * Sorts the given node
	 *
	 * @param parent
	 *          - the node to be sorted
	 */
	private void sort(GitTreeNode parent) {
		int n = parent.getChildCount();
		List<GitTreeNode> children = new ArrayList<>(n);
		for (int i = 0; i < n; i++) {
			children.add((GitTreeNode) parent.getChildAt(i));
		}
		Collections.sort(children, new NodeTreeComparator());
		parent.removeAllChildren();
		for (MutableTreeNode node : children) {
			parent.add(node);
		}
	}

	/**
	 * Sorts the given node
	 *
	 * @param parent
	 *          - the node to be sorted
	 */
	private void sort(GitTreeNode parent) {
		int n = parent.getChildCount();
		List<GitTreeNode> children = new ArrayList<GitTreeNode>(n);
		for (int i = 0; i < n; i++) {
			children.add((GitTreeNode) parent.getChildAt(i));
		}
		Collections.sort(children, new NodeTreeComparator());
		parent.removeAllChildren();
		for (MutableTreeNode node : children) {
			parent.add(node);
		}
	}

Replace Generic With Diamond ArrayList<GitTreeNode> with ArrayList<> in method private sort(parent GitTreeNode) : void from class com.oxygenxml.git.view.StagingResourcesTreeModel


  /**
   * Change the files stage state from unstaged to staged or from staged to
   * unstaged
   *
   * @param selectedFiles
   *          - the files to change their stage state
   */
  public void switchAllFilesStageState() {
    List<FileStatus> filesToBeUpdated = new ArrayList<>();
    synchronized (filesStatuses) {
      for (FileStatus fileStatus : filesStatuses) {
        if (fileStatus.getChangeType() != GitChangeType.CONFLICT) {
          filesToBeUpdated.add(fileStatus);
        }
      }
    }

    GitCommand action = GitCommand.UNSTAGE;
    if (!inIndex) {
      action = GitCommand.STAGE;
    }

    stageController.doGitCommand(filesToBeUpdated, action);
  }

  /**
   * Change the files stage state from unstaged to staged or from staged to
   * unstaged
   *
   * @param selectedFiles
   *          - the files to change their stage state
   */
  public void switchAllFilesStageState() {
    List<FileStatus> filesToBeUpdated = new ArrayList<FileStatus>();
    synchronized (filesStatuses) {
      for (FileStatus fileStatus : filesStatuses) {
        if (fileStatus.getChangeType() != GitChangeType.CONFLICT) {
          filesToBeUpdated.add(fileStatus);
        }
      }
    }

    GitCommand action = GitCommand.UNSTAGE;
    if (!inIndex) {
      action = GitCommand.STAGE;
    }

    stageController.doGitCommand(filesToBeUpdated, action);
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public switchAllFilesStageState() : void from class com.oxygenxml.git.view.StagingResourcesTreeModel


	/**
	 * Adds the combo box to the panel
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addWorkingCopySelector(GridBagConstraints gbc) {
	  gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
	      UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	  gbc.anchor = GridBagConstraints.WEST;
	  gbc.fill = GridBagConstraints.HORIZONTAL;
	  gbc.gridx = 1;
	  gbc.gridy = 0;
	  gbc.weightx = 1;
	  gbc.weighty = 1;

	  workingCopyCombo = new JComboBox<>();
	  WorkingCopyToolTipRenderer renderer = new WorkingCopyToolTipRenderer();
	  workingCopyCombo.setRenderer(renderer);
	  int height = (int) workingCopyCombo.getPreferredSize().getHeight();
	  workingCopyCombo.setMinimumSize(new Dimension(10, height));

	  addWorkingCopySelectorListener();

	  // Populates the combo box with the previously added repositories. Basically
	  // restore the state before the application was closed
	  loadEntries();
	  this.add(workingCopyCombo, gbc);
	}

	/**
	 * Adds the combo box to the panel
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addWorkingCopySelector(GridBagConstraints gbc) {
	  gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
	      UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	  gbc.anchor = GridBagConstraints.WEST;
	  gbc.fill = GridBagConstraints.HORIZONTAL;
	  gbc.gridx = 1;
	  gbc.gridy = 0;
	  gbc.weightx = 1;
	  gbc.weighty = 1;

	  workingCopyCombo = new JComboBox<String>();
	  WorkingCopyToolTipRenderer renderer = new WorkingCopyToolTipRenderer();
	  workingCopyCombo.setRenderer(renderer);
	  int height = (int) workingCopyCombo.getPreferredSize().getHeight();
	  workingCopyCombo.setMinimumSize(new Dimension(10, height));

	  addWorkingCopySelectorListener();

	  // Populates the combo box with the previously added repositories. Basically
	  // restore the state before the application was closed
	  loadEntries();
	  this.add(workingCopyCombo, gbc);
	}

Replace Generic With Diamond JComboBox<String> with JComboBox<> in method private addWorkingCopySelector(gbc GridBagConstraints) : void from class com.oxygenxml.git.view.WorkingCopySelectionPanel


	/**
	 * Load the recorded workinf copy locations into the combo.
	 */
  private void loadEntries() {
    List<String> repositoryEntries = new ArrayList<>(OptionsManager.getInstance().getRepositoryEntries());
    for (String repositoryEntry : repositoryEntries) {
			workingCopyCombo.addItem(repositoryEntry);
		}

    String repositoryPath = OptionsManager.getInstance().getSelectedRepository();
    if (!repositoryPath.equals("")) {
      workingCopyCombo.setSelectedItem(repositoryPath);
    } else if (workingCopyCombo.getItemCount() > 0) {
      workingCopyCombo.setSelectedIndex(0);
    }
  }

	/**
	 * Load the recorded workinf copy locations into the combo.
	 */
  private void loadEntries() {
    List<String> repositoryEntries = new ArrayList<String>(OptionsManager.getInstance().getRepositoryEntries());
    for (String repositoryEntry : repositoryEntries) {
			workingCopyCombo.addItem(repositoryEntry);
		}

    String repositoryPath = OptionsManager.getInstance().getSelectedRepository();
    if (!repositoryPath.equals("")) {
      workingCopyCombo.setSelectedItem(repositoryPath);
    } else if (workingCopyCombo.getItemCount() > 0) {
      workingCopyCombo.setSelectedIndex(0);
    }
  }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private loadEntries() : void from class com.oxygenxml.git.view.WorkingCopySelectionPanel


	private void createGUI() {
		JPanel panel = new JPanel(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();

		JLabel lblURL = new JLabel(translator.getTranslation(Tags.CLONE_REPOSITORY_DIALOG_URL_LABEL) + ":");
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 0;
		gbc.gridy = 0;
		panel.add(lblURL, gbc);

		sourceUrlTextField = UIUtil.createTextField();
		sourceUrlTextField.setPreferredSize(new Dimension(350, sourceUrlTextField.getPreferredSize().height));
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridx = 1;
		gbc.gridy = 0;
		gbc.gridwidth = 2;
		panel.add(sourceUrlTextField, gbc);

		JLabel lblPath = new JLabel(translator.getTranslation(Tags.CLONE_REPOSITORY_DIALOG_DESTINATION_PATH_LABEL));
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 0;
		gbc.gridy = 1;
		gbc.gridwidth = 1;
		panel.add(lblPath, gbc);

		destinationPathCombo = new JComboBox<>();
		UndoSupportInstaller.installUndoManager(((JTextComponent) destinationPathCombo.getEditor().getEditorComponent()));
		destinationPathCombo.setEditable(true);
		List<String> destinationPaths = OptionsManager.getInstance().getDestinationPaths();
		for (String string : destinationPaths) {
			destinationPathCombo.addItem(string);
		}
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridx = 1;
		gbc.gridy = 1;
		panel.add(destinationPathCombo, gbc);

		Action browseButtonAction = new AbstractAction() {

			@Override
      public void actionPerformed(ActionEvent e) {
				File directory = ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace()).chooseDirectory();
				if (directory != null) {
					destinationPathCombo.setSelectedItem(directory.getAbsolutePath());
				}
			}
		};
		ToolbarButton browseButton = new ToolbarButton(browseButtonAction, false);
		ImageUtilities imageUtilities = PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities();
		URL resource = getClass().getResource(ImageConstants.FILE_CHOOSER_ICON);
		if (resource != null) {
		  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
		  browseButton.setIcon(icon);
		}
		browseButton.setToolTipText(translator.getTranslation(Tags.BROWSE_BUTTON_TOOLTIP));
		browseButton.setOpaque(false);

		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 2;
		gbc.gridy = 1;
		panel.add(browseButton, gbc);

		informationLabel = new JLabel();
		informationLabel.setForeground(Color.RED);
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 0;
		gbc.gridy = 2;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridwidth = 3;
		panel.add(informationLabel, gbc);

		this.add(panel, BorderLayout.NORTH);
	}

	private void createGUI() {
		JPanel panel = new JPanel(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();

		JLabel lblURL = new JLabel(translator.getTranslation(Tags.CLONE_REPOSITORY_DIALOG_URL_LABEL) + ":");
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 0;
		gbc.gridy = 0;
		panel.add(lblURL, gbc);

		sourceUrlTextField = UIUtil.createTextField();
		sourceUrlTextField.setPreferredSize(new Dimension(350, sourceUrlTextField.getPreferredSize().height));
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridx = 1;
		gbc.gridy = 0;
		gbc.gridwidth = 2;
		panel.add(sourceUrlTextField, gbc);

		JLabel lblPath = new JLabel(translator.getTranslation(Tags.CLONE_REPOSITORY_DIALOG_DESTINATION_PATH_LABEL));
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 0;
		gbc.gridy = 1;
		gbc.gridwidth = 1;
		panel.add(lblPath, gbc);

		destinationPathCombo = new JComboBox<String>();
		UndoSupportInstaller.installUndoManager(((JTextComponent) destinationPathCombo.getEditor().getEditorComponent()));
		destinationPathCombo.setEditable(true);
		List<String> destinationPaths = OptionsManager.getInstance().getDestinationPaths();
		for (String string : destinationPaths) {
			destinationPathCombo.addItem(string);
		}
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridx = 1;
		gbc.gridy = 1;
		panel.add(destinationPathCombo, gbc);

		Action browseButtonAction = new AbstractAction() {

			@Override
      public void actionPerformed(ActionEvent e) {
				File directory = ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace()).chooseDirectory();
				if (directory != null) {
					destinationPathCombo.setSelectedItem(directory.getAbsolutePath());
				}
			}
		};
		ToolbarButton browseButton = new ToolbarButton(browseButtonAction, false);
		ImageUtilities imageUtilities = PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities();
		URL resource = getClass().getResource(ImageConstants.FILE_CHOOSER_ICON);
		if (resource != null) {
		  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
		  browseButton.setIcon(icon);
		}
		browseButton.setToolTipText(translator.getTranslation(Tags.BROWSE_BUTTON_TOOLTIP));
		browseButton.setOpaque(false);

		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.gridx = 2;
		gbc.gridy = 1;
		panel.add(browseButton, gbc);

		informationLabel = new JLabel();
		informationLabel.setForeground(Color.RED);
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 0;
		gbc.gridy = 2;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridwidth = 3;
		panel.add(informationLabel, gbc);

		this.add(panel, BorderLayout.NORTH);
	}

Replace Generic With Diamond JComboBox<String> with JComboBox<> in method private createGUI() : void from class com.oxygenxml.git.view.dialog.CloneRepositoryDialog


	/**
	 * Populates the combo box with data and adds it to the dialog
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addSubmoduleSelectCombo(GridBagConstraints gbc) {
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 1;
		gbc.gridy = 0;
		gbc.weightx = 1;
		gbc.weighty = 0;
		submoduleList = new JComboBox<>();
		submoduleList.setPreferredSize(new Dimension(200, submoduleList.getPreferredSize().height));
		for (String submodule : GitAccess.getInstance().getSubmodules()) {
			submoduleList.addItem(submodule);
		}
		getContentPane().add(submoduleList, gbc);
	}

	/**
	 * Populates the combo box with data and adds it to the dialog
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addSubmoduleSelectCombo(GridBagConstraints gbc) {
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 1;
		gbc.gridy = 0;
		gbc.weightx = 1;
		gbc.weighty = 0;
		submoduleList = new JComboBox<String>();
		submoduleList.setPreferredSize(new Dimension(200, submoduleList.getPreferredSize().height));
		for (String submodule : GitAccess.getInstance().getSubmodules()) {
			submoduleList.addItem(submodule);
		}
		getContentPane().add(submoduleList, gbc);
	}

Replace Generic With Diamond JComboBox<String> with JComboBox<> in method private addSubmoduleSelectCombo(gbc GridBagConstraints) : void from class com.oxygenxml.git.view.dialog.SubmoduleSelectDialog


	public List<FileStatus> getOldStates() {
	  List<FileStatus> fss = new LinkedList<>();
	  for (Iterator<String> iterator = changedFiles.iterator(); iterator.hasNext();) {
      String path = iterator.next();
      fss.add(new FileStatus(GitChangeType.UNKNOWN, path));
    }

	  return fss;
  }

	public List<FileStatus> getOldStates() {
	  List<FileStatus> fss = new LinkedList<FileStatus>();
	  for (Iterator<String> iterator = changedFiles.iterator(); iterator.hasNext();) {
      String path = iterator.next();
      fss.add(new FileStatus(GitChangeType.UNKNOWN, path));
    }

	  return fss;
  }

Replace Generic With Diamond LinkedList<FileStatus> with LinkedList<> in method public getOldStates() : List<FileStatus> from class com.oxygenxml.git.view.event.ChangeEvent


  /**
   * Get the Git-specific actions for the current selection from the Project view.
   */
  public List<AbstractAction> getActionsForProjectViewSelection() {
    List<AbstractAction> actions = new ArrayList<>();

    // Create the Git actions, if not already created
    if (commitAction == null) {
      createCommitAction();
    }
    if (gitDiffAction == null) {
      createGitDiffAction();
    }

    // Enable/disable
    commitAction.setEnabled(true);
    gitDiffAction.setEnabled(shouldEnableGitDiffAction());

    // Add the Git actions to the list
    actions.add(commitAction);
    actions.add(gitDiffAction);

    return actions;
  }

  /**
   * Get the Git-specific actions for the current selection from the Project view.
   */
  public List<AbstractAction> getActionsForProjectViewSelection() {
    List<AbstractAction> actions = new ArrayList<AbstractAction>();

    // Create the Git actions, if not already created
    if (commitAction == null) {
      createCommitAction();
    }
    if (gitDiffAction == null) {
      createGitDiffAction();
    }

    // Enable/disable
    commitAction.setEnabled(true);
    gitDiffAction.setEnabled(shouldEnableGitDiffAction());

    // Add the Git actions to the list
    actions.add(commitAction);
    actions.add(gitDiffAction);

    return actions;
  }

Replace Generic With Diamond ArrayList<AbstractAction> with ArrayList<> in method public getActionsForProjectViewSelection() : List<AbstractAction> from class com.oxygenxml.git.GitMenuActionsProvider


      @Override
      public void actionPerformed(ActionEvent e) {
        File[] selectedFiles = ProjectViewManager.getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
        // The diff action is enabled only for one file
        String repository = getRepositoryForFiles(selectedFiles);
        if (repository != null) {
          try {
            String previousRepository = OptionsManager.getInstance().getSelectedRepository();
            if (!repository.equals(previousRepository)) {
              GitAccess.getInstance().setRepository(repository);
            }

            List<FileStatus> gitFiles = new ArrayList<>();
            GitStatus status = GitAccess.getInstance().getStatus();
            gitFiles.addAll(status.getUnstagedFiles());
            gitFiles.addAll(status.getStagedFiles());

            String selectedFilePath = FileHelper.rewriteSeparator(selectedFiles[0].getAbsolutePath());
            for (FileStatus fileStatus : gitFiles) {
              if (selectedFilePath.endsWith(fileStatus.getFileLocation())) {
                DiffPresenter diff = new DiffPresenter(fileStatus, stageCtrl);
                diff.showDiff();
                break;
              }
            }
          } catch (Exception e1) {
            if (logger.isDebugEnabled()) {
              logger.debug(e1, e1);
            }
          }
        }
      }

      @Override
      public void actionPerformed(ActionEvent e) {
        File[] selectedFiles = ProjectViewManager.getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
        // The diff action is enabled only for one file
        String repository = getRepositoryForFiles(selectedFiles);
        if (repository != null) {
          try {
            String previousRepository = OptionsManager.getInstance().getSelectedRepository();
            if (!repository.equals(previousRepository)) {
              GitAccess.getInstance().setRepository(repository);
            }

            List<FileStatus> gitFiles = new ArrayList<FileStatus>();
            GitStatus status = GitAccess.getInstance().getStatus();
            gitFiles.addAll(status.getUnstagedFiles());
            gitFiles.addAll(status.getStagedFiles());

            String selectedFilePath = FileHelper.rewriteSeparator(selectedFiles[0].getAbsolutePath());
            for (FileStatus fileStatus : gitFiles) {
              if (selectedFilePath.endsWith(fileStatus.getFileLocation())) {
                DiffPresenter diff = new DiffPresenter(fileStatus, stageCtrl);
                diff.showDiff();
                break;
              }
            }
          } catch (Exception e1) {
            if (logger.isDebugEnabled()) {
              logger.debug(e1, e1);
            }
          }
        }
      }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public actionPerformed(e ActionEvent) : void from class com.oxygenxml.git.GitMenuActionsProvider.createGitDiffAction.new AbstractAction


  /**
   * Create the "Git Diff" action.
   */
  private void createGitDiffAction() {
    gitDiffAction = new AbstractAction(translator.getTranslation(Tags.PROJECT_VIEW_GIT_DIFF_CONTEXTUAL_MENU_ITEM)) {
      @Override
      public void actionPerformed(ActionEvent e) {
        File[] selectedFiles = ProjectViewManager.getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
        // The diff action is enabled only for one file
        String repository = getRepositoryForFiles(selectedFiles);
        if (repository != null) {
          try {
            String previousRepository = OptionsManager.getInstance().getSelectedRepository();
            if (!repository.equals(previousRepository)) {
              GitAccess.getInstance().setRepository(repository);
            }

            List<FileStatus> gitFiles = new ArrayList<>();
            GitStatus status = GitAccess.getInstance().getStatus();
            gitFiles.addAll(status.getUnstagedFiles());
            gitFiles.addAll(status.getStagedFiles());

            String selectedFilePath = FileHelper.rewriteSeparator(selectedFiles[0].getAbsolutePath());
            for (FileStatus fileStatus : gitFiles) {
              if (selectedFilePath.endsWith(fileStatus.getFileLocation())) {
                DiffPresenter diff = new DiffPresenter(fileStatus, stageCtrl);
                diff.showDiff();
                break;
              }
            }
          } catch (Exception e1) {
            if (logger.isDebugEnabled()) {
              logger.debug(e1, e1);
            }
          }
        }
      }
    };
  }

  /**
   * Create the "Git Diff" action.
   */
  private void createGitDiffAction() {
    gitDiffAction = new AbstractAction(translator.getTranslation(Tags.PROJECT_VIEW_GIT_DIFF_CONTEXTUAL_MENU_ITEM)) {
      @Override
      public void actionPerformed(ActionEvent e) {
        File[] selectedFiles = ProjectViewManager.getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
        // The diff action is enabled only for one file
        String repository = getRepositoryForFiles(selectedFiles);
        if (repository != null) {
          try {
            String previousRepository = OptionsManager.getInstance().getSelectedRepository();
            if (!repository.equals(previousRepository)) {
              GitAccess.getInstance().setRepository(repository);
            }

            List<FileStatus> gitFiles = new ArrayList<FileStatus>();
            GitStatus status = GitAccess.getInstance().getStatus();
            gitFiles.addAll(status.getUnstagedFiles());
            gitFiles.addAll(status.getStagedFiles());

            String selectedFilePath = FileHelper.rewriteSeparator(selectedFiles[0].getAbsolutePath());
            for (FileStatus fileStatus : gitFiles) {
              if (selectedFilePath.endsWith(fileStatus.getFileLocation())) {
                DiffPresenter diff = new DiffPresenter(fileStatus, stageCtrl);
                diff.showDiff();
                break;
              }
            }
          } catch (Exception e1) {
            if (logger.isDebugEnabled()) {
              logger.debug(e1, e1);
            }
          }
        }
      }
    };
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private createGitDiffAction() : void from class com.oxygenxml.git.GitMenuActionsProvider


/**
   * Stage files.
   *
   * @param repository The current repository.
   *
   * @return true if we have staged files.
   */
  private void stageFiles(String repository) {
    repository = FileHelper.rewriteSeparator(repository);

    List<FileStatus> unstagedFiles = GitAccess.getInstance().getUnstagedFiles();
    Set<String> allSelectedFiles = ProjectViewManager.getSelectedFilesDeep(pluginWorkspaceAccess);
    List<FileStatus> stagedFiles = new ArrayList<>();
    for (FileStatus unstagedFileStatus : unstagedFiles) {
      if (allSelectedFiles.contains(repository + "/" + unstagedFileStatus.getFileLocation())
          && unstagedFileStatus.getChangeType() != GitChangeType.CONFLICT) {
        stagedFiles.add(unstagedFileStatus);
      }
    }
    GitAccess.getInstance().addAll(stagedFiles);
  }

/**
   * Stage files.
   *
   * @param repository The current repository.
   *
   * @return true if we have staged files.
   */
  private void stageFiles(String repository) {
    repository = FileHelper.rewriteSeparator(repository);

    List<FileStatus> unstagedFiles = GitAccess.getInstance().getUnstagedFiles();
    Set<String> allSelectedFiles = ProjectViewManager.getSelectedFilesDeep(pluginWorkspaceAccess);
    List<FileStatus> stagedFiles = new ArrayList<FileStatus>();
    for (FileStatus unstagedFileStatus : unstagedFiles) {
      if (allSelectedFiles.contains(repository + "/" + unstagedFileStatus.getFileLocation())
          && unstagedFileStatus.getChangeType() != GitChangeType.CONFLICT) {
        stagedFiles.add(unstagedFileStatus);
      }
    }
    GitAccess.getInstance().addAll(stagedFiles);
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private stageFiles(repository String) : void from class com.oxygenxml.git.GitMenuActionsProvider


/**
   * Check if "Git diff" is enabled, based on the status of the selected files.
   *
   * @param selectedFile  The selected file.
   * @param repository    The current repository.
   *
   * @return true if "Git diff" should be enabled.
   */
  private boolean isGitDiffEnabledBasedOnSelectedFileStatus(File selectedFile, String repository) {
    boolean isEnabled = true;
    try {
      // Use the repository from the project view
      String previousRepository = OptionsManager.getInstance().getSelectedRepository();
      if (!repository.equals(previousRepository)) {
        GitAccess.getInstance().setRepository(repository);
      }

      List<FileStatus> gitFiles = new ArrayList<>();
      GitStatus status = GitAccess.getInstance().getStatus();
      gitFiles.addAll(status.getUnstagedFiles());
      gitFiles.addAll(status.getStagedFiles());

      FileStatus selectedFileStatus = null;
      String selectedFilePath = FileHelper.rewriteSeparator(selectedFile.getAbsolutePath());
      for (FileStatus gitFileStatus : gitFiles) {
        if (selectedFilePath.endsWith(gitFileStatus.getFileLocation())) {
          selectedFileStatus = new FileStatus(gitFileStatus);
          break;
        }
      }

      if (selectedFileStatus == null
          || selectedFileStatus.getChangeType() == GitChangeType.ADD
          || selectedFileStatus.getChangeType() == GitChangeType.UNTRACKED
          || selectedFileStatus.getChangeType() == GitChangeType.MISSING
          || selectedFileStatus.getChangeType() == GitChangeType.REMOVED) {

        isEnabled = false;
      }
    } catch (IOException e) {
      isEnabled = false;
      logger.error(e, e);
    }
    return isEnabled;
  }

/**
   * Check if "Git diff" is enabled, based on the status of the selected files.
   *
   * @param selectedFile  The selected file.
   * @param repository    The current repository.
   *
   * @return true if "Git diff" should be enabled.
   */
  private boolean isGitDiffEnabledBasedOnSelectedFileStatus(File selectedFile, String repository) {
    boolean isEnabled = true;
    try {
      // Use the repository from the project view
      String previousRepository = OptionsManager.getInstance().getSelectedRepository();
      if (!repository.equals(previousRepository)) {
        GitAccess.getInstance().setRepository(repository);
      }

      List<FileStatus> gitFiles = new ArrayList<FileStatus>();
      GitStatus status = GitAccess.getInstance().getStatus();
      gitFiles.addAll(status.getUnstagedFiles());
      gitFiles.addAll(status.getStagedFiles());

      FileStatus selectedFileStatus = null;
      String selectedFilePath = FileHelper.rewriteSeparator(selectedFile.getAbsolutePath());
      for (FileStatus gitFileStatus : gitFiles) {
        if (selectedFilePath.endsWith(gitFileStatus.getFileLocation())) {
          selectedFileStatus = new FileStatus(gitFileStatus);
          break;
        }
      }

      if (selectedFileStatus == null
          || selectedFileStatus.getChangeType() == GitChangeType.ADD
          || selectedFileStatus.getChangeType() == GitChangeType.UNTRACKED
          || selectedFileStatus.getChangeType() == GitChangeType.MISSING
          || selectedFileStatus.getChangeType() == GitChangeType.REMOVED) {

        isEnabled = false;
      }
    } catch (IOException e) {
      isEnabled = false;
      logger.error(e, e);
    }
    return isEnabled;
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private isGitDiffEnabledBasedOnSelectedFileStatus(selectedFile File, repository String) : boolean from class com.oxygenxml.git.GitMenuActionsProvider


	/**
	 * Get all the selected files + the files from inside the selected directories in the Project view.
	 *
	 * @param pluginWorkspaceAccess  Plug-in workspace access.
	 *
	 * @return the selected files and all the files from inside the selected directories in the Project view.
	 */
	public static Set<String> getSelectedFilesDeep(StandalonePluginWorkspace pluginWorkspaceAccess){
	  Set<String> files = new HashSet<>();

	  File[] selectedFiles = getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
	  if (selectedFiles != null) {
	    for (int i = 0; i < selectedFiles.length; i++) {
	      files.addAll(FileHelper.getAllFilesFromPath(selectedFiles[i].getAbsolutePath()));
	    }
	  }

	  return files;
	}

	/**
	 * Get all the selected files + the files from inside the selected directories in the Project view.
	 *
	 * @param pluginWorkspaceAccess  Plug-in workspace access.
	 *
	 * @return the selected files and all the files from inside the selected directories in the Project view.
	 */
	public static Set<String> getSelectedFilesDeep(StandalonePluginWorkspace pluginWorkspaceAccess){
	  Set<String> files = new HashSet<String>();

	  File[] selectedFiles = getSelectedFilesAndDirsShallow(pluginWorkspaceAccess);
	  if (selectedFiles != null) {
	    for (int i = 0; i < selectedFiles.length; i++) {
	      files.addAll(FileHelper.getAllFilesFromPath(selectedFiles[i].getAbsolutePath()));
	    }
	  }

	  return files;
	}

Replace Generic With Diamond HashSet<String> with HashSet<> in method public getSelectedFilesDeep(pluginWorkspaceAccess StandalonePluginWorkspace) : Set<String> from class com.oxygenxml.git.ProjectViewManager


	/**
	 * Makes a diff between the files from the last commit and the files from the
	 * working directory. If there are diffs, they will be saved and returned.
	 *
	 * @param paths A subset of interest.
	 *
	 * @return - A list with the files from the given set htat are un-staged as well as
	 * their states.
	 */
	private List<FileStatus> getUnstagedFiles(Status status) {
		List<FileStatus> unstagedFiles = new ArrayList<>();
		if (git != null) {
			try {
				Set<String> submodules = getSubmodules();

        if (logger.isDebugEnabled()) {
          logger.debug("submodules " + submodules);
        }

				for (String string : submodules) {
					SubmoduleStatus submoduleStatus = git.submoduleStatus().call().get(string);
					if (submoduleStatus != null
					    && submoduleStatus.getHeadId() != null
					    && !submoduleStatus.getHeadId().equals(submoduleStatus.getIndexId())) {
						unstagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, string));
					}
				}

				if (logger.isDebugEnabled()) {
				  logger.debug("untracked " + status.getUntracked());
				}

				for (String string : status.getUntracked()) {
				  // A newly created file, not yet in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.UNTRACKED, string));
					}
				}

        if (logger.isDebugEnabled()) {
          logger.debug("modified " + status.getModified());
        }

				for (String string : status.getModified()) {
				  // A file that was modified compared to the one from INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MODIFIED, string));
					}
				}

        if (logger.isDebugEnabled()) {
          logger.debug("missing " + status.getMissing());
        }

				for (String string : status.getMissing()) {
				  // A missing file that is present in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MISSING, string));
					}
				}

        for (String fileName : status.getConflicting()) {
          unstagedFiles.add(new FileStatus(GitChangeType.CONFLICT, fileName));
        }
			} catch (NoWorkTreeException | GitAPIException e1) {
				if (logger.isDebugEnabled()) {
					logger.debug(e1, e1);
				}
			}
		}
		return unstagedFiles;
	}

	/**
	 * Makes a diff between the files from the last commit and the files from the
	 * working directory. If there are diffs, they will be saved and returned.
	 *
	 * @param paths A subset of interest.
	 *
	 * @return - A list with the files from the given set htat are un-staged as well as
	 * their states.
	 */
	private List<FileStatus> getUnstagedFiles(Status status) {
		List<FileStatus> unstagedFiles = new ArrayList<FileStatus>();
		if (git != null) {
			try {
				Set<String> submodules = getSubmodules();

        if (logger.isDebugEnabled()) {
          logger.debug("submodules " + submodules);
        }

				for (String string : submodules) {
					SubmoduleStatus submoduleStatus = git.submoduleStatus().call().get(string);
					if (submoduleStatus != null
					    && submoduleStatus.getHeadId() != null
					    && !submoduleStatus.getHeadId().equals(submoduleStatus.getIndexId())) {
						unstagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, string));
					}
				}

				if (logger.isDebugEnabled()) {
				  logger.debug("untracked " + status.getUntracked());
				}

				for (String string : status.getUntracked()) {
				  // A newly created file, not yet in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.UNTRACKED, string));
					}
				}

        if (logger.isDebugEnabled()) {
          logger.debug("modified " + status.getModified());
        }

				for (String string : status.getModified()) {
				  // A file that was modified compared to the one from INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MODIFIED, string));
					}
				}

        if (logger.isDebugEnabled()) {
          logger.debug("missing " + status.getMissing());
        }

				for (String string : status.getMissing()) {
				  // A missing file that is present in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MISSING, string));
					}
				}

        for (String fileName : status.getConflicting()) {
          unstagedFiles.add(new FileStatus(GitChangeType.CONFLICT, fileName));
        }
			} catch (NoWorkTreeException | GitAPIException e1) {
				if (logger.isDebugEnabled()) {
					logger.debug(e1, e1);
				}
			}
		}
		return unstagedFiles;
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private getUnstagedFiles(status Status) : List<FileStatus> from class com.oxygenxml.git.service.GitAccess


	/**
	 * Returns a list with all the submodules name for the current repository
	 *
	 * @return a list containing all the submodules
	 */
	public Set<String> getSubmodules() {
		try {
			if (git != null) {
				return git.submoduleStatus().call().keySet();
			}
		} catch (GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		return new HashSet<>();
	}

	/**
	 * Returns a list with all the submodules name for the current repository
	 *
	 * @return a list containing all the submodules
	 */
	public Set<String> getSubmodules() {
		try {
			if (git != null) {
				return git.submoduleStatus().call().keySet();
			}
		} catch (GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		return new HashSet<String>();
	}

Replace Generic With Diamond HashSet<String> with HashSet<> in method public getSubmodules() : Set<String> from class com.oxygenxml.git.service.GitAccess


	private Collection<String> getPaths(List<FileStatus> files) {
	  List<String> paths = new LinkedList<>();
	  for (Iterator<FileStatus> iterator = files.iterator(); iterator.hasNext();) {
      FileStatus fileStatus = iterator.next();
      paths.add(fileStatus.getFileLocation());
    }

	  return paths;
  }

	private Collection<String> getPaths(List<FileStatus> files) {
	  List<String> paths = new LinkedList<String>();
	  for (Iterator<FileStatus> iterator = files.iterator(); iterator.hasNext();) {
      FileStatus fileStatus = iterator.next();
      paths.add(fileStatus.getFileLocation());
    }

	  return paths;
  }

Replace Generic With Diamond LinkedList<String> with LinkedList<> in method private getPaths(files List<FileStatus>) : Collection<String> from class com.oxygenxml.git.service.GitAccess


	/**
	 * Checks which files from the given subset are in the Index and returns their state.
	 *
	 * @param statusCmd Status command to execute.
	 *
	 * @return - a set containing the subset of files present in the INDEX.
	 */
  private List<FileStatus> getStagedFiles(Status status) {
    List<FileStatus> stagedFiles = new ArrayList<>();
    Set<String> submodules = getSubmodules();

    for (String fileName : status.getChanged()) {
      // File from INDEX, modified from HEAD
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.CHANGED, fileName));
      }
    }
    for (String fileName : status.getAdded()) {
      // Newly created files added in the INDEX
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.ADD, fileName));
      }
    }
    for (String fileName : status.getRemoved()) {
      // A delete added in the INDEX, file is present in HEAD.
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.REMOVED, fileName));
      }
    }

    return stagedFiles;
  }

	/**
	 * Checks which files from the given subset are in the Index and returns their state.
	 *
	 * @param statusCmd Status command to execute.
	 *
	 * @return - a set containing the subset of files present in the INDEX.
	 */
  private List<FileStatus> getStagedFiles(Status status) {
    List<FileStatus> stagedFiles = new ArrayList<FileStatus>();
    Set<String> submodules = getSubmodules();

    for (String fileName : status.getChanged()) {
      // File from INDEX, modified from HEAD
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.CHANGED, fileName));
      }
    }
    for (String fileName : status.getAdded()) {
      // Newly created files added in the INDEX
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.ADD, fileName));
      }
    }
    for (String fileName : status.getRemoved()) {
      // A delete added in the INDEX, file is present in HEAD.
      if (submodules.contains(fileName)) {
        stagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, fileName));
      } else {
        stagedFiles.add(new FileStatus(GitChangeType.REMOVED, fileName));
      }
    }

    return stagedFiles;
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private getStagedFiles(status Status) : List<FileStatus> from class com.oxygenxml.git.service.GitAccess


	/**
	 * Searches a given path for all files in that path. Generates the files paths
	 * relative to the given path.
	 *
	 * @param path The path to the folder you want to search.
	 *
	 * @return list of paths relative to the given path
	 */
	public static List<String> getAllFilesFromPath(String path) {
		File rootFolder = new File(path);
		List<String> fileNames = new ArrayList<>();
		if (rootFolder.isFile()) {
			fileNames.add(rewriteSeparator(rootFolder.getAbsolutePath()));
			return fileNames;
		}
		File[] listOfFiles = rootFolder.listFiles();

		for (int i = 0; i < listOfFiles.length; i++) {
			if (listOfFiles[i].isDirectory() && (!listOfFiles[i].getName().equals(".git"))) {
				fileNames.addAll(getAllFilesFromPath(listOfFiles[i].getAbsolutePath()));
			} else if (listOfFiles[i].isFile()) {
				fileNames.add(rewriteSeparator(listOfFiles[i].getAbsolutePath()));
			}
		}
		return fileNames;
	}

	/**
	 * Searches a given path for all files in that path. Generates the files paths
	 * relative to the given path.
	 *
	 * @param path The path to the folder you want to search.
	 *
	 * @return list of paths relative to the given path
	 */
	public static List<String> getAllFilesFromPath(String path) {
		File rootFolder = new File(path);
		List<String> fileNames = new ArrayList<String>();
		if (rootFolder.isFile()) {
			fileNames.add(rewriteSeparator(rootFolder.getAbsolutePath()));
			return fileNames;
		}
		File[] listOfFiles = rootFolder.listFiles();

		for (int i = 0; i < listOfFiles.length; i++) {
			if (listOfFiles[i].isDirectory() && (!listOfFiles[i].getName().equals(".git"))) {
				fileNames.addAll(getAllFilesFromPath(listOfFiles[i].getAbsolutePath()));
			} else if (listOfFiles[i].isFile()) {
				fileNames.add(rewriteSeparator(listOfFiles[i].getAbsolutePath()));
			}
		}
		return fileNames;
	}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getAllFilesFromPath(path String) : List<String> from class com.oxygenxml.git.utils.FileHelper


      @Override
      public void run() {
        List<FileStatus> newFiles = new ArrayList<>();
        List<FileStatus> filesInModel = null;

        filesInModel = panelToUpdate.getFilesStatuses();

        for (FileStatus fileStatus : filesInModel) {
          if (nfiles.contains(fileStatus)) {
            newFiles.add(fileStatus);
            nfiles.remove(fileStatus);
          }
        }
        newFiles.addAll(nfiles);

        if (logger.isDebugEnabled()) {
          logger.debug("New files      " + newFiles);
          logger.debug("Files in model " + filesInModel);
        }

        if (!newFiles.equals(filesInModel)) {
          String rootFolder = StagingPanel.NO_REPOSITORY;
          try {
            rootFolder = GitAccess.getInstance().getWorkingCopy().getName();
          } catch (NoRepositorySelected e) {
            // Never happens.
            logger.error(e, e);
          }

          panelToUpdate.update(rootFolder, newFiles);
        }
      }

      @Override
      public void run() {
        List<FileStatus> newFiles = new ArrayList<FileStatus>();
        List<FileStatus> filesInModel = null;

        filesInModel = panelToUpdate.getFilesStatuses();

        for (FileStatus fileStatus : filesInModel) {
          if (nfiles.contains(fileStatus)) {
            newFiles.add(fileStatus);
            nfiles.remove(fileStatus);
          }
        }
        newFiles.addAll(nfiles);

        if (logger.isDebugEnabled()) {
          logger.debug("New files      " + newFiles);
          logger.debug("Files in model " + filesInModel);
        }

        if (!newFiles.equals(filesInModel)) {
          String rootFolder = StagingPanel.NO_REPOSITORY;
          try {
            rootFolder = GitAccess.getInstance().getWorkingCopy().getName();
          } catch (NoRepositorySelected e) {
            // Never happens.
            logger.error(e, e);
          }

          panelToUpdate.update(rootFolder, newFiles);
        }
      }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public run() : void from class com.oxygenxml.git.utils.PanelRefresh.updateFiles.invokeLater.new Runnable


/**
	 * Updates the files in the model.
	 *
	 * @param unstaged true to update the local Working Copy files.
	 * false to update the INDEX.
	 */
	private void updateFiles(ChangesPanel panelToUpdate, final List<FileStatus> nfiles) {
	  SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        List<FileStatus> newFiles = new ArrayList<>();
        List<FileStatus> filesInModel = null;

        filesInModel = panelToUpdate.getFilesStatuses();

        for (FileStatus fileStatus : filesInModel) {
          if (nfiles.contains(fileStatus)) {
            newFiles.add(fileStatus);
            nfiles.remove(fileStatus);
          }
        }
        newFiles.addAll(nfiles);

        if (logger.isDebugEnabled()) {
          logger.debug("New files      " + newFiles);
          logger.debug("Files in model " + filesInModel);
        }

        if (!newFiles.equals(filesInModel)) {
          String rootFolder = StagingPanel.NO_REPOSITORY;
          try {
            rootFolder = GitAccess.getInstance().getWorkingCopy().getName();
          } catch (NoRepositorySelected e) {
            // Never happens.
            logger.error(e, e);
          }

          panelToUpdate.update(rootFolder, newFiles);
        }
      }
    });
	}

/**
	 * Updates the files in the model.
	 *
	 * @param unstaged true to update the local Working Copy files.
	 * false to update the INDEX.
	 */
	private void updateFiles(ChangesPanel panelToUpdate, final List<FileStatus> nfiles) {
	  SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        List<FileStatus> newFiles = new ArrayList<FileStatus>();
        List<FileStatus> filesInModel = null;

        filesInModel = panelToUpdate.getFilesStatuses();

        for (FileStatus fileStatus : filesInModel) {
          if (nfiles.contains(fileStatus)) {
            newFiles.add(fileStatus);
            nfiles.remove(fileStatus);
          }
        }
        newFiles.addAll(nfiles);

        if (logger.isDebugEnabled()) {
          logger.debug("New files      " + newFiles);
          logger.debug("Files in model " + filesInModel);
        }

        if (!newFiles.equals(filesInModel)) {
          String rootFolder = StagingPanel.NO_REPOSITORY;
          try {
            rootFolder = GitAccess.getInstance().getWorkingCopy().getName();
          } catch (NoRepositorySelected e) {
            // Never happens.
            logger.error(e, e);
          }

          panelToUpdate.update(rootFolder, newFiles);
        }
      }
    });
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private updateFiles(panelToUpdate ChangesPanel, nfiles List<FileStatus>) : void from class com.oxygenxml.git.utils.PanelRefresh


	public static List<String> getStringComonAncestor(JTree tree) {
		List<String> selectedFiles = new ArrayList<>();
		TreePath[] selectedPaths = tree.getSelectionPaths();
		List<TreePath> commonAncestors = TreeFormatter.getTreeCommonAncestors(selectedPaths);
		String fullPath = "";
		for (TreePath treePath : commonAncestors) {
			fullPath = TreeFormatter.getStringPath(treePath);
			selectedFiles.add(fullPath);
		}
		return selectedFiles;
	}

	public static List<String> getStringComonAncestor(JTree tree) {
		List<String> selectedFiles = new ArrayList<String>();
		TreePath[] selectedPaths = tree.getSelectionPaths();
		List<TreePath> commonAncestors = TreeFormatter.getTreeCommonAncestors(selectedPaths);
		String fullPath = "";
		for (TreePath treePath : commonAncestors) {
			fullPath = TreeFormatter.getStringPath(treePath);
			selectedFiles.add(fullPath);
		}
		return selectedFiles;
	}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getStringComonAncestor(tree JTree) : List<String> from class com.oxygenxml.git.utils.TreeFormatter


	private void addPreviouslyMessagesComboBox(GridBagConstraints gbc) {
		gbc.insets = new Insets(
		    UIConstants.COMPONENT_TOP_PADDING,
		    UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING,
			UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 0;
		gbc.gridy = 1;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridwidth = 2;
		previousMessages = new JComboBox<>();
		PreviousMessagesToolTipRenderer renderer = new PreviousMessagesToolTipRenderer();
		previousMessages.setRenderer(renderer);

		// Add the hint first.
		previousMessages.addItem(getCommitHistoryHint());
		for (String previouslyCommitMessage : OptionsManager.getInstance().getPreviouslyCommitedMessages()) {
			previousMessages.addItem(previouslyCommitMessage);
		}

		previousMessages.setSelectedItem(getCommitHistoryHint());

		previousMessages.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED
            && !previousMessages.getSelectedItem().equals(getCommitHistoryHint())) {
            commitMessage.setText((String) previousMessages.getSelectedItem());
        }
      }
    });

		int height = (int) previousMessages.getPreferredSize().getHeight();
		previousMessages.setMinimumSize(new Dimension(10, height));

		this.add(previousMessages, gbc);
	}

	private void addPreviouslyMessagesComboBox(GridBagConstraints gbc) {
		gbc.insets = new Insets(
		    UIConstants.COMPONENT_TOP_PADDING,
		    UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING,
			UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 0;
		gbc.gridy = 1;
		gbc.weightx = 1;
		gbc.weighty = 0;
		gbc.gridwidth = 2;
		previousMessages = new JComboBox<String>();
		PreviousMessagesToolTipRenderer renderer = new PreviousMessagesToolTipRenderer();
		previousMessages.setRenderer(renderer);

		// Add the hint first.
		previousMessages.addItem(getCommitHistoryHint());
		for (String previouslyCommitMessage : OptionsManager.getInstance().getPreviouslyCommitedMessages()) {
			previousMessages.addItem(previouslyCommitMessage);
		}

		previousMessages.setSelectedItem(getCommitHistoryHint());

		previousMessages.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED
            && !previousMessages.getSelectedItem().equals(getCommitHistoryHint())) {
            commitMessage.setText((String) previousMessages.getSelectedItem());
        }
      }
    });

		int height = (int) previousMessages.getPreferredSize().getHeight();
		previousMessages.setMinimumSize(new Dimension(10, height));

		this.add(previousMessages, gbc);
	}

Replace Generic With Diamond JComboBox<String> with JComboBox<> in method private addPreviouslyMessagesComboBox(gbc GridBagConstraints) : void from class com.oxygenxml.git.view.CommitPanel


	/**
	 * Return the table selected files
	 *
	 * @return table selected files
	 */
	private List<FileStatus> getTableSelectedFiles() {
		List<FileStatus> selectedFiles = new ArrayList<>();
		int[] selectedRows = null;
		StagingResourcesTableModel model = (StagingResourcesTableModel) filesTable.getModel();
		selectedRows = filesTable.getSelectedRows();
		if (selectedRows != null) {
			for (int i = 0; i < selectedRows.length; i++) {
				int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
				selectedFiles.add(model.getUnstageFile(convertedRow));
			}
		}
		return selectedFiles;
	}

	/**
	 * Return the table selected files
	 *
	 * @return table selected files
	 */
	private List<FileStatus> getTableSelectedFiles() {
		List<FileStatus> selectedFiles = new ArrayList<FileStatus>();
		int[] selectedRows = null;
		StagingResourcesTableModel model = (StagingResourcesTableModel) filesTable.getModel();
		selectedRows = filesTable.getSelectedRows();
		if (selectedRows != null) {
			for (int i = 0; i < selectedRows.length; i++) {
				int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
				selectedFiles.add(model.getUnstageFile(convertedRow));
			}
		}
		return selectedFiles;
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private getTableSelectedFiles() : List<FileStatus> from class com.oxygenxml.git.view.ChangesPanel


			@Override
      public void actionPerformed(ActionEvent e) {
			  List<FileStatus> fileStatuses = new ArrayList<>();
				if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
					int[] selectedRows = filesTable.getSelectedRows();
					StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
					for (int i = selectedRows.length - 1; i >= 0; i--) {
						int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
						FileStatus fileStatus = fileTableModel.getFileStatus(convertedRow);
						fileStatuses.add(fileStatus);
					}
				} else {
					List<String> selectedFiles = TreeFormatter.getStringComonAncestor(tree);
					StagingResourcesTreeModel fileTreeModel = (StagingResourcesTreeModel) tree.getModel();
					List<FileStatus> fileStatusesForPaths = fileTreeModel.getFilesByPaths(selectedFiles);
					fileStatuses.addAll(fileStatusesForPaths);
				}

	      // "Stage"/"Unstage" actions
	      AbstractAction stageUnstageAction = new StageUnstageResourceAction(
	          fileStatuses,
	          !forStagedResources,
	          stageController);
	      stageUnstageAction.actionPerformed(null);

				changeSelectedButton.setEnabled(false);
			}

			@Override
      public void actionPerformed(ActionEvent e) {
			  List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
				if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
					int[] selectedRows = filesTable.getSelectedRows();
					StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
					for (int i = selectedRows.length - 1; i >= 0; i--) {
						int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
						FileStatus fileStatus = fileTableModel.getFileStatus(convertedRow);
						fileStatuses.add(fileStatus);
					}
				} else {
					List<String> selectedFiles = TreeFormatter.getStringComonAncestor(tree);
					StagingResourcesTreeModel fileTreeModel = (StagingResourcesTreeModel) tree.getModel();
					List<FileStatus> fileStatusesForPaths = fileTreeModel.getFilesByPaths(selectedFiles);
					fileStatuses.addAll(fileStatusesForPaths);
				}

	      // "Stage"/"Unstage" actions
	      AbstractAction stageUnstageAction = new StageUnstageResourceAction(
	          fileStatuses,
	          !forStagedResources,
	          stageController);
	      stageUnstageAction.actionPerformed(null);

				changeSelectedButton.setEnabled(false);
			}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public actionPerformed(e ActionEvent) : void from class com.oxygenxml.git.view.ChangesPanel.addChangeSelectedButtonListener.addActionListener.new ActionListener


	/**
	 * Adds a listener on the changeSelected button: When clicked all the files
	 * selected will go in the staging or unstaging area, depending on the
	 * forStaging variable
	 */
	private void addChangeSelectedButtonListener() {
		changeSelectedButton.addActionListener(new ActionListener() {
			@Override
      public void actionPerformed(ActionEvent e) {
			  List<FileStatus> fileStatuses = new ArrayList<>();
				if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
					int[] selectedRows = filesTable.getSelectedRows();
					StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
					for (int i = selectedRows.length - 1; i >= 0; i--) {
						int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
						FileStatus fileStatus = fileTableModel.getFileStatus(convertedRow);
						fileStatuses.add(fileStatus);
					}
				} else {
					List<String> selectedFiles = TreeFormatter.getStringComonAncestor(tree);
					StagingResourcesTreeModel fileTreeModel = (StagingResourcesTreeModel) tree.getModel();
					List<FileStatus> fileStatusesForPaths = fileTreeModel.getFilesByPaths(selectedFiles);
					fileStatuses.addAll(fileStatusesForPaths);
				}

	      // "Stage"/"Unstage" actions
	      AbstractAction stageUnstageAction = new StageUnstageResourceAction(
	          fileStatuses,
	          !forStagedResources,
	          stageController);
	      stageUnstageAction.actionPerformed(null);

				changeSelectedButton.setEnabled(false);
			}

		});
	}

	/**
	 * Adds a listener on the changeSelected button: When clicked all the files
	 * selected will go in the staging or unstaging area, depending on the
	 * forStaging variable
	 */
	private void addChangeSelectedButtonListener() {
		changeSelectedButton.addActionListener(new ActionListener() {
			@Override
      public void actionPerformed(ActionEvent e) {
			  List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
				if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
					int[] selectedRows = filesTable.getSelectedRows();
					StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
					for (int i = selectedRows.length - 1; i >= 0; i--) {
						int convertedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
						FileStatus fileStatus = fileTableModel.getFileStatus(convertedRow);
						fileStatuses.add(fileStatus);
					}
				} else {
					List<String> selectedFiles = TreeFormatter.getStringComonAncestor(tree);
					StagingResourcesTreeModel fileTreeModel = (StagingResourcesTreeModel) tree.getModel();
					List<FileStatus> fileStatusesForPaths = fileTreeModel.getFilesByPaths(selectedFiles);
					fileStatuses.addAll(fileStatusesForPaths);
				}

	      // "Stage"/"Unstage" actions
	      AbstractAction stageUnstageAction = new StageUnstageResourceAction(
	          fileStatuses,
	          !forStagedResources,
	          stageController);
	      stageUnstageAction.actionPerformed(null);

				changeSelectedButton.setEnabled(false);
			}

		});
	}

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private addChangeSelectedButtonListener() : void from class com.oxygenxml.git.view.ChangesPanel


	/**
	 * Show contextual menu for flat view.
	 *
	 * @param x             The X coordinate where to show the menu.
	 * @param y             The Y coordinate where to show the menu.
	 * @param selectedRows  The selected rows.
	 */
	private void showContextualMenuForFlatView(int x, int y, int[] selectedRows) {
	  final List<FileStatus> files = new ArrayList<>();

    for (int i = 0; i < selectedRows.length; i++) {
      int convertedSelectedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
      StagingResourcesTableModel model = (StagingResourcesTableModel) filesTable.getModel();
      FileStatus file = new FileStatus(model.getUnstageFile(convertedSelectedRow));
      files.add(file);
    }

    GitViewResourceContextualMenu contextualMenu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            // All resources are "leaves" in the table view.
            return getAllSelectedResources();
          }
          @Override
          public List<FileStatus> getAllSelectedResources() {
            return files;
          }
        },
        stageController,
        forStagedResources,
        isRepoInMergingState());

    contextualMenu.addPopupMenuListener(new PopupMenuListener() {
      @Override
      public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
        isContextMenuShowing = true;
      }
      @Override
      public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
        isContextMenuShowing  = false;
        contextualMenu.removePopupMenuListener(this);
      }
      @Override
      public void popupMenuCanceled(PopupMenuEvent e) {
        isContextMenuShowing  = false;
      }
    });

    contextualMenu.show(filesTable, x, y);
  }

	/**
	 * Show contextual menu for flat view.
	 *
	 * @param x             The X coordinate where to show the menu.
	 * @param y             The Y coordinate where to show the menu.
	 * @param selectedRows  The selected rows.
	 */
	private void showContextualMenuForFlatView(int x, int y, int[] selectedRows) {
	  final List<FileStatus> files = new ArrayList<FileStatus>();

    for (int i = 0; i < selectedRows.length; i++) {
      int convertedSelectedRow = filesTable.convertRowIndexToModel(selectedRows[i]);
      StagingResourcesTableModel model = (StagingResourcesTableModel) filesTable.getModel();
      FileStatus file = new FileStatus(model.getUnstageFile(convertedSelectedRow));
      files.add(file);
    }

    GitViewResourceContextualMenu contextualMenu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            // All resources are "leaves" in the table view.
            return getAllSelectedResources();
          }
          @Override
          public List<FileStatus> getAllSelectedResources() {
            return files;
          }
        },
        stageController,
        forStagedResources,
        isRepoInMergingState());

    contextualMenu.addPopupMenuListener(new PopupMenuListener() {
      @Override
      public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
        isContextMenuShowing = true;
      }
      @Override
      public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
        isContextMenuShowing  = false;
        contextualMenu.removePopupMenuListener(this);
      }
      @Override
      public void popupMenuCanceled(PopupMenuEvent e) {
        isContextMenuShowing  = false;
      }
    });

    contextualMenu.show(filesTable, x, y);
  }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method private showContextualMenuForFlatView(x int, y int, selectedRows int[]) : void from class com.oxygenxml.git.view.ChangesPanel


/**
	 * Checks the project directory for Git repositories.
	 *
	 * @param projectDir Project directory.
	 *
	 * @return true if a Git repository was detected and loaded. false
	 * if no Git repository was detected.
	 *
	 * @throws FileNotFoundException The project file doesn't exist.
	 * @throws IOException A Git repository was detected but not loaded.
	 */
	private boolean checkForGitRepositoriesUpAndDownFrom(String projectDir) throws IOException {
	  boolean projectPahtIsGit = false;
		String projectName = EditorVariables.expandEditorVariables("${pn}", null);
		String projectXprName = projectName + ".xpr";
		try {
		  // Parse the XML file to detected the referred resources.
		  SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
		  SAXParser saxParser = saxParserFactory.newSAXParser();
			XPRHandler handler = new XPRHandler();

			File xmlFile = new File(projectDir, projectXprName);
			saxParser.parse(xmlFile, handler);
			List<String> pathsFromProjectView = handler.getPaths();
			for (String path : pathsFromProjectView) {
				File file = null;
				if (FileHelper.isURL(path)) {
					file = new File(path);
				} else if (!".".equals(path)) {
					file = new File(projectDir, path);
				}
				if (file != null) {
					String pathToCheck = file.getAbsolutePath();
					if (checkGitFolder(pathToCheck)) {
					  projectPahtIsGit = true;
					  break;
					}
				}
			}

			if (!projectPahtIsGit) {
			  // The oxygen project might be inside a Git repository.
			  // Look into the ancestors for a Git repository.
			  File file = new File(projectDir);
			  while (file != null) {
			    if (checkGitFolder(file.getAbsolutePath())) {
			      projectPahtIsGit = true;
			      break;
			    }
			    file = file.getParentFile();
			  }
			}
		} catch (ParserConfigurationException | SAXException | IOException e1) {
			if (logger.isDebugEnabled()) {
				logger.debug(e1, e1);
			}
		}

		return projectPahtIsGit;
	}

/**
	 * Checks the project directory for Git repositories.
	 *
	 * @param projectDir Project directory.
	 *
	 * @return true if a Git repository was detected and loaded. false
	 * if no Git repository was detected.
	 *
	 * @throws FileNotFoundException The project file doesn't exist.
	 * @throws IOException A Git repository was detected but not loaded.
	 */
	private boolean checkForGitRepositoriesUpAndDownFrom(String projectDir) throws FileNotFoundException, IOException {
	  boolean projectPahtIsGit = false;
		String projectName = EditorVariables.expandEditorVariables("${pn}", null);
		String projectXprName = projectName + ".xpr";
		try {
		  // Parse the XML file to detected the referred resources.
		  SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
		  SAXParser saxParser = saxParserFactory.newSAXParser();
			XPRHandler handler = new XPRHandler();

			File xmlFile = new File(projectDir, projectXprName);
			saxParser.parse(xmlFile, handler);
			List<String> pathsFromProjectView = handler.getPaths();
			for (String path : pathsFromProjectView) {
				File file = null;
				if (FileHelper.isURL(path)) {
					file = new File(path);
				} else if (!".".equals(path)) {
					file = new File(projectDir, path);
				}
				if (file != null) {
					String pathToCheck = file.getAbsolutePath();
					if (checkGitFolder(pathToCheck)) {
					  projectPahtIsGit = true;
					  break;
					}
				}
			}

			if (!projectPahtIsGit) {
			  // The oxygen project might be inside a Git repository.
			  // Look into the ancestors for a Git repository.
			  File file = new File(projectDir);
			  while (file != null) {
			    if (checkGitFolder(file.getAbsolutePath())) {
			      projectPahtIsGit = true;
			      break;
			    }
			    file = file.getParentFile();
			  }
			}
		} catch (ParserConfigurationException e1) {
			if (logger.isDebugEnabled()) {
				logger.debug(e1, e1);
			}
		} catch (SAXException e1) {
			if (logger.isDebugEnabled()) {
				logger.debug(e1, e1);
			}
		} catch (IOException e1) {
			if (logger.isDebugEnabled()) {
				logger.debug(e1, e1);
			}
		}

		return projectPahtIsGit;
	}

Merge Catch [catch(ParserConfigurationException e1), catch(SAXException e1), catch(IOException e1)] to catch(ParserConfigurationException|SAXException|IOException e1) in method private checkForGitRepositoriesUpAndDownFrom(projectDir String) : boolean from class com.oxygenxml.git.utils.PanelRefresh


	/**
	 * Adds the remote as origin to the repository
	 */
	@Override
	protected void doOK() {
		super.doOK();
		StoredConfig config;
		try {
			config = GitAccess.getInstance().getRepository().getConfig();
			RemoteConfig remoteConfig = new RemoteConfig(config, "origin");
			URIish uri = new URIish(remoteRepoTextField.getText());
			remoteConfig.addURI(uri);
			RefSpec spec = new RefSpec("+refs/heads/*:refs/remotes/origin/*");
			remoteConfig.addFetchRefSpec(spec);
			remoteConfig.update(config);
			config.save();
		} catch (NoRepositorySelected | URISyntaxException | IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		dispose();
	}

	/**
	 * Adds the remote as origin to the repository
	 */
	@Override
	protected void doOK() {
		super.doOK();
		StoredConfig config;
		try {
			config = GitAccess.getInstance().getRepository().getConfig();
			RemoteConfig remoteConfig = new RemoteConfig(config, "origin");
			URIish uri = new URIish(remoteRepoTextField.getText());
			remoteConfig.addURI(uri);
			RefSpec spec = new RefSpec("+refs/heads/*:refs/remotes/origin/*");
			remoteConfig.addFetchRefSpec(spec);
			remoteConfig.update(config);
			config.save();
		} catch (NoRepositorySelected e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		} catch (URISyntaxException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		} catch (IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		dispose();
	}

Merge Catch [catch(NoRepositorySelected e), catch(URISyntaxException e), catch(IOException e)] to catch(NoRepositorySelected|URISyntaxException|IOException e) in method protected doOK() : void from class com.oxygenxml.git.view.dialog.AddRemoteDialog


		/**
		 * Returns an output stream that writes to this connection.
		 *
		 * @return the output stream
		 */
		@Override
		public OutputStream getOutputStream() throws IOException {
			if (VersionIdentifier.MINE.equals(currentHost)) {
        try {
          URL fileContent = FileHelper.getFileURL(path);
          return fileContent.openConnection().getOutputStream();
        } catch (NoWorkTreeException | NoRepositorySelected e) {
          throw new IOException(e);
        }
			}
			throw new IOException("Writing is permitted only in the local file.");
		}

		/**
		 * Returns an output stream that writes to this connection.
		 *
		 * @return the output stream
		 */
		@Override
		public OutputStream getOutputStream() throws IOException {
			if (VersionIdentifier.MINE.equals(currentHost)) {
        try {
          URL fileContent = FileHelper.getFileURL(path);
          return fileContent.openConnection().getOutputStream();
        } catch (NoWorkTreeException e) {
          throw new IOException(e);
        } catch (NoRepositorySelected e) {
          throw new IOException(e);
        }
			}
			throw new IOException("Writing is permitted only in the local file.");
		}

Merge Catch [catch(NoWorkTreeException e), catch(NoRepositorySelected e)] to catch(NoWorkTreeException|NoRepositorySelected e) in method public getOutputStream() : OutputStream from class com.oxygenxml.git.protocol.GitRevisionURLHandler.GitRevisionConnection


	/**
	 * Creates a blank new Repository.
	 *
	 * @param path
	 *          - A string that specifies the git Repository folder
	 */
	public void createNewRepository(String path) {

		try {
			git = Git.init().setBare(false).setDirectory(new File(path)).call();
		} catch (IllegalStateException | GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}

		fireRepositoryChanged();
	}

	/**
	 * Creates a blank new Repository.
	 *
	 * @param path
	 *          - A string that specifies the git Repository folder
	 */
	public void createNewRepository(String path) {

		try {
			git = Git.init().setBare(false).setDirectory(new File(path)).call();
		} catch (IllegalStateException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		} catch (GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}

		fireRepositoryChanged();
	}

Merge Catch [catch(IllegalStateException e), catch(GitAPIException e)] to catch(IllegalStateException|GitAPIException e) in method public createNewRepository(path String) : void from class com.oxygenxml.git.service.GitAccess


	/**
	 * Makes a diff between the files from the last commit and the files from the
	 * working directory. If there are diffs, they will be saved and returned.
	 *
	 * @param paths A subset of interest.
	 *
	 * @return - A list with the files from the given set htat are un-staged as well as
	 * their states.
	 */
	public List<FileStatus> getUnstagedFiles(Collection<String> paths) {
		List<FileStatus> unstagedFiles = new ArrayList<FileStatus>();
		if (git != null) {
			try {
				StatusCommand statusCmd = git.status();
				for (Iterator<String> iterator = paths.iterator(); iterator.hasNext();) {
          String path = iterator.next();
          statusCmd.addPath(path);
        }

        Status status = statusCmd.call();
				Set<String> submodules = getSubmodules();
				for (String string : submodules) {
					SubmoduleStatus submoduleStatus = git.submoduleStatus().call().get(string);
					if (!submoduleStatus.getHeadId().equals(submoduleStatus.getIndexId())) {
						unstagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, string));
					}
				}
				for (String string : status.getUntracked()) {
				  // A newly created file, not yet in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.UNTRACKED, string));
					}
				}
				for (String string : status.getModified()) {
				  // A file that was modified compared to the one from INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MODIFIED, string));
					}
				}
				for (String string : status.getMissing()) {
				  // A missing file that is present in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MISSING, string));
					}
				}
				unstagedFiles.addAll(getConflictingFiles());

			} catch (NoWorkTreeException | GitAPIException e1) {
				if (logger.isDebugEnabled()) {
					logger.debug(e1, e1);
				}
			}
		}
		return unstagedFiles;
	}

	/**
	 * Makes a diff between the files from the last commit and the files from the
	 * working directory. If there are diffs, they will be saved and returned.
	 *
	 * @param paths A subset of interest.
	 *
	 * @return - A list with the files from the given set htat are un-staged as well as
	 * their states.
	 */
	public List<FileStatus> getUnstagedFiles(Collection<String> paths) {
		List<FileStatus> unstagedFiles = new ArrayList<FileStatus>();
		if (git != null) {
			try {
				StatusCommand statusCmd = git.status();
				for (Iterator<String> iterator = paths.iterator(); iterator.hasNext();) {
          String path = iterator.next();
          statusCmd.addPath(path);
        }

        Status status = statusCmd.call();
				Set<String> submodules = getSubmodules();
				for (String string : submodules) {
					SubmoduleStatus submoduleStatus = git.submoduleStatus().call().get(string);
					if (!submoduleStatus.getHeadId().equals(submoduleStatus.getIndexId())) {
						unstagedFiles.add(new FileStatus(GitChangeType.SUBMODULE, string));
					}
				}
				for (String string : status.getUntracked()) {
				  // A newly created file, not yet in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.UNTRACKED, string));
					}
				}
				for (String string : status.getModified()) {
				  // A file that was modified compared to the one from INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MODIFIED, string));
					}
				}
				for (String string : status.getMissing()) {
				  // A missing file that is present in the INDEX.
					if (!submodules.contains(string)) {
						unstagedFiles.add(new FileStatus(GitChangeType.MISSING, string));
					}
				}
				unstagedFiles.addAll(getConflictingFiles());

			} catch (NoWorkTreeException e1) {
				if (logger.isDebugEnabled()) {
					logger.debug(e1, e1);
				}
			} catch (GitAPIException e1) {
				if (logger.isDebugEnabled()) {
					logger.debug(e1, e1);
				}
			}
		}
		return unstagedFiles;
	}

Merge Catch [catch(NoWorkTreeException e1), catch(GitAPIException e1)] to catch(NoWorkTreeException|GitAPIException e1) in method public getUnstagedFiles(paths Collection<String>) : List<FileStatus> from class com.oxygenxml.git.service.GitAccess


	/**
	 * Calculates how many commits the local repository is ahead from the current
	 * local repository base commit
	 *
	 * @return the number of commits ahead
	 */
	public int getPushesAhead() {
		int numberOfCommits = 0;

		if (git != null) {
			Repository repository = git.getRepository();
			RevWalk walk = new RevWalk(repository);
			walk.reset();
			try {
				ObjectId local = getLastLocalCommit();
				ObjectId base = getBaseCommit();
				if (local != null && base != null) {
					RevCommit localCommit = walk.parseCommit(local);
					RevCommit baseCommit = walk.parseCommit(base);
					numberOfCommits = RevWalkUtils.count(walk, localCommit, baseCommit);
				}
				if (base == null) {
					Iterable<RevCommit> results = git.log().call();
					for (RevCommit revCommit : results) {
						if (revCommit.getId().name().equals(git.getRepository().getBranch())) {
							numberOfCommits = 0;
							break;
						}
						numberOfCommits++;
					}
				}
			} catch (IOException | GitAPIException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			}
			walk.close();
		}
		return numberOfCommits;
	}

	/**
	 * Calculates how many commits the local repository is ahead from the current
	 * local repository base commit
	 *
	 * @return the number of commits ahead
	 */
	public int getPushesAhead() {
		int numberOfCommits = 0;

		if (git != null) {
			Repository repository = git.getRepository();
			RevWalk walk = new RevWalk(repository);
			walk.reset();
			try {
				ObjectId local = getLastLocalCommit();
				ObjectId base = getBaseCommit();
				if (local != null && base != null) {
					RevCommit localCommit = walk.parseCommit(local);
					RevCommit baseCommit = walk.parseCommit(base);
					numberOfCommits = RevWalkUtils.count(walk, localCommit, baseCommit);
				}
				if (base == null) {
					Iterable<RevCommit> results = git.log().call();
					for (RevCommit revCommit : results) {
						if (revCommit.getId().name().equals(git.getRepository().getBranch())) {
							numberOfCommits = 0;
							break;
						}
						numberOfCommits++;
					}
				}
			} catch (IOException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			} catch (GitAPIException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			}
			walk.close();
		}
		return numberOfCommits;
	}

Merge Catch [catch(IOException e), catch(GitAPIException e)] to catch(IOException|GitAPIException e) in method public getPushesAhead() : int from class com.oxygenxml.git.service.GitAccess


	/**
	 * Calculates how many commits the remote repository is ahead from the local
	 * repository base commit
	 *
	 * @return the number of commits the remote is ahead
	 */
	public int getPullsBehind() {
		int numberOfCommits = 0;
		if (git != null) {
			Repository repository = git.getRepository();
			RevWalk walk = new RevWalk(repository);
			walk.reset();
			try {
				if (getRemoteCommit() != null && getBaseCommit() != null) {
					RevCommit remoteCommit = walk.parseCommit(getRemoteCommit());
					RevCommit baseCommit = walk.parseCommit(getBaseCommit());
					numberOfCommits = RevWalkUtils.count(walk, remoteCommit, baseCommit);
				}
				if (getBaseCommit() == null
				    && repository.resolve("remotes/origin/" + git.getRepository().getBranch()) != null) {
						LogCommand log = git.log();
						if (repository.resolve("HEAD") != null) {
							log.not(repository.resolve("HEAD"));
						}
						Iterable<RevCommit> logs = git.log()
								.add(repository.resolve("remotes/origin/" + git.getRepository().getBranch())).call();
						Iterator<RevCommit> iterator = logs.iterator();
						while (iterator.hasNext()) {
						  iterator.next();
							numberOfCommits++;
						}
					}
			} catch (IOException | GitAPIException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			}
			walk.close();
		}
		return numberOfCommits;

	}

	/**
	 * Calculates how many commits the remote repository is ahead from the local
	 * repository base commit
	 *
	 * @return the number of commits the remote is ahead
	 */
	public int getPullsBehind() {
		int numberOfCommits = 0;
		if (git != null) {
			Repository repository = git.getRepository();
			RevWalk walk = new RevWalk(repository);
			walk.reset();
			try {
				if (getRemoteCommit() != null && getBaseCommit() != null) {
					RevCommit remoteCommit = walk.parseCommit(getRemoteCommit());
					RevCommit baseCommit = walk.parseCommit(getBaseCommit());
					numberOfCommits = RevWalkUtils.count(walk, remoteCommit, baseCommit);
				}
				if (getBaseCommit() == null
				    && repository.resolve("remotes/origin/" + git.getRepository().getBranch()) != null) {
						LogCommand log = git.log();
						if (repository.resolve("HEAD") != null) {
							log.not(repository.resolve("HEAD"));
						}
						Iterable<RevCommit> logs = git.log()
								.add(repository.resolve("remotes/origin/" + git.getRepository().getBranch())).call();
						Iterator<RevCommit> iterator = logs.iterator();
						while (iterator.hasNext()) {
						  iterator.next();
							numberOfCommits++;
						}
					}
			} catch (IOException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			} catch (GitAPIException e) {
				if (logger.isDebugEnabled()) {
					logger.debug(e, e);
				}
			}
			walk.close();
		}
		return numberOfCommits;

	}

Merge Catch [catch(IOException e), catch(GitAPIException e)] to catch(IOException|GitAPIException e) in method public getPullsBehind() : int from class com.oxygenxml.git.service.GitAccess


	/**
	 * Restore to the initial state of the repository. Only applicable if the
	 * repository has conflicts
	 */
	public void restartMerge() {
		try {
			AnyObjectId commitToMerge = git.getRepository().resolve("MERGE_HEAD");
			git.clean().call();
			git.reset().setMode(ResetType.HARD).call();
			git.merge().include(commitToMerge).setStrategy(MergeStrategy.RECURSIVE).call();

			fireFileStateChanged(new ChangeEvent(GitCommand.MERGE_RESTART, Collections.<String> emptyList()));
		} catch (GitAPIException | IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(END_FETCH_DEBUG_MESSAGE);
			}
		}
	}

	/**
	 * Restore to the initial state of the repository. Only applicable if the
	 * repository has conflicts
	 */
	public void restartMerge() {
		try {
			AnyObjectId commitToMerge = git.getRepository().resolve("MERGE_HEAD");
			git.clean().call();
			git.reset().setMode(ResetType.HARD).call();
			git.merge().include(commitToMerge).setStrategy(MergeStrategy.RECURSIVE).call();

			fireFileStateChanged(new ChangeEvent(GitCommand.MERGE_RESTART, Collections.<String> emptyList()));
		} catch (GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug("End fetch");
			}
		} catch (IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug("End fetch");
			}
		}
	}

Merge Catch [catch(GitAPIException e), catch(IOException e)] to catch(GitAPIException|IOException e) in method public restartMerge() : void from class com.oxygenxml.git.service.GitAccess


	/**
	 * Returns the SHA-1 commit id for a file by specifying what commit to get for
	 * that file and it's path
	 *
	 * @param commit
	 *          - specifies the commit to return(MINE, THEIRS, BASE, LOCAL)
	 * @param path
	 *          - the file path for the specified commit
	 * @return the SHA-1 commit id
	 */
	public ObjectId getCommit(Commit commit, String path) {
		List<DiffEntry> entries;
		boolean baseIsNull = false;
		int index = 0;
		try {
			entries = git.diff().setPathFilter(PathFilter.create(path)).call();
			if (entries.size() == 2) {
				baseIsNull = true;
			}
			if (commit == Commit.MINE) {
				if (baseIsNull) {
					index = 0;
				} else {
					index = 1;
				}
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.THEIRS) {
				if (baseIsNull) {
					index = 1;
				} else {
					index = 2;
				}
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.BASE) {
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.LOCAL) {
				ObjectId lastLocalCommit = getLastLocalCommit();
				RevWalk revWalk = new RevWalk(git.getRepository());
				RevCommit revCommit = revWalk.parseCommit(lastLocalCommit);
				RevTree tree = revCommit.getTree();
				TreeWalk treeWalk = new TreeWalk(git.getRepository());
				treeWalk.addTree(tree);
				treeWalk.setRecursive(true);
				treeWalk.setFilter(PathFilter.create(path));
				ObjectId objectId = null;
				if (treeWalk.next()) {
					objectId = treeWalk.getObjectId(0);
				}
				treeWalk.close();
				revWalk.close();
				return objectId;
			}
		} catch (GitAPIException |IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		return null;
	}

	/**
	 * Returns the SHA-1 commit id for a file by specifying what commit to get for
	 * that file and it's path
	 *
	 * @param commit
	 *          - specifies the commit to return(MINE, THEIRS, BASE, LOCAL)
	 * @param path
	 *          - the file path for the specified commit
	 * @return the SHA-1 commit id
	 */
	public ObjectId getCommit(Commit commit, String path) {
		List<DiffEntry> entries;
		boolean baseIsNull = false;
		int index = 0;
		try {
			entries = git.diff().setPathFilter(PathFilter.create(path)).call();
			if (entries.size() == 2) {
				baseIsNull = true;
			}
			if (commit == Commit.MINE) {
				if (baseIsNull) {
					index = 0;
				} else {
					index = 1;
				}
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.THEIRS) {
				if (baseIsNull) {
					index = 1;
				} else {
					index = 2;
				}
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.BASE) {
				return entries.get(index).getOldId().toObjectId();
			} else if (commit == Commit.LOCAL) {
				ObjectId lastLocalCommit = getLastLocalCommit();
				RevWalk revWalk = new RevWalk(git.getRepository());
				RevCommit revCommit = revWalk.parseCommit(lastLocalCommit);
				RevTree tree = revCommit.getTree();
				TreeWalk treeWalk = new TreeWalk(git.getRepository());
				treeWalk.addTree(tree);
				treeWalk.setRecursive(true);
				treeWalk.setFilter(PathFilter.create(path));
				ObjectId objectId = null;
				if (treeWalk.next()) {
					objectId = treeWalk.getObjectId(0);
				}
				treeWalk.close();
				revWalk.close();
				return objectId;
			}
		} catch (GitAPIException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		} catch (IOException e) {
			if (logger.isDebugEnabled()) {
				logger.debug(e, e);
			}
		}
		return null;
	}

Merge Catch [catch(GitAPIException e), catch(IOException e)] to catch(GitAPIException|IOException e) in method public getCommit(commit Commit, path String) : ObjectId from class com.oxygenxml.git.service.GitAccess


        @Override
        public Component getListCellRendererComponent(JList list, Object value,
                int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected,
                    cellHasFocus);

            T item = (T) value;
            if (item != null) {

                Field[] fields = item.getClass().getDeclaredFields();

                for (Field field : fields) {
                    ComboBoxField annotation = field.getDeclaredAnnotation(ComboBoxField.class);
                    if (annotation != null) {
                        try {
                            field.setAccessible(true);
                            setText((String) field.get(item));
                            field.setAccessible(false);
                            break;
                        } catch (IllegalArgumentException | IllegalAccessException ex) {
                            Logger.getLogger(NegodComboBox.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
            }
            return this;
        }

        @Override
        public Component getListCellRendererComponent(JList list, Object value,
                int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected,
                    cellHasFocus);

            T item = (T) value;
            if (item != null) {

                Field[] fields = item.getClass().getDeclaredFields();

                for (Field field : fields) {
                    ComboBoxField annotation = field.getDeclaredAnnotation(ComboBoxField.class);
                    if (annotation != null) {
                        try {
                            field.setAccessible(true);
                            setText((String) field.get(item));
                            field.setAccessible(false);
                            break;
                        } catch (IllegalArgumentException ex) {
                            Logger.getLogger(NegodComboBox.class.getName()).log(Level.SEVERE, null, ex);
                        } catch (IllegalAccessException ex) {
                            Logger.getLogger(NegodComboBox.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
            }
            return this;
        }

Merge Catch [catch(IllegalArgumentException ex), catch(IllegalAccessException ex)] to catch(IllegalArgumentException|IllegalAccessException ex) in method public getListCellRendererComponent(list JList, value Object, index int, isSelected boolean, cellHasFocus boolean) : Component from class se.backede.jeconomix.forms.basic.NegodComboBox.NegodRenderer


    public void setTableData() {

        DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
        rightRenderer.setHorizontalAlignment(JLabel.RIGHT);

        TransactionCompanyModel transModel = new TransactionCompanyModel(new HashSet<>(reports.getTransctions()));
        transactionTable.setModel(transModel);
        transactionTable.getColumnModel().getColumn(2).setCellRenderer(rightRenderer);

        transactionSumLabel.setText(transModel.getSum().toString().concat(" Kr"));
        categoryNameLabel.setText(reports.getCategory());
    }

    public void setTableData() {

        DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
        rightRenderer.setHorizontalAlignment(JLabel.RIGHT);

        TransactionCompanyModel transModel = new TransactionCompanyModel(new HashSet<TransactionDto>(reports.getTransctions()));
        transactionTable.setModel(transModel);
        transactionTable.getColumnModel().getColumn(2).setCellRenderer(rightRenderer);

        transactionSumLabel.setText(transModel.getSum().toString().concat(" Kr"));
        categoryNameLabel.setText(reports.getCategory());
    }

Replace Generic With Diamond TransactionCompanyModel with TransactionCompanyModel in method public setTableData() : void from class se.backede.jeconomix.forms.report.SingleTransactionReport


    public void importExpensesFromCSV(String filePath, JFrame parent) {
        new Thread(() -> {
            try {
                CsvReaderHandler handler = new CsvReaderHandler(filePath, Boolean.TRUE);
                Iterable<CSVRecord> build = new Normalizer(handler.getRecords())
                        .removePeriod("Belopp")
                        .removePeriod("Saldo")
                        .removeWord("Transaktion", "Kortköp")
                        .removeWord("Transaktion", "Reservation")
                        .removeLeadingSpaces("Transaktion")
                        .removeWordStartingWith("Transaktion", "18", 7)
                        .removeWordStartingWith("Transaktion", "17", 7)
                        .removeTrailingAndLeadingSpaces("Transaktion")
                        .replaceComma("Belopp")
                        .replaceComma("Saldo")
                        .removeMinus("Belopp")
                        .build(handler.getHeaderMap());

                handleNormalizedImports(build, parent);

            } catch (BeckedeFileException | IOException ex) {
                log.error("Error when importing expenses", ex);
            }
        }).start();
    }

    public void importExpensesFromCSV(String filePath, JFrame parent) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    CsvReaderHandler handler = new CsvReaderHandler(filePath, Boolean.TRUE);
                    Iterable<CSVRecord> build = new Normalizer(handler.getRecords())
                            .removePeriod("Belopp")
                            .removePeriod("Saldo")
                            .removeWord("Transaktion", "Kortköp")
                            .removeWord("Transaktion", "Reservation")
                            .removeLeadingSpaces("Transaktion")
                            .removeWordStartingWith("Transaktion", "18", 7)
                            .removeWordStartingWith("Transaktion", "17", 7)
                            .removeTrailingAndLeadingSpaces("Transaktion")
                            .replaceComma("Belopp")
                            .replaceComma("Saldo")
                            .removeMinus("Belopp")
                            .build(handler.getHeaderMap());

                    handleNormalizedImports(build, parent);

                } catch (BeckedeFileException | IOException ex) {
                    log.error("Error when importing expenses", ex);
                }
            }
        }).start();
    }

Replace Anonymous With Lambda se.backede.jeconomix.importer.TransactionImporter.importExpensesFromCSV.start.new Thread.new Runnable with () -> {tryCsvReaderHandler handler=new CsvReaderHandler(filePath,Boolean.TRUE); in method public importExpensesFromCSV(filePath String, parent JFrame) : void from class se.backede.jeconomix.importer.TransactionImporter