Java Properties Load from File loadFixedCommits()

Here you can find the source of loadFixedCommits()

Description

load Fixed Commits

License

Open Source License

Declaration

private static void loadFixedCommits() throws FileNotFoundException 

Method Source Code

//package com.java2s;
/**/*from  w  w w  .j  ava2s .c om*/
 * Copyright (c) 2014 by Software Engineering Lab. of Sungkyunkwan University. All Rights Reserved.
 * 
 * Permission to use, copy, modify, and distribute this software and its documentation for
 * educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement,
 * is hereby granted, provided that the above copyright notice appears in all copies, modifications, and distributions.
 */

import java.io.File;

import java.io.FileNotFoundException;

import java.util.HashMap;
import java.util.HashSet;

import java.util.Scanner;

public class Main {
    private static HashMap<String, HashSet<String>> fixedCommitMap = new HashMap<String, HashSet<String>>();
    private static String FIXED_COMMIT_FILE = "ZXingFixedCommits.txt";

    private static void loadFixedCommits() throws FileNotFoundException {
        String userHomeDir = System.getProperty("user.home");
        String bugRepoPath = userHomeDir + "/git/BLIA/data/";
        Scanner bugRepoRead = new Scanner(new File(bugRepoPath
                + FIXED_COMMIT_FILE));

        while (bugRepoRead.hasNextLine()) {
            String line = bugRepoRead.nextLine();
            String[] items = line.split(" ");

            String bugID = items[0];
            HashSet<String> hashSet = fixedCommitMap.get(bugID);
            if (hashSet == null) {
                hashSet = new HashSet<String>();
            }

            for (int i = 1; i < items.length; i++) {
                hashSet.add(items[i]);
            }
            fixedCommitMap.put(bugID, hashSet);
        }
    }
}

Related

  1. loadDefaultProps(Properties deployProps)
  2. LoadDeployedObjects(String outputDirectory)
  3. loadEnv(final String configFilePath)
  4. loadErrorMap(InputStream resourceStream)
  5. loadEscaping(Properties prop, InputStream stream)
  6. loadFixture(String fixtureId)
  7. loadGradleResource(String fileName)
  8. loadHeader(String fileName)
  9. loadIncludes(String propertyName, boolean mandatory, File file, Properties configProps)