java.util.HashMap

Here are the examples of the java api class java.util.HashMap taken from open source projects.

1. InvokeObjectBean#initConverters()

Project: openejb
Source File: InvokeObjectBean.java
View license
private HashMap initConverters() {
    HashMap map = new HashMap();
    map.put(String.class, new StringConverter());
    map.put(Character.class, new CharacterConverter());
    map.put(Boolean.class, new BooleanConverter());
    map.put(Byte.class, new ByteConverter());
    map.put(Short.class, new ShortConverter());
    map.put(Integer.class, new IntegerConverter());
    map.put(Long.class, new LongConverter());
    map.put(Float.class, new FloatConverter());
    map.put(Double.class, new DoubleConverter());
    map.put(Object.class, new ObjectConverter());
    map.put(Character.TYPE, map.get(Character.class));
    map.put(Boolean.TYPE, map.get(Boolean.class));
    map.put(Byte.TYPE, map.get(Byte.class));
    map.put(Short.TYPE, map.get(Short.class));
    map.put(Integer.TYPE, map.get(Integer.class));
    map.put(Long.TYPE, map.get(Long.class));
    map.put(Float.TYPE, map.get(Float.class));
    map.put(Double.TYPE, map.get(Double.class));
    return map;
}

2. AssignmentAction#monthTable()

Project: sakai
Source File: AssignmentAction.java
View license
// resetNewAssignment
/**
	 * construct a HashMap using integer as the key and three character string of the month as the value
	 */
private HashMap monthTable() {
    HashMap n = new HashMap();
    n.put(Integer.valueOf(1), rb.getString("jan"));
    n.put(Integer.valueOf(2), rb.getString("feb"));
    n.put(Integer.valueOf(3), rb.getString("mar"));
    n.put(Integer.valueOf(4), rb.getString("apr"));
    n.put(Integer.valueOf(5), rb.getString("may"));
    n.put(Integer.valueOf(6), rb.getString("jun"));
    n.put(Integer.valueOf(7), rb.getString("jul"));
    n.put(Integer.valueOf(8), rb.getString("aug"));
    n.put(Integer.valueOf(9), rb.getString("sep"));
    n.put(Integer.valueOf(10), rb.getString("oct"));
    n.put(Integer.valueOf(11), rb.getString("nov"));
    n.put(Integer.valueOf(12), rb.getString("dec"));
    return n;
}

3. PointsToAnalysis#setSparkPointsToAnalysis()

Project: JAADAS
Source File: PointsToAnalysis.java
View license
static void setSparkPointsToAnalysis() {
    System.out.println("[spark] Starting analysis ...");
    HashMap opt = new HashMap();
    opt.put("enabled", "true");
    opt.put("verbose", "true");
    opt.put("ignore-types", "false");
    opt.put("force-gc", "false");
    opt.put("pre-jimplify", "false");
    opt.put("vta", "false");
    opt.put("rta", "false");
    opt.put("field-based", "false");
    opt.put("types-for-sites", "false");
    opt.put("merge-stringbuffer", "true");
    opt.put("string-constants", "false");
    opt.put("simulate-natives", "true");
    opt.put("simple-edges-bidirectional", "false");
    opt.put("on-fly-cg", "true");
    opt.put("simplify-offline", "false");
    opt.put("simplify-sccs", "false");
    opt.put("ignore-types-for-sccs", "false");
    opt.put("propagator", "worklist");
    opt.put("set-impl", "double");
    opt.put("double-set-old", "hybrid");
    opt.put("double-set-new", "hybrid");
    opt.put("dump-html", "false");
    opt.put("dump-pag", "false");
    opt.put("dump-solution", "false");
    opt.put("topo-sort", "false");
    opt.put("dump-types", "true");
    opt.put("class-method-var", "true");
    opt.put("dump-answer", "false");
    opt.put("add-tags", "false");
    opt.put("set-mass", "false");
    SparkTransformer.v().transform("", opt);
    System.out.println("[spark] Done!");
}

4. CitationServlet#findOpenURLVersion01()

Project: sakai
Source File: CitationServlet.java
View license
public Citation findOpenURLVersion01(ParameterParser params) {
    String genre = params.getString("genre");
    String[] authors = params.getStrings("au");
    String title = params.getString("title");
    String atitle = params.getString("atitle");
    String volume = params.getString("volume");
    String issue = params.getString("issue");
    String pages = params.getString("pages");
    String publisher = params.getString("publisher");
    String date = params.getString("date");
    String id = params.getString("id");
    HashMap map = new HashMap();
    map.put("genre", genre);
    map.put("au", authors);
    map.put("title", title);
    map.put("atitle", atitle);
    map.put("volume", volume);
    map.put("issue", issue);
    map.put("pages", pages);
    map.put("publisher", publisher);
    map.put("date", date);
    map.put("id", id);
    return findOpenURLVersion01(map);
}

5. ConfigurationPropertyTest#shouldSetConfigAttributesForNonSecureProperty()

Project: gocd
Source File: ConfigurationPropertyTest.java
View license
@Test
public void shouldSetConfigAttributesForNonSecureProperty() throws Exception {
    ConfigurationProperty configurationProperty = new ConfigurationProperty();
    HashMap attributes = new HashMap();
    HashMap keyMap = new HashMap();
    keyMap.put("name", "fooKey");
    attributes.put(ConfigurationProperty.CONFIGURATION_KEY, keyMap);
    HashMap valueMap = new HashMap();
    valueMap.put("value", "fooValue");
    attributes.put(ConfigurationProperty.CONFIGURATION_VALUE, valueMap);
    PackageConfigurations metadata = new PackageConfigurations();
    metadata.addConfiguration(new PackageConfiguration("fooKey", null));
    attributes.put(Configuration.METADATA, metadata);
    configurationProperty.setConfigAttributes(attributes, null);
    assertThat(configurationProperty.getConfigurationKey().getName(), is("fooKey"));
    assertThat(configurationProperty.getConfigurationValue().getValue(), is("fooValue"));
}

6. BasicFSTTest#testSimpleCollections()

View license
@Test
public void testSimpleCollections() throws Exception {
    HashMap obj = new HashMap();
    ArrayList li = new ArrayList();
    li.add("zero");
    li.add(null);
    li.add("second");
    obj.put("x", li);
    obj.put("y", li);
    obj.put("yy", null);
    obj.put(null, "asd");
    obj.put(3, "99999");
    out.writeObject(obj);
    final byte[] copyOfWrittenBuffer = out.getCopyOfWrittenBuffer();
    in.resetForReuseUseArray(copyOfWrittenBuffer);
    out.flush();
    HashMap res = (HashMap) in.readObject();
    assertTrue(res.get("x") == res.get("y"));
    assertTrue(DeepEquals.deepEquals(obj, res));
}

7. ConfigurationPropertyTest#shouldSetConfigAttributesWhenMetadataIsNotPassedInMap()

Project: gocd
Source File: ConfigurationPropertyTest.java
View license
@Test
public void shouldSetConfigAttributesWhenMetadataIsNotPassedInMap() throws Exception {
    ConfigurationProperty configurationProperty = new ConfigurationProperty();
    HashMap attributes = new HashMap();
    HashMap keyMap = new HashMap();
    keyMap.put("name", "fooKey");
    attributes.put(ConfigurationProperty.CONFIGURATION_KEY, keyMap);
    HashMap valueMap = new HashMap();
    valueMap.put("value", "fooValue");
    attributes.put(ConfigurationProperty.CONFIGURATION_VALUE, valueMap);
    configurationProperty.setConfigAttributes(attributes, null);
    assertThat(configurationProperty.getConfigurationKey().getName(), is("fooKey"));
    assertThat(configurationProperty.getConfigurationValue().getValue(), is("fooValue"));
    assertThat(configurationProperty.getEncryptedValue(), is(nullValue()));
}

8. SootConfigJavaProjectLauncher#setEclipseDefs()

View license
private HashMap setEclipseDefs() {
    HashMap defs = new HashMap();
    defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation());
    Iterator it = getJavaProcessPath().iterator();
    String cp = (String) it.next();
    while (it.hasNext()) {
        cp = cp + getSootClasspath().getSeparator() + (String) it.next();
    }
    cp = cp + getSootClasspath().getSeparator() + getClasspathAppend();
    defs.put(LaunchCommands.SOOT_CLASSPATH, cp);
    defs.put(LaunchCommands.PROCESS_PATH, getJavaProcessPath());
    defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean(true));
    defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean(true));
    defs.put(LaunchCommands.SRC_PREC, "java");
    return defs;
}

9. CorresponSearchPageTest#getListPluralData2()

View license
private List<FullTextSearchCorresponsResult> getListPluralData2() {
    // ???????????
    List<FullTextSearchCorresponsResult> list = new ArrayList<FullTextSearchCorresponsResult>();
    MockFullTextSearchCorresponsResult temp = new MockFullTextSearchCorresponsResult();
    Map<String, String> attr = new HashMap<String, String>();
    List<FullTextSearchSummaryData> summaryList = new ArrayList<FullTextSearchSummaryData>();
    temp.setAttributeTest(attr);
    String start = "<span style=\"font-weight: bold;\">";
    String end = "</span>";
    summaryList.add(new FullTextSearchSummaryData("????", true));
    summaryList.add(new FullTextSearchSummaryData(start, false));
    summaryList.add(new FullTextSearchSummaryData("??", true));
    summaryList.add(new FullTextSearchSummaryData(end, false));
    summaryList.add(new FullTextSearchSummaryData("??", true));
    temp.setSummaryList(summaryList);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    summaryList = new ArrayList<FullTextSearchSummaryData>();
    temp.setAttributeTest(attr);
    summaryList.add(new FullTextSearchSummaryData("?????", true));
    summaryList.add(new FullTextSearchSummaryData(start, false));
    summaryList.add(new FullTextSearchSummaryData("????", true));
    summaryList.add(new FullTextSearchSummaryData(end, false));
    summaryList.add(new FullTextSearchSummaryData("????", true));
    temp.setSummaryList(summaryList);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    temp = new MockFullTextSearchCorresponsResult();
    attr = new HashMap<String, String>();
    temp.setAttributeTest(attr);
    list.add(temp);
    return list;
}

10. MlpModelTest#makeFeatureVector()

Project: aerosolve
Source File: MlpModelTest.java
View license
public FeatureVector makeFeatureVector() {
    FeatureVector featureVector = new FeatureVector();
    HashMap stringFeatures = new HashMap<String, HashSet<String>>();
    featureVector.setStringFeatures(stringFeatures);
    HashMap floatFeatures = new HashMap<String, HashMap<String, Double>>();
    featureVector.setFloatFeatures(floatFeatures);
    HashMap feature = new HashMap<String, Float>();
    feature.put("a", 1.0);
    feature.put("b", 2.0);
    floatFeatures.put("in", feature);
    return featureVector;
}

11. LoadBalancer#init()

Project: floodlight
Source File: LoadBalancer.java
View license
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
    floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
    restApiService = context.getServiceImpl(IRestApiService.class);
    debugCounterService = context.getServiceImpl(IDebugCounterService.class);
    deviceManagerService = context.getServiceImpl(IDeviceService.class);
    routingEngineService = context.getServiceImpl(IRoutingService.class);
    topologyService = context.getServiceImpl(ITopologyService.class);
    sfpService = context.getServiceImpl(IStaticEntryPusherService.class);
    switchService = context.getServiceImpl(IOFSwitchService.class);
    vips = new HashMap<String, LBVip>();
    pools = new HashMap<String, LBPool>();
    members = new HashMap<String, LBMember>();
    vipIpToId = new HashMap<Integer, String>();
    vipIpToMac = new HashMap<Integer, MacAddress>();
    memberIpToId = new HashMap<Integer, String>();
}

12. LoanTransactionHelper#getAddAndDeleteDisbursementsAsJSON()

View license
public static String getAddAndDeleteDisbursementsAsJSON(final String approvalAmount, final String expectedDisbursementDate, final List<HashMap> disbursementData) {
    final HashMap map = new HashMap<>();
    map.put("locale", "en");
    map.put("dateFormat", "dd MMMM yyyy");
    map.put("approvedLoanAmount", approvalAmount);
    map.put("expectedDisbursementDate", expectedDisbursementDate);
    map.put("disbursementData", disbursementData);
    String json = new Gson().toJson(map);
    System.out.println(json);
    return json;
}

13. SootConfigProjectLauncher#setEclipseDefs()

View license
private HashMap setEclipseDefs() {
    HashMap defs = new HashMap();
    defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation());
    defs.put(LaunchCommands.SOOT_CLASSPATH, getProcess_path() + getSootClasspath().getSeparator() + getClasspathAppend());
    defs.put(LaunchCommands.PROCESS_PATH, getProcess_path());
    defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean(true));
    defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean(true));
    return defs;
}

14. BastpUtil#getReplayGainValuesFromFile()

Project: vanilla
Source File: BastpUtil.java
View license
/**
	 *  Parse given file and return track,album replay gain values
	 */
private GainValues getReplayGainValuesFromFile(String path) {
    HashMap tags = (new Bastp()).getTags(path);
    GainValues gv = new GainValues();
    // normal replay gain, add 5dB difference
    if (tags.containsKey("REPLAYGAIN_TRACK_GAIN"))
        gv.track = getFloatFromString((String) ((Vector) tags.get("REPLAYGAIN_TRACK_GAIN")).get(0));
    if (tags.containsKey("REPLAYGAIN_ALBUM_GAIN"))
        gv.album = getFloatFromString((String) ((Vector) tags.get("REPLAYGAIN_ALBUM_GAIN")).get(0));
    // likely OPUS
    if (tags.containsKey("R128_BASTP_BASE_GAIN"))
        gv.base = 0.0f + getFloatFromString((String) ((Vector) tags.get("R128_BASTP_BASE_GAIN")).get(0)) / 256.0f;
    if (tags.containsKey("R128_TRACK_GAIN"))
        gv.track = 5.0f + getFloatFromString((String) ((Vector) tags.get("R128_TRACK_GAIN")).get(0)) / 256.0f;
    if (tags.containsKey("R128_ALBUM_GAIN"))
        gv.album = 5.0f + getFloatFromString((String) ((Vector) tags.get("R128_ALBUM_GAIN")).get(0)) / 256.0f;
    return gv;
}

15. Skeleton#reset()

Project: apache-aries
Source File: Skeleton.java
View license
/* ------------------------------------------------------------------------ */
/* reset method                                    
  /* ------------------------------------------------------------------------ */
/**
   * This method resets the skeleton to the state it was in prior just after it
   * was constructed. 
   */
public void reset() {
    _methodCalls = new LinkedList<MethodCall>();
    _callHandlers = new HashMap<MethodCall, MethodCallHandler>();
    _typeHandlers = new HashMap<Class<?>, ReturnTypeHandler>();
    DefaultReturnTypeHandlers.registerDefaultHandlers(this);
    DefaultMethodCallHandlers.registerDefaultHandlers(this);
    default_Handler = new DefaultInvocationHandler(this);
    _mockParameters = new HashMap<String, Object>();
    _objectProperties = new HashMap<Object, Map<String, Object>>();
    _notificationListeners = new HashMap<Class<?>, List<ExceptionListener>>();
}

16. Skeleton#reset()

Project: aries
Source File: Skeleton.java
View license
/* ------------------------------------------------------------------------ */
/* reset method                                    
  /* ------------------------------------------------------------------------ */
/**
   * This method resets the skeleton to the state it was in prior just after it
   * was constructed. 
   */
public void reset() {
    _methodCalls = new LinkedList<MethodCall>();
    _callHandlers = new HashMap<MethodCall, MethodCallHandler>();
    _typeHandlers = new HashMap<Class<?>, ReturnTypeHandler>();
    DefaultReturnTypeHandlers.registerDefaultHandlers(this);
    DefaultMethodCallHandlers.registerDefaultHandlers(this);
    default_Handler = new DefaultInvocationHandler(this);
    _mockParameters = new HashMap<String, Object>();
    _objectProperties = new HashMap<Object, Map<String, Object>>();
    _notificationListeners = new HashMap<Class<?>, List<ExceptionListener>>();
}

17. BasicMinBinTest#testSimpleCollections()

View license
@Override
@Test
public void testSimpleCollections() throws Exception {
    HashMap obj = new HashMap();
    ArrayList li = new ArrayList();
    li.add("zero");
    li.add("second");
    obj.put("x", li);
    obj.put("y", li);
    obj.put(3, "99999");
    out.writeObject(obj);
    MBPrinter.printMessage(out.getBuffer(), System.out);
    writeTmp("simplecollections.minbin", out.getBuffer());
    final byte[] copyOfWrittenBuffer = out.getCopyOfWrittenBuffer();
    in.resetForReuseUseArray(copyOfWrittenBuffer);
    out.flush();
    HashMap res = (HashMap) in.readObject();
    assertTrue(res.get("x") == res.get("y"));
    assertTrue(DeepEquals.deepEquals(obj, res));
}

18. JobConfigTest#shouldPopulateEnvironmentVariablesFromAttributeMap()

Project: gocd
Source File: JobConfigTest.java
View license
@Test
public void shouldPopulateEnvironmentVariablesFromAttributeMap() {
    JobConfig jobConfig = new JobConfig();
    HashMap map = new HashMap();
    HashMap valueHashMap = new HashMap();
    valueHashMap.put("name", "FOO");
    valueHashMap.put("value", "BAR");
    map.put(JobConfig.ENVIRONMENT_VARIABLES, valueHashMap);
    EnvironmentVariablesConfig mockEnvironmentVariablesConfig = mock(EnvironmentVariablesConfig.class);
    jobConfig.setVariables(mockEnvironmentVariablesConfig);
    jobConfig.setConfigAttributes(map);
    verify(mockEnvironmentVariablesConfig).setConfigAttributes(valueHashMap);
}

19. JobConfigTest#shouldPopulateArtifactPlansFromAttributeMap()

Project: gocd
Source File: JobConfigTest.java
View license
@Test
public void shouldPopulateArtifactPlansFromAttributeMap() {
    HashMap map = new HashMap();
    HashMap valueHashMap = new HashMap();
    valueHashMap.put("src", "dest");
    valueHashMap.put("src1", "dest1");
    map.put(JobConfig.ARTIFACT_PLANS, valueHashMap);
    ArtifactPlans mockArtifactPlans = mock(ArtifactPlans.class);
    JobConfig jobConfig = new JobConfig(new CaseInsensitiveString("job-name"), new Resources(), mockArtifactPlans);
    jobConfig.setConfigAttributes(map);
    verify(mockArtifactPlans).setConfigAttributes(valueHashMap);
}

20. StageConfigTest#shouldPopulateEnvironmentVariablesFromAttributeMap()

Project: gocd
Source File: StageConfigTest.java
View license
@Test
public void shouldPopulateEnvironmentVariablesFromAttributeMap() {
    StageConfig stageConfig = new StageConfig();
    HashMap map = new HashMap();
    HashMap valueHashMap = new HashMap();
    valueHashMap.put("name", "FOO");
    valueHashMap.put("value", "BAR");
    map.put(StageConfig.ENVIRONMENT_VARIABLES, valueHashMap);
    EnvironmentVariablesConfig mockEnvironmentVariablesConfig = mock(EnvironmentVariablesConfig.class);
    stageConfig.setVariables(mockEnvironmentVariablesConfig);
    stageConfig.setConfigAttributes(map);
    verify(mockEnvironmentVariablesConfig).setConfigAttributes(valueHashMap);
}

21. OfficeHelper#updateOffice()

View license
public Integer updateOffice(int id, String name, String openingDate) {
    final HashMap map = new HashMap<>();
    map.put("name", name);
    map.put("dateFormat", "dd MMMM yyyy");
    map.put("locale", "en");
    map.put("openingDate", openingDate);
    System.out.println("map : " + map);
    return Utils.performServerPut(requestSpec, responseSpec, OFFICE_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "resourceId");
}

22. SootConfigFileLauncher#setEclipseDefs()

Project: JAADAS
Source File: SootConfigFileLauncher.java
View license
private HashMap setEclipseDefs() {
    HashMap defs = new HashMap();
    defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation());
    defs.put(LaunchCommands.SOOT_CLASSPATH, getClasspathAppend());
    if (isSrcPrec()) {
        defs.put(LaunchCommands.SRC_PREC, getSrcPrec());
    }
    defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean(true));
    defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean(true));
    return defs;
}

23. SootConfigFromJavaFileLauncher#setEclipseDefs()

View license
private HashMap setEclipseDefs() {
    HashMap defs = new HashMap();
    defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation());
    defs.put(LaunchCommands.SOOT_CLASSPATH, getClasspathAppend());
    if (isSrcPrec()) {
        defs.put(LaunchCommands.SRC_PREC, getSrcPrec());
    }
    defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean(true));
    defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean(true));
    return defs;
}

24. CmsUserDataImportDialog#initWorkplaceRequestValues()

View license
/**
     * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
     */
@Override
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) {
    // initialize parameters and dialog actions in super implementation
    super.initWorkplaceRequestValues(settings, request);
    HashMap objectsMap = new HashMap();
    objectsMap.put("groups", getGroups());
    objectsMap.put("roles", getRoles());
    objectsMap.put("importfile", m_importFile);
    objectsMap.put("password", m_password);
    // save the current state of the message (may be changed because of the widget values)
    setDialogObject(objectsMap);
}

25. JpaActivityStreamsEntryTest#testEntity()

View license
public static JpaActivityStreamsEntry testEntity() {
    HashMap hm1 = new HashMap();
    HashMap hm2 = new HashMap();
    hm1.put("FOO", "BAR");
    hm1.put("FAZ", "BAZ");
    hm2.put("ABC", "DEF");
    JpaActivityStreamsEntry test = new JpaActivityStreamsEntry();
    test.setPublished(new Date(1234567890));
    test.setUpdated(new Date(987654321));
    test.setUrl("http://apache.org");
    test.setObjectType("IMAGE");
    test.setOpenSocial(hm1);
    test.setExtensions(hm2);
    test.setContent("content");
    test.setActor(JpaActivityStreamsObjectTest.testEntity());
    test.setGenerator(JpaActivityStreamsObjectTest.testEntity());
    test.setId("testing_id");
    test.setAppId("application_id");
    return test;
}

26. XMLSaveOptionsTestCase#testSaveXMLDocumentXMLStreamHelper()

View license
//use XMLStreamHelper
public void testSaveXMLDocumentXMLStreamHelper() throws Exception {
    final HashMap options = new HashMap();
    options.put(SDOHelper.XMLOptions.XML_LOAD_SCHEMA, Boolean.FALSE);
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_INDENT, INDENT);
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_MARGIN, MARGIN);
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_LINE_BREAK, LINE_BREAK);
    final HelperContext hc = SDOUtil.createHelperContext(false, options);
    xmlStreamHelper = SDOUtil.createXMLStreamHelper(hc);
    xsdHelper = hc.getXSDHelper();
    define("/simple.xsd");
    final InputStream inStrm = getClass().getResourceAsStream("/shallowquote.xml");
    final XMLDocument document = hc.getXMLHelper().load(inStrm, null, null);
    final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
    final StringWriter writer = new StringWriter();
    final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
    xmlStreamHelper.save(document, streamWriter, null);
    streamWriter.flush();
    assertEquals(formatted2, writer.toString());
}

27. ID3v2File#normalizeTaginfo()

Project: vanilla
Source File: ID3v2File.java
View license
/* Converts ID3v2 sillyframes to OggNames */
private String[] normalizeTaginfo(String k, byte[] v) {
    String[] rv = new String[] { "", "" };
    HashMap lu = new HashMap<String, String>();
    lu.put("TIT2", "TITLE");
    lu.put("TALB", "ALBUM");
    lu.put("TPE1", "ARTIST");
    if (lu.containsKey(k)) {
        /* A normal, known key: translate into Ogg-Frame name */
        rv[0] = (String) lu.get(k);
        rv[1] = getDecodedString(v);
    } else if (k.equals("TXXX")) {
        /* A freestyle field, ieks! */
        String txData[] = getDecodedString(v).split(Character.toString('\0'), 2);
        /* Check if we got replaygain info in key\0value style */
        if (txData.length == 2 && txData[0].matches("^(?i)REPLAYGAIN_(ALBUM|TRACK)_GAIN$")) {
            rv[0] = txData[0].toUpperCase();
            /* some tagwriters use lowercase for this */
            rv[1] = txData[1];
        }
    }
    return rv;
}

28. ApacheJSONObjectTest#test_newFromMap()

Project: wink
Source File: ApacheJSONObjectTest.java
View license
/**
     * Test the construction from a simple map.
     */
public void test_newFromMap() {
    JSONObject jObject = null;
    Exception ex = null;
    HashMap map = new HashMap();
    map.put("string", "This is a string");
    map.put("null", null);
    map.put("integer", new Integer(1));
    map.put("bool", new Boolean(true));
    // Load a JSON object from a map with JSONable values.
    try {
        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
        JSONFactory factory = JSONFactory.newInstance();
        jObject = factory.createJSONObject(map);
    } catch (Exception ex1) {
        ex = ex1;
        ex.printStackTrace();
    }
    assertTrue(jObject != null);
    assertTrue(jObject.length() == 4);
    assertTrue(ex == null);
}

29. BridgeReconnectTest#setUp()

View license
@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    server0Params = new HashMap<>();
    server1Params = new HashMap<>();
    server2Params = new HashMap<>();
    connectors = new HashMap<>();
    server1 = createActiveMQServer(1, isNetty(), server1Params);
    server1tc = new TransportConfiguration(getConnector(), server1Params, "server1tc");
    connectors.put(server1tc.getName(), server1tc);
    staticConnectors = new ArrayList<>();
    staticConnectors.add(server1tc.getName());
}

30. Translator#reset()

Project: ardublock
Source File: Translator.java
View license
public void reset() {
    headerFileSet = new LinkedHashSet<String>();
    definitionSet = new LinkedHashSet<String>();
    setupCommand = new LinkedList<String>();
    guinoCommand = new LinkedList<String>();
    functionNameSet = new HashSet<String>();
    inputPinSet = new HashSet<String>();
    outputPinSet = new HashSet<String>();
    bodyTranslatreFinishCallbackSet = new HashSet<TranslatorBlock>();
    numberVariableSet = new HashMap<String, String>();
    booleanVariableSet = new HashMap<String, String>();
    stringVariableSet = new HashMap<String, String>();
    internalData = new HashMap<String, Object>();
    blockAdaptor = buildOpenBlocksAdaptor();
    variableCnt = 0;
    rootBlockName = null;
    isScoopProgram = false;
    isGuinoProgram = false;
}

31. BigObjTest#testWithStreams()

Project: fast-serialization
Source File: BigObjTest.java
View license
@Test
public void testWithStreams() throws IOException, ClassNotFoundException {
    HashMap hm = createHM();
    HashMap hm1 = createHM1(hm);
    FSTObjectOutput out = new FSTObjectOutput(new FileOutputStream("../epsis.oos"));
    out.writeObject(hm);
    out.writeObject(hm1);
    out.close();
    FSTObjectInput in = new FSTObjectInput(new FileInputStream("../epsis.oos"));
    HashMap o1 = (HashMap) in.readObject();
    HashMap o2 = (HashMap) in.readObject();
    in.close();
    Assert.assertTrue(DeepEquals.deepEquals(o1, hm));
    Assert.assertTrue(DeepEquals.deepEquals(o2, hm1));
}

32. WeatherService#getWeatherMap()

Project: flex-blazeds
Source File: WeatherService.java
View license
public Map getWeatherMap(String zipCode) {
    HashMap map = new HashMap();
    WeatherInfo info = getWeatherInfo(zipCode);
    map.put("location", info.getLocation());
    map.put("temperature", info.getTemperature());
    map.put("forecast", info.getForecast());
    /*
        map.put("extended", new String[0]);
        String[] extended = info.getExtendedForecast();
        for (int i = 0; i < extended.length; ++i)
        {
            extended[i] = "extended" + i;
        }
        map.put("extended", extended);
        */
    return map;
}

33. ACL#init()

Project: floodlight
Source File: ACL.java
View license
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
    restApi = context.getServiceImpl(IRestApiService.class);
    deviceManager = context.getServiceImpl(IDeviceService.class);
    logger = LoggerFactory.getLogger(ACL.class);
    storageSource = context.getServiceImpl(IStorageSourceService.class);
    aclRules = new TreeMap<>();
    apManager = new APManager();
    ruleId2FlowName = new HashMap<>();
    ruleId2Dpid = new HashMap<>();
    dpid2FlowPriority = new HashMap<>();
    deny2Allow = new HashMap<>();
}

34. StageConfigTest#shouldRemoveStageLevelAuthorizationWhenInheritingPermissionsFromGroup()

Project: gocd
Source File: StageConfigTest.java
View license
@Test
public void shouldRemoveStageLevelAuthorizationWhenInheritingPermissionsFromGroup() {
    StageConfig config = new StageConfig();
    StageConfigMother.addApprovalWithRoles(config, "role1");
    StageConfigMother.addApprovalWithUsers(config, "user1");
    HashMap map = new HashMap();
    List operateUsers = new ArrayList();
    operateUsers.add(nameMap("user1"));
    map.put(StageConfig.OPERATE_USERS, operateUsers);
    List operateRoles = new ArrayList();
    operateRoles.add(nameMap("role1"));
    map.put(StageConfig.OPERATE_ROLES, operateRoles);
    map.put(StageConfig.SECURITY_MODE, "inherit");
    config.setConfigAttributes(map);
    assertThat(config.getApproval().getAuthConfig().isEmpty(), is(true));
}

35. StageConfigTest#shouldSetOperateUsers()

Project: gocd
Source File: StageConfigTest.java
View license
@Test
public void shouldSetOperateUsers() {
    StageConfig config = new StageConfig();
    HashMap map = new HashMap();
    List operateUsers = new ArrayList();
    operateUsers.add(nameMap("user1"));
    operateUsers.add(nameMap("user1"));
    operateUsers.add(nameMap("user2"));
    map.put(StageConfig.OPERATE_USERS, operateUsers);
    map.put(StageConfig.OPERATE_ROLES, new ArrayList());
    map.put(StageConfig.SECURITY_MODE, "define");
    config.setConfigAttributes(map);
    assertThat(config.getOperateUsers().size(), is(2));
    assertThat(config.getOperateUsers(), hasItem(new AdminUser(new CaseInsensitiveString("user1"))));
    assertThat(config.getOperateUsers(), hasItem(new AdminUser(new CaseInsensitiveString("user2"))));
}

36. StageConfigTest#shouldSetOperateRoles()

Project: gocd
Source File: StageConfigTest.java
View license
@Test
public void shouldSetOperateRoles() {
    StageConfig config = new StageConfig();
    HashMap map = new HashMap();
    List operateRoles = new ArrayList();
    operateRoles.add(nameMap("role1"));
    operateRoles.add(nameMap("role1"));
    operateRoles.add(nameMap("role2"));
    map.put(StageConfig.OPERATE_ROLES, operateRoles);
    map.put(StageConfig.OPERATE_USERS, new ArrayList());
    map.put(StageConfig.SECURITY_MODE, "define");
    config.setConfigAttributes(map);
    assertThat(config.getOperateRoles().size(), is(2));
    assertThat(config.getOperateRoles(), hasItem(new AdminRole(new CaseInsensitiveString("role1"))));
    assertThat(config.getOperateRoles(), hasItem(new AdminRole(new CaseInsensitiveString("role2"))));
}

37. CenterHelper#createCenter()

View license
public static int createCenter(final String name, final int officeId, final String externalId, final int staffId, final int[] groupMembers, final String activationDate, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
    final String CREATE_CENTER_URL = CENTERS_URL + "?" + Utils.TENANT_IDENTIFIER;
    HashMap hm = new HashMap();
    hm.put("name", name);
    hm.put("officeId", officeId);
    hm.put("active", false);
    if (externalId != null)
        hm.put("externalId", externalId);
    if (staffId != -1)
        hm.put("staffId", staffId);
    if (groupMembers != null)
        hm.put("groupMembers", groupMembers);
    if (activationDate != null) {
        hm.put("active", true);
        hm.put("locale", "en");
        hm.put("dateFormat", "dd MMM yyyy");
        hm.put("activationDate", activationDate);
    }
    System.out.println("------------------------CREATING CENTER-------------------------");
    return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, new Gson().toJson(hm), "resourceId");
}

38. CbSailIntegrationTest#testCbSail()

View license
public void testCbSail() throws Exception {
    String underGradInfo = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" + " PREFIX ub: <urn:test:onto:univ#>" + " SELECT * WHERE" + " {" + "       <http://www.Department0.University0.edu/UndergraduateStudent600> ?pred ?obj ." + " }";
    HashMap map = new HashMap();
    map.put(CbSailComponent.SPARQL_QUERY_PROP, underGradInfo);
    map.put(CbSailComponent.START_TIME_QUERY_PROP, 0l);
    map.put(CbSailComponent.TTL_QUERY_PROP, 86400000l);
    Object o = producer.requestBodyAndHeaders(null, map);
    System.out.println(o);
    Thread.sleep(100000);
}

39. HashMapTest#test_putAllLjava_util_Map()

Project: j2objc
Source File: HashMapTest.java
View license
/**
     * java.util.HashMap#putAll(java.util.Map)
     */
public void test_putAllLjava_util_Map() {
    // Test for method void java.util.HashMap.putAll(java.util.Map)
    HashMap hm2 = new HashMap();
    hm2.putAll(hm);
    for (int i = 0; i < 1000; i++) assertTrue("Failed to clear all elements", hm2.get(new Integer(i).toString()).equals((new Integer(i))));
    Map mockMap = new MockMap();
    hm2 = new HashMap();
    hm2.putAll(mockMap);
    assertEquals("Size should be 0", 0, hm2.size());
}

40. Config#registerMetricsConsumer()

Project: jstorm
Source File: Config.java
View license
public static void registerMetricsConsumer(Map conf, Class klass, Object argument, long parallelismHint) {
    HashMap m = new HashMap();
    m.put("class", klass.getCanonicalName());
    m.put("parallelism.hint", parallelismHint);
    m.put("argument", argument);
    List l = (List) conf.get(TOPOLOGY_METRICS_CONSUMER_REGISTER);
    if (l == null) {
        l = new ArrayList();
    }
    l.add(m);
    conf.put(TOPOLOGY_METRICS_CONSUMER_REGISTER, l);
}

41. ReplToolTesting#initSnippets()

Project: openjdk
Source File: ReplToolTesting.java
View license
private void initSnippets() {
    keys = new ArrayList<>();
    variables = new HashMap<>();
    methods = new HashMap<>();
    classes = new HashMap<>();
    imports = new HashMap<>();
    if (isDefaultStartUp) {
        methods.putAll(START_UP_METHODS.stream().collect(Collectors.toMap(Object::toString, Function.identity())));
        imports.putAll(START_UP_IMPORTS.stream().collect(Collectors.toMap(Object::toString, Function.identity())));
    }
}

42. CloudBalancingIncrementalScoreCalculator#resetWorkingSolution()

View license
@Override
public void resetWorkingSolution(CloudBalance cloudBalance) {
    int computerListSize = cloudBalance.getComputerList().size();
    cpuPowerUsageMap = new HashMap<>(computerListSize);
    memoryUsageMap = new HashMap<>(computerListSize);
    networkBandwidthUsageMap = new HashMap<>(computerListSize);
    processCountMap = new HashMap<>(computerListSize);
    for (CloudComputer computer : cloudBalance.getComputerList()) {
        cpuPowerUsageMap.put(computer, 0);
        memoryUsageMap.put(computer, 0);
        networkBandwidthUsageMap.put(computer, 0);
        processCountMap.put(computer, 0);
    }
    hardScore = 0;
    softScore = 0;
    for (CloudProcess process : cloudBalance.getProcessList()) {
        insert(process);
    }
}

43. PrefsBean#getPreferencePriorityColors()

Project: sakai
Source File: PrefsBean.java
View license
public static Map getPreferencePriorityColors() {
    HashMap map = new HashMap();
    String h = getPreferenceString(PREFS_HIGHPRIORITY_COLOR);
    String m = getPreferenceString(PREFS_MEDIUMPRIORITY_COLOR);
    String l = getPreferenceString(PREFS_LOWPRIORITY_COLOR);
    // preferences not set, read from sakai.properties		
    if (h == null && m == null && l == null) {
        h = getDefaultStringFromSakaiProperties(PREFS_HIGHPRIORITY_COLOR);
        m = getDefaultStringFromSakaiProperties(PREFS_MEDIUMPRIORITY_COLOR);
        l = getDefaultStringFromSakaiProperties(PREFS_LOWPRIORITY_COLOR);
    }
    map.put(PREFS_HIGHPRIORITY_COLOR, h);
    map.put(PREFS_MEDIUMPRIORITY_COLOR, m);
    map.put(PREFS_LOWPRIORITY_COLOR, l);
    return map;
}

44. MockConnection#clear()

Project: spacewalk
Source File: MockConnection.java
View license
public static void clear() {
    profiles = new ArrayList<Map>();
    distros = new ArrayList<Map>();
    systems = new ArrayList<Map>();
    images = new ArrayList<Map>();
    systemMap = new HashMap<String, Map>();
    profileMap = new HashMap<String, Map>();
    distroMap = new HashMap<String, Map>();
    imageMap = new HashMap<String, Map>();
}

45. JoinMatrix#precomputeFrequencies()

Project: squall
Source File: JoinMatrix.java
View license
public void precomputeFrequencies() {
    // for x
    _freqX = new HashMap<JAT, Integer>();
    _keyXFirstPos = new HashMap<JAT, Integer>();
    for (int i = 0; i < getXSize(); i++) {
        addElement(_freqX, _keyXFirstPos, getJoinAttributeX(i), i);
    }
    // System.out.println("FreqX = " + _freqX);
    // for y
    _freqY = new HashMap<JAT, Integer>();
    _keyYFirstPos = new HashMap<JAT, Integer>();
    for (int j = 0; j < getYSize(); j++) {
        addElement(_freqY, _keyYFirstPos, getJoinAttributeY(j), j);
    }
// System.out.println("FreqY = " + _freqY);
}

46. XMLSaveOptionsTestCase#testSaveXMLDocumentXMLHelper()

View license
//use XMLHelper
public void testSaveXMLDocumentXMLHelper() throws IOException {
    final HashMap options = new HashMap();
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_INDENT, INDENT);
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_MARGIN, MARGIN);
    options.put(org.apache.tuscany.sdo.api.SDOHelper.XMLOptions.XML_SAVE_LINE_BREAK, LINE_BREAK);
    hc = SDOUtil.createHelperContext(false, options);
    xsdHelper = hc.getXSDHelper();
    xmlh = hc.getXMLHelper();
    // Populate the meta data for the test (Stock Quote) model
    define("/simpleWithChangeSummary.xsd");
    final XMLDocument doc = xmlh.load(getClass().getResource("/simpleWithChangeSummary.xml").openStream());
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlh.save(xmlh.createDocument(doc.getRootObject(), doc.getRootElementURI(), doc.getRootElementName()), baos, null);
    assertEquals(formatted1, baos.toString());
}

47. CrossTransformTest#makeFeatureVector()

Project: aerosolve
Source File: CrossTransformTest.java
View license
public FeatureVector makeFeatureVector() {
    HashMap stringFeatures = new HashMap<String, Set<String>>();
    Set list = new HashSet<String>();
    list.add("aaa");
    list.add("bbb");
    stringFeatures.put("feature1", list);
    Set list2 = new HashSet<String>();
    list2.add("11");
    list2.add("22");
    stringFeatures.put("feature2", list2);
    FeatureVector featureVector = new FeatureVector();
    featureVector.setStringFeatures(stringFeatures);
    return featureVector;
}

48. FeatureDictionaryTest#makeDenseFeatureVector()

View license
public FeatureVector makeDenseFeatureVector(String id, double v1, double v2) {
    ArrayList list = new ArrayList<Double>();
    list.add(v1);
    list.add(v2);
    HashMap denseFeatures = new HashMap<String, List<Double>>();
    denseFeatures.put("a", list);
    ArrayList list2 = new ArrayList<Double>();
    list2.add(v2);
    list2.add(v1);
    denseFeatures.put("b", list2);
    Set<String> list3 = new HashSet<>();
    list3.add(id);
    Map<String, Set<String>> stringFeatures = new HashMap<>();
    stringFeatures.put("id", list3);
    FeatureVector featureVector = new FeatureVector();
    featureVector.setDenseFeatures(denseFeatures);
    featureVector.setStringFeatures(stringFeatures);
    return featureVector;
}

49. MainActivity#getData()

Project: android-app
Source File: MainActivity.java
View license
private List<Map<String, Object>> getData() {
    List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(LIST_TEXT, getResources().getString(R.string.menuGood));
    map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_handpick);
    list.add(map);
    map = new HashMap<String, Object>();
    map.put(LIST_TEXT, getResources().getString(R.string.menuNews));
    map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_news);
    list.add(map);
    map = new HashMap<String, Object>();
    map.put(LIST_TEXT, getResources().getString(R.string.menuStudio));
    map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_studio);
    list.add(map);
    map = new HashMap<String, Object>();
    map.put(LIST_TEXT, getResources().getString(R.string.menuBlog));
    map.put(LIST_IMAGEVIEW, R.drawable.dis_menu_blog);
    list.add(map);
    return list;
}

50. StartActivity#getDrawerItems()

Project: AnimeTaste
Source File: StartActivity.java
View license
private List<Map<String, Object>> getDrawerItems() {
    List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("img", R.drawable.drawer_light);
    map.put("title", getString(R.string.guess));
    list.add(map);
    map = new HashMap<String, Object>();
    map.put("img", R.drawable.drawer_all);
    map.put("title", getString(R.string.latest));
    list.add(map);
    map = new HashMap<String, Object>();
    map.put("img", R.drawable.drawer_heart);
    map.put("title", getString(R.string.my_fav));
    list.add(map);
    map = new HashMap<String, Object>();
    map.put("img", R.drawable.drawer_download);
    map.put("title", getString(R.string.my_download));
    list.add(map);
    return list;
}

51. AJAXRPC#setUp()

Project: axis1-java
Source File: AJAXRPC.java
View license
/**
     * Sets up the handlerInfo and handlerConfigs for all tests.
     * Each test has 3 JAX-RPC Handlers of the same type to keep things
     * simple.
     * 
     * @throws Exception 
     */
protected void setUp() throws Exception {
    handlerInfo0 = new HandlerInfo();
    handlerInfo0.setHandlerClass(AAAHandler.class);
    handlerInfo1 = new HandlerInfo();
    handlerInfo1.setHandlerClass(AAAHandler.class);
    handlerInfo2 = new HandlerInfo();
    handlerInfo2.setHandlerClass(AAAHandler.class);
    handler0Config = new HashMap();
    handler1Config = new HashMap();
    handler2Config = new HashMap();
    handlerInfo0.setHandlerConfig(handler0Config);
    handlerInfo1.setHandlerConfig(handler1Config);
    handlerInfo2.setHandlerConfig(handler2Config);
}

52. TestDeser#testMap()

Project: axis1-java
Source File: TestDeser.java
View license
public void testMap() throws Exception {
    HashMap m = new HashMap();
    m.put("abcKey", "abcVal");
    m.put("defKey", "defVal");
    deserialize("<result xsi:type=\"xmlsoap:Map\" " + "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + "<item>" + "<key xsi:type=\"xsd:string\">abcKey</key>" + "<value xsi:type=\"xsd:string\">abcVal</value>" + "</item><item>" + "<key xsi:type=\"xsd:string\">defKey</key>" + "<value xsi:type=\"xsd:string\">defVal</value>" + "</item>" + "</result>", m);
}

53. TestDeser1999#testMapWithNulls()

Project: axis1-java
Source File: TestDeser1999.java
View license
public void testMapWithNulls() throws Exception {
    HashMap m = new HashMap();
    m.put(null, new Boolean("false"));
    m.put("hi", null);
    // Test map with nulls and
    // Test type references to the default namespace.
    deserialize("<result xsi:type=\"xmlsoap:Map\" " + "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + "<item>" + "<key xsi:null=\"true\"/>" + "<value xsi:type=\"boolean\" xmlns=\"" + Constants.URI_1999_SCHEMA_XSD + "\">false</value>" + "</item><item>" + "<key xsi:type=\"string\" xmlns=\"" + Constants.URI_1999_SCHEMA_XSD + "\">hi</key>" + "<value xsi:null=\"true\"/>" + "</item>" + "</result>", m);
}

54. TestDeser2000#testMapWithNulls()

Project: axis1-java
Source File: TestDeser2000.java
View license
public void testMapWithNulls() throws Exception {
    HashMap m = new HashMap();
    m.put(null, new Boolean("false"));
    m.put("hi", null);
    deserialize("<result xsi:type=\"xmlsoap:Map\" " + "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + "<item>" + "<key xsi:null=\"true\"/>" + "<value xsi:type=\"xsd:boolean\">false</value>" + "</item><item>" + "<key xsi:type=\"xsd:string\">hi</key>" + "<value xsi:null=\"true\"/>" + "</item>" + "</result>", m);
}

55. TestDeser2001#testMapWithNils()

Project: axis1-java
Source File: TestDeser2001.java
View license
public void testMapWithNils() throws Exception {
    HashMap m = new HashMap();
    m.put(null, new Boolean("false"));
    m.put("hi", null);
    deserialize("<result xsi:type=\"xmlsoap:Map\" " + "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + "<item>" + "<key xsi:nil=\"true\"/>" + "<value xsi:type=\"xsd:boolean\">false</value>" + "</item><item>" + "<key xsi:type=\"xsd:string\">hi</key>" + "<value xsi:nil=\"true\"/>" + "</item>" + "</result>", m);
}

56. AzkabanDatabaseSetup#loadTableInfo()

Project: azkaban
Source File: AzkabanDatabaseSetup.java
View license
public void loadTableInfo() throws IOException, SQLException {
    tables = new HashMap<String, String>();
    installedVersions = new HashMap<String, String>();
    missingTables = new HashSet<String>();
    upgradeList = new HashMap<String, List<String>>();
    dbProps = loadDBProps();
    version = dbProps.getString("version");
    loadInstalledTables();
    loadTableVersion();
    findMissingTables();
    findOutOfDateTables();
    needsUpdating = !upgradeList.isEmpty() || !missingTables.isEmpty();
}

57. PingInstancesMonitorImplTest#setup()

View license
@Before
public void setup() {
    monitor = new PingInstancesMonitorImpl();
    monitor.objectMetaDataManager = new DefaultObjectMetaDataManager() {

        public boolean isTransitioningState(Class<?> resourceType, String state) {
            return !restingStates.contains(state);
        }
    };
    knownInstances = new HashMap<String, KnownInstance>();
    needsSynced = new HashMap<String, ReportedInstance>();
    syncActions = new HashMap<String, String>();
    needsHaRestart = new HashSet<String>();
    reportedInstances = new ReportedInstances();
}

58. StyleSheet#applyStyle()

Project: clj-pdf
Source File: StyleSheet.java
View license
public void applyStyle(String tag, HashMap props) {
    HashMap map = (HashMap) tagMap.get(tag.toLowerCase());
    if (map != null) {
        HashMap temp = new HashMap(map);
        temp.putAll(props);
        props.putAll(temp);
    }
    String cm = (String) props.get(Markup.HTML_ATTR_CSS_CLASS);
    if (cm == null)
        return;
    map = (HashMap) classMap.get(cm.toLowerCase());
    if (map == null)
        return;
    props.remove(Markup.HTML_ATTR_CSS_CLASS);
    HashMap temp = new HashMap(map);
    temp.putAll(props);
    props.putAll(temp);
}

59. MapUtilsTest#setUpClass()

Project: cloud-slang
Source File: MapUtilsTest.java
View license
@BeforeClass
public static void setUpClass() {
    map1 = new HashMap<>();
    map1.put("key1", ValueFactory.create(1));
    map1.put("key2", ValueFactory.create("value2"));
    map2 = new HashMap<>();
    map2.put("key1", ValueFactory.create(2));
    map2.put("key3", ValueFactory.create("value3"));
    map_1_2 = new HashMap<>();
    map_1_2.putAll(map1);
    map_1_2.putAll(map2);
}

60. SimplePathInterpreterTest#setUp()

View license
protected void setUp() throws Exception {
    bean = TestBeanWithNode.createTestBeanWithDOM();
    HashMap submap = new HashMap();
    submap.put("key", new NestedTestBean("Name 9"));
    submap.put("strings", bean.getNestedBean().getStrings());
    bean.getList().add(new int[] { 1, 2 });
    bean.getList().add(bean.getVendor());
    bean.getMap().put("Key3", new Object[] { new NestedTestBean("some"), new Integer(2), bean.getVendor(), submap });
    bean.getMap().put("Key4", bean.getVendor());
    bean.getMap().put("Key5", submap);
    bean.getMap().put("Key6", new Object[0]);
    context = JXPathContext.newContext(null, bean);
    context.setLenient(true);
    context.setFactory(new TestBeanFactory());
}

61. NavigationBean#getTemplateModel()

View license
/**
    * Returns a model for use by a template on a space Dashboard page.
    * 
    * @return model containing current current space info.
    */
@SuppressWarnings("unchecked")
public Map getTemplateModel() {
    HashMap model = new HashMap(2, 1.0f);
    model.put("space", getCurrentNode().getNodeRef());
    model.put(TemplateService.KEY_IMAGE_RESOLVER, new TemplateImageResolver() {

        public String resolveImagePathForName(String filename, FileTypeImageSize size) {
            return FileTypeImageUtils.getFileTypeImage(FacesContext.getCurrentInstance(), filename, size);
        }
    });
    return model;
}

62. DependencyParser#generateIDs()

Project: CoreNLP
Source File: DependencyParser.java
View license
/**
   * Generate unique integer IDs for all known words / part-of-speech
   * tags / dependency relation labels.
   *
   * All three of the aforementioned types are assigned IDs from a
   * continuous range of integers; all IDs 0 <= ID < n_w are word IDs,
   * all IDs n_w <= ID < n_w + n_pos are POS tag IDs, and so on.
   */
private void generateIDs() {
    wordIDs = new HashMap<>();
    posIDs = new HashMap<>();
    labelIDs = new HashMap<>();
    int index = 0;
    for (String word : knownWords) wordIDs.put(word, (index++));
    for (String pos : knownPos) posIDs.put(pos, (index++));
    for (String label : knownLabels) labelIDs.put(label, (index++));
}

63. DOIDataCiteServiceBean#updateIdentifierStatus()

View license
private void updateIdentifierStatus(Dataset dataset, String statusIn) throws Exception {
    String identifier = getIdentifierFromDataset(dataset);
    HashMap metadata = getUpdateMetadataFromDataset(dataset);
    metadata.put("_target", getTargetUrl(dataset));
    metadata.put("_status", statusIn);
    try {
        doiDataCiteRegisterService.createIdentifier(identifier, metadata, dataset);
    } catch (Exception e) {
        logger.log(Level.INFO, "modifyMetadata failed");
        logger.log(Level.INFO, "String " + e.toString());
        logger.log(Level.INFO, "localized message " + e.getLocalizedMessage());
        logger.log(Level.INFO, "cause " + e.getCause());
        logger.log(Level.INFO, "message " + e.getMessage());
        throw e;
    }
}

64. TestDatatypes#testLongVarBinary()

Project: ddlutils
Source File: TestDatatypes.java
View license
/**
     * Tests a simple LONGVARBINARY column.
     */
public void testLongVarBinary() {
    final String modelXml = "<?xml version='1.0' encoding='ISO-8859-1'?>\n" + "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n" + "  <table name='roundtrip'>\n" + "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n" + "    <column name='avalue' type='LONGVARBINARY'/>\n" + "  </table>\n" + "</database>";
    HashMap value = new HashMap();
    value.put("test1", "some value");
    value.put(null, "some other value");
    BinaryObjectsHelper helper = new BinaryObjectsHelper();
    performDataTypeTest(modelXml, helper.serialize(value), null, value, null);
}

65. TestDatatypes#testBlob()

Project: ddlutils
Source File: TestDatatypes.java
View license
/**
     * Tests a simple BLOB column.
     */
public void testBlob() {
    final String modelXml = "<?xml version='1.0' encoding='ISO-8859-1'?>\n" + "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n" + "  <table name='roundtrip'>\n" + "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n" + "    <column name='avalue' type='BLOB'/>\n" + "  </table>\n" + "</database>";
    HashMap value = new HashMap();
    value.put("test1", "some value");
    value.put(null, "some other value");
    BinaryObjectsHelper helper = new BinaryObjectsHelper();
    performDataTypeTest(modelXml, helper.serialize(value), null, value, null);
}

66. DocumentRecordTest#testMultiValue()

Project: Duke
Source File: DocumentRecordTest.java
View license
@Test
public void testMultiValue() throws IOException {
    // First, index up the record
    HashMap props = new HashMap();
    props.put("ID", Collections.singleton("abc"));
    Collection<String> list = new ArrayList();
    list.add("b");
    list.add("c");
    props.put("NAME", list);
    Record r = new RecordImpl(props);
    db.index(r);
    db.commit();
    // Then, retrieve it and verify that it's correct
    r = db.findRecordById("abc");
    assertEquals("abc", r.getValue("ID"));
    list = r.getValues("NAME");
    assertEquals(2, list.size());
    assertTrue(list.contains("b"));
    assertTrue(list.contains("c"));
}

67. TestObjectServer#client()

View license
public void client() throws Exception {
    TCPObjectSocket socket = new TCPObjectSocket("localhost", 5555);
    // send request
    HashMap toWrite = new HashMap();
    toWrite.put("Greetings form year ", 2014);
    toWrite.put("Random ", Math.random());
    socket.writeObject(toWrite);
    // <== important, else nothing happens !
    socket.flush();
    // await 2 responses
    System.out.println(socket.readObject());
    System.out.println(socket.readObject());
    // done, close
    socket.close();
    ok = true;
}

68. TasksTest#shouldSetConfigAttributesForBuiltinTask()

Project: gocd
Source File: TasksTest.java
View license
@Test
public void shouldSetConfigAttributesForBuiltinTask() throws Exception {
    HashMap attributes = new HashMap();
    attributes.put(Tasks.TASK_OPTIONS, "ant");
    attributes.put("ant", antTaskAttribs("build.xml", "test", "foo"));
    TaskFactory taskFactory = mock(TaskFactory.class);
    AntTask antTask = new AntTask();
    when(taskFactory.taskInstanceFor(antTask.getTaskType())).thenReturn(antTask);
    Tasks tasks = new Tasks();
    Tasks spy = spy(tasks);
    spy.setConfigAttributes(attributes, taskFactory);
    assertThat(spy.size(), is(1));
    assertThat((AntTask) spy.get(0), is(antTask("build.xml", "test", "foo")));
}

69. TrackingToolTest#shouldSetTrackingToolAttributesFromConfigMap()

Project: gocd
Source File: TrackingToolTest.java
View license
@Test
public void shouldSetTrackingToolAttributesFromConfigMap() {
    trackingTool = new TrackingTool();
    HashMap attributeMap = new HashMap();
    String expectedLink = "http://blah.com";
    attributeMap.put(TrackingTool.LINK, expectedLink);
    String expectedRegex = "[a-z]*";
    attributeMap.put(TrackingTool.REGEX, expectedRegex);
    trackingTool.setConfigAttributes(attributeMap);
    assertThat(trackingTool.getLink(), is(expectedLink));
    assertThat(trackingTool.getRegex(), is(expectedRegex));
}

70. EnvironmentVariableConfigTest#shouldAssignNameAndValueForAVanillaEnvironmentVariable()

View license
@Test
public void shouldAssignNameAndValueForAVanillaEnvironmentVariable() {
    EnvironmentVariableConfig environmentVariableConfig = new EnvironmentVariableConfig((GoCipher) null);
    HashMap attrs = new HashMap();
    attrs.put(EnvironmentVariableConfig.NAME, "foo");
    attrs.put(EnvironmentVariableConfig.VALUE, "password");
    environmentVariableConfig.setConfigAttributes(attrs);
    assertThat(environmentVariableConfig.getValue(), is("password"));
    assertThat(environmentVariableConfig.getName(), is("foo"));
    assertThat(environmentVariableConfig.isSecure(), is(false));
}

71. AdminServiceTest#shouldUpdateConfig()

Project: gocd
Source File: AdminServiceTest.java
View license
@Test
public void shouldUpdateConfig() throws Exception {
    HashMap attributes = new HashMap();
    String content = "config_xml";
    attributes.put("content", content);
    String md5 = "config_md5";
    attributes.put("md5", md5);
    HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
    GoConfigService.XmlPartialSaver fileSaver = mock(GoConfigService.XmlPartialSaver.class);
    when(fileSaver.saveXml(content, md5)).thenReturn(GoConfigValidity.valid());
    when(goConfigService.fileSaver(false)).thenReturn(fileSaver);
    adminService.updateConfig(attributes, result);
    assertThat(result.isSuccessful(), is(true));
    verify(fileSaver).saveXml(content, md5);
    verify(goConfigService).fileSaver(false);
}

72. AdminServiceTest#shouldReturnInvalidIfConfigIsNotSaved()

Project: gocd
Source File: AdminServiceTest.java
View license
@Test
public void shouldReturnInvalidIfConfigIsNotSaved() throws Exception {
    HashMap attributes = new HashMap();
    String content = "invalid_config_xml";
    attributes.put("content", content);
    String md5 = "config_md5";
    attributes.put("md5", md5);
    HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
    GoConfigService.XmlPartialSaver fileSaver = mock(GoConfigService.XmlPartialSaver.class);
    GoConfigValidity validity = GoConfigValidity.invalid("Wrong config xml");
    when(fileSaver.saveXml(content, md5)).thenReturn(validity);
    when(goConfigService.fileSaver(false)).thenReturn(fileSaver);
    GoConfigValidity actual = adminService.updateConfig(attributes, result);
    assertThat(result.isSuccessful(), is(false));
    assertThat(actual.isValid(), is(false));
    assertThat(actual.errorMessage(), is("Wrong config xml"));
    verify(fileSaver).saveXml(content, md5);
    verify(goConfigService).fileSaver(false);
}

73. PolicyProcessExecutor#initMetricReportor()

View license
private void initMetricReportor() {
    String host = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
    int port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
    String username = config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) ? config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) : null;
    String password = config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) ? config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) : null;
    registry = new MetricRegistry();
    listener = new EagleServiceReporterMetricListener(host, port, username, password);
    baseDimensions = new HashMap<>();
    baseDimensions = new HashMap<String, String>();
    baseDimensions.put(Constants.ALERT_EXECUTOR_ID, executorId);
    baseDimensions.put(Constants.PARTITIONSEQ, String.valueOf(partitionSeq));
    baseDimensions.put(Constants.SOURCE, ManagementFactory.getRuntimeMXBean().getName());
    baseDimensions.put(EagleConfigConstants.APPLICATION, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.APPLICATION));
    baseDimensions.put(EagleConfigConstants.SITE, config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.SITE));
    dimensionsMap = new HashMap<String, Map<String, String>>();
}

74. ClientLoanIntegrationTest#copyForUpdate()

View license
private HashMap copyForUpdate(HashMap charge, String amount) {
    HashMap map = new HashMap();
    map.put("id", charge.get("id"));
    if (amount == null) {
        map.put("amount", charge.get("amountOrPercentage"));
    } else {
        map.put("amount", amount);
    }
    if (charge.get("dueDate") != null) {
        map.put("dueDate", charge.get("dueDate"));
    }
    map.put("chargeId", charge.get("chargeId"));
    return map;
}

75. CenterHelper#associateGroups()

View license
public static int[] associateGroups(final int id, final int[] groupMembers, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
    final String ASSOCIATE_GROUP_CENTER_URL = CENTERS_URL + "/" + id + "?command=associateGroups&" + Utils.TENANT_IDENTIFIER;
    HashMap groupMemberHashMap = new HashMap();
    groupMemberHashMap.put("groupMembers", groupMembers);
    System.out.println("---------------------------------ASSOCIATING GROUPS AT " + id + "--------------------------------------------");
    HashMap hash = Utils.performServerPost(requestSpec, responseSpec, ASSOCIATE_GROUP_CENTER_URL, new Gson().toJson(groupMemberHashMap), "changes");
    System.out.println(hash);
    ArrayList<String> arr = (ArrayList<String>) hash.get("groupMembers");
    int[] ret = new int[arr.size()];
    for (int i = 0; i < ret.length; i++) {
        ret[i] = Integer.parseInt(arr.get(i));
    }
    return ret;
}

76. HashMapTest#test_ConstructorI()

Project: j2objc
Source File: HashMapTest.java
View license
/**
     * java.util.HashMap#HashMap(int)
     */
public void test_ConstructorI() {
    // Test for method java.util.HashMap(int)
    HashMap hm2 = new HashMap(5);
    assertEquals("Created incorrect HashMap", 0, hm2.size());
    try {
        new HashMap(-1);
        fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    }
    HashMap empty = new HashMap(0);
    assertNull("Empty hashmap access", empty.get("nothing"));
    empty.put("something", "here");
    assertTrue("cannot get element", empty.get("something") == "here");
}

77. HashMapTest#test_ConstructorIF()

Project: j2objc
Source File: HashMapTest.java
View license
/**
     * java.util.HashMap#HashMap(int, float)
     */
public void test_ConstructorIF() {
    // Test for method java.util.HashMap(int, float)
    HashMap hm2 = new HashMap(5, (float) 0.5);
    assertEquals("Created incorrect HashMap", 0, hm2.size());
    try {
        new HashMap(0, 0);
        fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    }
    HashMap empty = new HashMap(0, 0.75f);
    assertNull("Empty hashtable access", empty.get("nothing"));
    empty.put("something", "here");
    assertTrue("cannot get element", empty.get("something") == "here");
}

78. MapSerializerTest#testMaps()

Project: kryo
Source File: MapSerializerTest.java
View license
public void testMaps() {
    kryo.register(HashMap.class);
    kryo.register(LinkedHashMap.class);
    HashMap map = new HashMap();
    map.put("123", "456");
    map.put("789", "abc");
    roundTrip(18, 21, map);
    roundTrip(2, 5, new LinkedHashMap());
    roundTrip(18, 21, new LinkedHashMap(map));
    MapSerializer serializer = new MapSerializer();
    kryo.register(HashMap.class, serializer);
    kryo.register(LinkedHashMap.class, serializer);
    serializer.setKeyClass(String.class, kryo.getSerializer(String.class));
    serializer.setKeysCanBeNull(false);
    serializer.setValueClass(String.class, kryo.getSerializer(String.class));
    roundTrip(14, 17, map);
    serializer.setValuesCanBeNull(false);
    roundTrip(14, 17, map);
}

79. NQueensAdvancedIncrementalScoreCalculator#resetWorkingSolution()

View license
@Override
public void resetWorkingSolution(NQueens nQueens) {
    int n = nQueens.getN();
    rowIndexMap = new HashMap<>(n);
    ascendingDiagonalIndexMap = new HashMap<>(n * 2);
    descendingDiagonalIndexMap = new HashMap<>(n * 2);
    for (int i = 0; i < n; i++) {
        rowIndexMap.put(i, new ArrayList<>(n));
        ascendingDiagonalIndexMap.put(i, new ArrayList<>(n));
        descendingDiagonalIndexMap.put(i, new ArrayList<>(n));
        if (i != 0) {
            ascendingDiagonalIndexMap.put(n - 1 + i, new ArrayList<>(n));
            descendingDiagonalIndexMap.put((-i), new ArrayList<>(n));
        }
    }
    score = 0;
    for (Queen queen : nQueens.getQueenList()) {
        insert(queen);
    }
}

80. JpaActivityStreamsMediaLinkTest#testEntity()

View license
public static JpaActivityStreamsMediaLink testEntity() {
    HashMap hm = new HashMap();
    hm.put("nineteen", 23);
    hm.put("thirteen", 17);
    JpaActivityStreamsMediaLink test = new JpaActivityStreamsMediaLink();
    test.setUrl("http://apache.org/");
    test.setDuration(2);
    test.setHeight(3);
    test.setUrl("http://five");
    test.setWidth(7);
    return test;
}

81. TransformerAlgorithmMapper#init()

View license
protected static synchronized void init(TransformAlgorithmsType transformAlgorithms, Class<?> callingClass) throws Exception {
    List<TransformAlgorithmType> algorithms = transformAlgorithms.getTransformAlgorithm();
    algorithmsClassMapInOut = new HashMap<String, Class<?>>();
    algorithmsClassMapIn = new HashMap<String, Class<?>>();
    algorithmsClassMapOut = new HashMap<String, Class<?>>();
    for (int i = 0; i < algorithms.size(); i++) {
        TransformAlgorithmType algorithmType = algorithms.get(i);
        if (algorithmType.getINOUT() == null) {
            algorithmsClassMapInOut.put(algorithmType.getURI(), ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
        } else if ("IN".equals(algorithmType.getINOUT().value())) {
            algorithmsClassMapIn.put(algorithmType.getURI(), ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
        } else if ("OUT".equals(algorithmType.getINOUT().value())) {
            algorithmsClassMapOut.put(algorithmType.getURI(), ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
        } else {
            throw new IllegalArgumentException("INOUT parameter " + algorithmType.getINOUT().value() + " unsupported");
        }
    }
}

82. LinkToolTests#testAddIgnoreParameters()

Project: velocity-tools
Source File: LinkToolTests.java
View license
@Test
public void testAddIgnoreParameters() {
    HashMap params = new HashMap();
    params.put("a", "b");
    params.put("b", "c");
    LinkTool link = newLinkTool(params);
    String url = ((LinkTool) (link.relative("/target").append("foo", "bar").append("bar", "baz"))).addRequestParamsExcept("b").toString();
    Assert.assertEquals("/test/target?foo=bar&bar=baz&a=b", url);
}

83. BucketStatisticsTest#setup()

Project: wasabi
Source File: BucketStatisticsTest.java
View license
@Before
public void setup() {
    label = Bucket.Label.valueOf("TestWinner");
    actionCountsMap = new HashMap<Event.Name, ActionCounts>();
    actionRateMap = new HashMap<Event.Name, ActionRate>();
    jointActionCounts = new Counts();
    impressionCounts = new Counts();
    jointActionRate = new Estimate();
    bucketComparisons = new HashMap<Bucket.Label, BucketComparison>();
    bucketStatistics = new BucketStatistics.Builder().withLabel(label).withActionCounts(actionCountsMap).withActionRates(actionRateMap).withJointActionCounts(jointActionCounts).withImpressionCounts(impressionCounts).withJointActionRate(jointActionRate).withBucketComparisons(bucketComparisons).build();
}

84. BaseApplication#onCreate()

Project: WifiChat
Source File: BaseApplication.java
View license
@Override
public void onCreate() {
    super.onCreate();
    if (instance == null) {
        instance = this;
    }
    sendFileStates = new HashMap<String, FileState>();
    recieveFileStates = new HashMap<String, FileState>();
    mAvatarCache = new HashMap<String, SoftReference<Bitmap>>();
    // ????????
    ActivitiesManager.init();
    // ?????
    logger = Logger.initLogger(instance, isPrintLog, logLevel);
    initEmoticons();
    initNotification();
    initFolder();
}

85. Jdk7u21#getObject()

Project: ysoserial
Source File: Jdk7u21.java
View license
public Object getObject(final String command) throws Exception {
    final Object templates = Gadgets.createTemplatesImpl(command);
    String zeroHashCodeStr = "f5a5a608";
    HashMap map = new HashMap();
    map.put(zeroHashCodeStr, "foo");
    InvocationHandler tempHandler = (InvocationHandler) Reflections.getFirstCtor(Gadgets.ANN_INV_HANDLER_CLASS).newInstance(Override.class, map);
    Reflections.setFieldValue(tempHandler, "type", Templates.class);
    Templates proxy = Gadgets.createProxy(tempHandler, Templates.class);
    // maintain order
    LinkedHashSet set = new LinkedHashSet();
    set.add(templates);
    set.add(proxy);
    Reflections.setFieldValue(templates, "_auxClasses", null);
    Reflections.setFieldValue(templates, "_class", null);
    // swap in real object
    map.put(zeroHashCodeStr, templates);
    return set;
}

86. BasicFunctionalityTest#testLocalSolrQueryRequestParams()

View license
@Test
public void testLocalSolrQueryRequestParams() {
    HashMap args = new HashMap();
    args.put("string", "string value");
    args.put("array", new String[] { "array", "value" });
    SolrQueryRequest req = new LocalSolrQueryRequest(null, null, null, 0, 20, args);
    assertEquals("string value", req.getParams().get("string"));
    assertEquals("array", req.getParams().get("array"));
    String[] stringParams = req.getParams().getParams("string");
    assertEquals(1, stringParams.length);
    assertEquals("string value", stringParams[0]);
    String[] arrayParams = req.getParams().getParams("array");
    assertEquals(2, arrayParams.length);
    assertEquals("array", arrayParams[0]);
    assertEquals("value", arrayParams[1]);
    req.close();
}

87. DispatcherFlushFilterTest#setUp()

View license
@Before
public void setUp() throws Exception {
    agent = mock(Agent.class);
    agentConfig = mock(AgentConfig.class);
    when(agent.getId()).thenReturn("mock-agent");
    when(agent.getConfiguration()).thenReturn(agentConfig);
    Map<String, Object> tmp = new HashMap<String, Object>();
    tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] { "CQ-Action:{action}", "CQ-Handle:{path}", "CQ-Path: {path}" });
    hierarchicalProperties = new ValueMapDecorator(tmp);
    tmp = new HashMap<String, Object>();
    tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] { "CQ-Action:{action}", "CQ-Handle:{path}", "CQ-Path: {path}", "CQ-Action-Scope: ResourceOnly" });
    resourceOnlyProperties = new ValueMapDecorator(tmp);
    tmp = new HashMap<String, Object>();
    tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] { "Foo-Action:{action}", "Foo-Handle:{path}", "Foo-Path: {path}" });
    invalidProperties = new ValueMapDecorator(tmp);
}

88. LinearModelTest#makeFeatureVector()

Project: aerosolve
Source File: LinearModelTest.java
View license
public FeatureVector makeFeatureVector() {
    Set list = new HashSet<String>();
    list.add("aaa");
    list.add("bbb");
    // add a feature that is missing in the model
    list.add("ccc");
    HashMap stringFeatures = new HashMap<String, ArrayList<String>>();
    stringFeatures.put("string_feature", list);
    FeatureVector featureVector = new FeatureVector();
    featureVector.setStringFeatures(stringFeatures);
    return featureVector;
}

89. SelfCrossTransformTest#makeFeatureVector()

View license
public FeatureVector makeFeatureVector() {
    HashMap stringFeatures = new HashMap<String, Set<String>>();
    Set list = new HashSet<String>();
    list.add("aaa");
    list.add("bbb");
    stringFeatures.put("feature1", list);
    FeatureVector featureVector = new FeatureVector();
    featureVector.setStringFeatures(stringFeatures);
    return featureVector;
}

90. ZoDPLiskovSubstitutionPrincipleActivity#onClick()

View license
public void onClick(View v) {
    // ?????????????????
    Father f = new Father();
    HashMap map1 = new HashMap();
    Map map11 = new HashMap();
    f.doSomething(map1);
    f.doSomething2(map11);
    // ?????
    Son s = new Son();
    HashMap map2 = new HashMap();
    Map map22 = new HashMap();
    s.doSomething(map2);
    s.doSomething2(map22);
}

91. HTMLAngularEditorSyntaxColoringPreferencePage#init()

View license
public void init(IWorkbench workbench) {
    setDescription(SSEUIMessages.SyntaxColoring_Description);
    fStyleToDescriptionMap = new HashMap();
    fContextToStyleMap = new HashMap();
    initStyleToDescriptionMap();
    initRegionContextToStyleMap();
    IPreferenceStore store = new MyChainedPreferenceStore(new IPreferenceStore[] { getPreferenceStore(), HTMLUIPlugin.getDefault().getPreferenceStore() });
    fOverlayStore = new OverlayPreferenceStore(store, createOverlayStoreKeys());
    fOverlayStore.load();
    fOverlayStore.start();
}

92. Decks#load()

Project: Anki-Android
Source File: Decks.java
View license
public void load(String decks, String dconf) {
    mDecks = new HashMap<>();
    mDconf = new HashMap<>();
    try {
        JSONObject decksarray = new JSONObject(decks);
        JSONArray ids = decksarray.names();
        for (int i = 0; i < ids.length(); i++) {
            String id = ids.getString(i);
            JSONObject o = decksarray.getJSONObject(id);
            long longId = Long.parseLong(id);
            mDecks.put(longId, o);
        }
        JSONObject confarray = new JSONObject(dconf);
        ids = confarray.names();
        for (int i = 0; ids != null && i < ids.length(); i++) {
            String id = ids.getString(i);
            mDconf.put(Long.parseLong(id), confarray.getJSONObject(id));
        }
    } catch (JSONException e) {
        throw new RuntimeException(e);
    }
    mChanged = false;
}

93. StatusManager#computeMaps()

Project: ant-ivy
Source File: StatusManager.java
View license
private void computeMaps() {
    if (_status.isEmpty()) {
        throw new IllegalStateException("badly configured statuses: no status found");
    }
    _statusPriorityMap = new HashMap();
    for (ListIterator iter = _status.listIterator(); iter.hasNext(); ) {
        Status status = (Status) iter.next();
        _statusPriorityMap.put(status.getName(), new Integer(iter.previousIndex()));
    }
    _statusIntegrationMap = new HashMap();
    for (Iterator iter = _status.iterator(); iter.hasNext(); ) {
        Status status = (Status) iter.next();
        _statusIntegrationMap.put(status.getName(), Boolean.valueOf(status.isIntegration()));
    }
}

94. Utils#getNimbusBlobStore()

Project: apache-storm-test
Source File: Utils.java
View license
public static BlobStore getNimbusBlobStore(Map conf, String baseDir, NimbusInfo nimbusInfo) {
    String type = (String) conf.get(Config.NIMBUS_BLOBSTORE);
    if (type == null) {
        type = LocalFsBlobStore.class.getName();
    }
    BlobStore store = (BlobStore) newInstance(type);
    HashMap nconf = new HashMap(conf);
    // only enable cleanup of blobstore on nimbus
    nconf.put(Config.BLOBSTORE_CLEANUP_ENABLE, Boolean.TRUE);
    store.prepare(nconf, baseDir, nimbusInfo);
    return store;
}

95. JMSVendorAdapter#getJMSConnectionFactoryProperties()

Project: axis1-java
Source File: JMSVendorAdapter.java
View license
/**
     *
     * Creates a connection factory property table using values supplied in
     * the endpoint address
     *
     * @param jmsurl  the endpoint address
     * @return the set of properties to be used for instantiating the connection factory
     */
public HashMap getJMSConnectionFactoryProperties(JMSURLHelper jmsurl) {
    HashMap cfProps = new HashMap();
    // hold on to the original address (this will be useful when the JNDI vendor adapter
    // matches connectors)
    cfProps.put(JMSConstants.JMS_URL, jmsurl);
    // JMSConstants.DOMAIN
    String domain = jmsurl.getPropertyValue(JMSConstants._DOMAIN);
    if (domain != null)
        cfProps.put(JMSConstants.DOMAIN, domain);
    // allow vendors to customize the cf properties table
    addVendorConnectionFactoryProperties(jmsurl, cfProps);
    return cfProps;
}

96. MArrayTestsServiceTestCase#testMArrayTest7()

View license
// This test is no longer valid if Axis treats arrays as always single-ref
/*        
        try {
        // Test 4F: Foo arrays are multi-referenced.   
        Foo[][][] in = new Foo[3][3][3];
        Foo[][][] rc;
        fillFoo(in);
        
        // Same Foo array
        Foo[] fooArray = new Foo[3];
        fooArray[0] = new Foo();
        fooArray[0].setValue(-1);
        fooArray[1] = new Foo();
        fooArray[1].setValue(-1);
        fooArray[2] = new Foo();
        fooArray[2].setValue(-1);
        in[0][0] = fooArray;
        in[1][1] = fooArray;
        in[2][2] = fooArray;
        
        rc = binding.testFooArray(in);
        assertTrue("Test 4F Failed (a)", validateFoo(in, rc));
        assertTrue("Test 4F Failed (b)", rc[0][0] == rc[1][1]);
        assertTrue("Test 4F Failed (c)", rc[0][0] == rc[2][2]);
        } catch (java.rmi.RemoteException re) {
        throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
        }
        */
public void testMArrayTest7() throws Exception {
    // Test 3F: Some of the Foo elements are multi-referenced.   
    HashMap map = new HashMap();
    Foo[] array = new Foo[1];
    array[0] = new Foo();
    array[0].setValue(123);
    map.put("hello", array);
    Map rc;
    rc = binding.testMapFooArray(map);
    assertTrue("Test Map Failed (a)", rc != null);
    assertTrue("Test Map Failed (b)", rc.get("hello").getClass().isArray());
    Foo[] rcArray = (Foo[]) rc.get("hello");
    assertTrue("Test Map Failed (c)", rcArray.length == 1 && rcArray[0].getValue() == 123);
}

97. MEPContext#entrySet()

Project: axis2-java
Source File: MEPContext.java
View license
public Set entrySet() {
    // and return only APPLICATION scoped properties if true
    if (isApplicationAccessLocked()) {
        return getApplicationScopedProperties().entrySet();
    }
    HashMap tempProps = new HashMap();
    synchronized (requestMC) {
        tempProps.putAll(requestMC.getProperties());
    }
    if (responseMC != null) {
        tempProps.putAll(responseMC.getProperties());
    }
    return tempProps.entrySet();
}

98. MEPContext#keySet()

Project: axis2-java
Source File: MEPContext.java
View license
public Set keySet() {
    if (isApplicationAccessLocked()) {
        return getApplicationScopedProperties().keySet();
    }
    HashMap tempProps = new HashMap();
    synchronized (requestMC) {
        tempProps.putAll(requestMC.getProperties());
    }
    if (responseMC != null) {
        tempProps.putAll(responseMC.getProperties());
    }
    return tempProps.keySet();
}

99. MEPContext#size()

Project: axis2-java
Source File: MEPContext.java
View license
public int size() {
    if (isApplicationAccessLocked()) {
        return getApplicationScopedProperties().size();
    }
    // The properties must be combined together because some
    // keys may be the same on the request and the response.
    HashMap tempProps = new HashMap();
    synchronized (requestMC) {
        tempProps.putAll(requestMC.getProperties());
    }
    if (responseMC != null) {
        tempProps.putAll(responseMC.getProperties());
    }
    return tempProps.size();
}

100. MEPContext#values()

Project: axis2-java
Source File: MEPContext.java
View license
public Collection values() {
    if (isApplicationAccessLocked()) {
        return getApplicationScopedProperties().values();
    }
    HashMap tempProps = new HashMap();
    synchronized (requestMC) {
        tempProps.putAll(requestMC.getProperties());
    }
    if (responseMC != null) {
        tempProps.putAll(responseMC.getProperties());
    }
    return tempProps.values();
}