auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInDAG() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new Application(), conf); LocalMode.Controller lc = lma.getController(); lc.run(5000); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }

Target:
public void testInDAG() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); Application testApp = new Application(); String outputFileName = "target/output.txt"; long timeout = 2000; new File(outputFileName).delete(); testApp.setOutputFileName(outputFileName); lma.prepareDAG(testApp, conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); File target = new File("target/output.txt"); long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime <= timeout) { try { Thread.sleep(10); } catch (InterruptedException e) { break; } if (target.length() > 100000) { break; } } Assert.assertTrue(target.exists()); try { List<String> lines = FileUtils.readLines(target); double finalMedian = Double.parseDouble(lines.get(lines.size() - 1)); Assert.assertTrue("Median is close to 0.0", -0.05 <= finalMedian && finalMedian <= 0.05); } catch (IOException e) { e.printStackTrace(); } }
Source:
private Type<?> getType(Type<?> baseType, Attribute<?, ?> attribute) { Class<?> baseClass = baseType.getJavaType(); Member member = attribute.getJavaMember(); if (attribute instanceof SingularAttribute) { if (member instanceof Method) { member = ReflectionUtils.getMethod(baseClass, member.getName()); } else if (member instanceof Field) { member = ReflectionUtils.getField(baseClass, member.getName()); } if (member == null && attribute.getJavaMember() != null) { throw new IllegalStateException("Cannot resolve " + attribute.getJavaMember().getName() + " on " + baseClass.getSimpleName()); } } if (baseClass != null) { if (attribute.getJavaMember() instanceof Field) { return metamodel.type(ReflectionUtils.getResolvedFieldType(baseClass, (Field) member)); } else if (attribute.getJavaMember() instanceof Method) { return metamodel.type(ReflectionUtils.getResolvedMethodReturnType(baseClass, (Method) member)); } } if (attribute instanceof PluralAttribute<?, ?, ?>) { return ((PluralAttribute<?, ?, ?>) attribute).getElementType(); } return ((SingularAttribute<?, ?>) attribute).getType(); }

Target:
private Type<?> getType(Type<?> baseType, Attribute<?, ?> attribute) { Class<?> baseClass = baseType.getJavaType(); if (baseClass != null) { Class<?> clazz = JpaMetamodelUtils.resolveFieldClass(baseType.getJavaType(), attribute); if (clazz != null) { return metamodel.type(clazz); } } if (attribute instanceof PluralAttribute<?, ?, ?>) { return ((PluralAttribute<?, ?, ?>) attribute).getElementType(); } return ((SingularAttribute<?, ?>) attribute).getType(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JaasAuthenticationConfig other = (JaasAuthenticationConfig) obj; if (loginModuleConfigs == null) { if (other.loginModuleConfigs != null) { return false; } } else if (!loginModuleConfigs.equals(other.loginModuleConfigs)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JaasAuthenticationConfig other = (JaasAuthenticationConfig) obj; return Objects.equals(loginModuleConfigs, other.loginModuleConfigs); }
Source:
public void testGetAllStoreAllMatchCacheAccessExceptionAfterLoaderSomeMatchDisjointFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_A, KEY_SET_B), Collections.singleton("keyA3")); this.store = spy(fakeStore); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(getEntryMap(KEY_SET_B, KEY_SET_C), KEY_SET_B, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); final Set<String> fetchKeys = fanIn(KEY_SET_A, KEY_SET_B); try { ehcache.getAll(fetchKeys); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_B)); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(fetchKeys), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(fetchKeys)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(fetchKeys), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); assertThat(this.bulkExceptionCaptor.getValue().getSuccesses(), Matchers.<Map<?,?>>equalTo(getNullEntryMap(KEY_SET_B))); assertThat(this.bulkExceptionCaptor.getValue().getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }

Target:
public void testGetAllStoreAllMatchCacheAccessExceptionAfterLoaderSomeMatchDisjointFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_A, KEY_SET_B), Collections.singleton("keyA3")); this.store = spy(fakeStore); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(TEST_ENTRIES, KEY_SET_A, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); final Set<String> fetchKeys = fanIn(KEY_SET_A, KEY_SET_B); try { ehcache.getAll(fetchKeys); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_B)); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(fetchKeys), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(fetchKeys)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(fetchKeys), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); verifyBulkLoadingException(this.bulkExceptionCaptor.getValue(), KEY_SET_B, KEY_SET_A); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }
Source:
public Insert(Table<T> table, Query subQuery, List<String> columns, DuplicateKeyContext<T> duplicateKeyContext) { this.table = table; this.columns = columns; this.subQuery = subQuery; this.duplicateKeyContext = duplicateKeyContext; }

Target:
public Insert(Table<T> table, Query subQuery, List<String> columns, DuplicateKeyContext<T> duplicateKeyContext) { this.table = table; this.columns = columns; this.insertSource = subQuery; this.duplicateKeyContext = duplicateKeyContext; }
Source:
public void HiViATFShouldRequestForMEGAAdUnitVAST() throws UnsupportedEncodingException { final String adUnit = "/5441/wka1a.VIDEO/uap_bfab/desktop/oasis-article/_project43-life"; networkTrafficInterceptor.startIntercepting(); AdsBaseObject ads = new AdsBaseObject(driver, AdsDataProvider.UAP_HIVI_PAGE.getUrl()); ads.triggerAdSlot(AdsContent.BOTTOM_LB); ads.waitForVASTRequestWithAdUnit(networkTrafficInterceptor, adUnit); }

Target:
public void HiViATFShouldRequestForMEGAAdUnitVAST() throws UnsupportedEncodingException { final String adUnit = "/5441/wka1a.VIDEO/uap_bfaa/desktop/oasis-article/_project43-life"; checkRequestForAdUnit(AdsDataProvider.UAP_HIVI_PAGE, adUnit); }
Source:
public DesiredCapabilities getCapability(String testName) { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities = initCapabilities(capabilities); if (R.CONFIG.getBoolean(SpecialKeywords.FULL_RESET_BEFORE_SUITE) && !R.CONFIG.get(SpecialKeywords.FULL_RESET_BEFORE_SUITE).isEmpty()) { LOGGER.info("Will be execute 'fullResetBeforeSuite'!"); executeFullResetBeforeSuite(capabilities); } return capabilities; }

Target:
public DesiredCapabilities getCapability(String testName) { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities = initCapabilities(capabilities); return capabilities; }
Source:
public void setEventBus(EventBus eventBus) { this.eventBus = eventBus; if (eventBus == null) { unregisterHandlers(); } }

Target:
public final void setEventBus(EventBus eventBus) { this.eventBus = eventBus; if (eventBus == null) { unregisterHandlers(); } else { registerHandlers(); } }
Source:
public MongoDbContainer() { this("mongo:4.1"); }

Target:
public MongoDbContainer() { this(DEFAULT_IMAGE_AND_TAG); }
Source:
private static Object[] computeParameters(Map<Class<?>, IClass> classes, Class<?> ec, IObjectFactory factory) throws NoSuchMethodException, IllegalAccessException, InstantiationException { IClass enclosingIClass = classes.get(ec); Object[] enclosingInstances; if (null != enclosingIClass) { enclosingInstances = enclosingIClass.getInstances(false); if ((null == enclosingInstances) || (enclosingInstances.length == 0)) { Object o = factory.newInstance(ec.getConstructor(ec)); enclosingIClass.addInstance(o); enclosingInstances = new Object[]{o}; } } else { enclosingInstances = new Object[]{ec.newInstance()}; } Object enclosingClassInstance = enclosingInstances[0]; return new Object[]{enclosingClassInstance}; }

Target:
private static Object computeParameters(Map<Class<?>, IClass> classes, Class<?> ec, IObjectFactory factory) throws NoSuchMethodException, IllegalAccessException, InstantiationException { IClass enclosingIClass = classes.get(ec); if (enclosingIClass == null) { return ec.newInstance(); } Object[] enclosingInstances = enclosingIClass.getInstances(false); if (enclosingInstances == null || enclosingInstances.length == 0) { return factory.newInstance(ec.getConstructor(ec)); } return enclosingInstances[0]; }
Source:
public void listModifyingBatch() { Date startDate = createDate(2010, 1, 1); Date endDate = createDate(2020, 1, 1); Entitlement ent = setUpModifyingEntitlements(startDate, endDate, 4, "1"); Date startDate1 = createDate(2030, 1, 1); Date endDate1 = createDate(2040, 1, 1); Entitlement ent1 = setUpModifyingEntitlements(startDate1, endDate1, 2, "2"); Set<Entitlement> ents = entitlementCurator.listModifying(Arrays.asList(ent, ent1)); assertEquals(6, ents.size()); assertTrue(!ents.contains(ent)); assertTrue(!ents.contains(ent1)); }

Target:
public void listModifyingBatch() { Date startDate = createDate(2010, 1, 1); Date endDate = createDate(2020, 1, 1); Entitlement ent = setUpModifyingEntitlements(startDate, endDate, 4, "1"); Date startDate1 = createDate(2030, 1, 1); Date endDate1 = createDate(2040, 1, 1); Entitlement ent1 = setUpModifyingEntitlements(startDate1, endDate1, 2, "2"); Set<Entitlement> ents = entitlementCurator.listModifying(Arrays.asList(ent, ent1)); assertEquals(6, ents.size()); assertThat(ents, not(hasItem(ent))); assertThat(ents, not(hasItem(ent1))); }
Source:
private void register(Kryo kryo, Registration registration) { int id = registration.getId(); Registration existing = kryo.getRegistration(id); if (existing != null) { throw new SerializationFailedException((String.format("registration already exists %s", existing))); } if (log.isInfoEnabled()) { log.info(String.format("registering %s with serializer %s", registration, registration.getSerializer().getClass() .getName())); } kryo.register(registration); }

Target:
private void register(Kryo kryo, Registration registration) { int id = registration.getId(); Registration existing = kryo.getRegistration(id); if (existing != null) { throw new RuntimeException((String.format("registration already exists %s", existing))); } if (log.isInfoEnabled()) { log.info(String.format("registering %s with serializer %s", registration, registration.getSerializer().getClass() .getName())); } kryo.register(registration); }
Source:
public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { try { Boolean returnFields = false; String[] fieldList = null; if (fields != null) { returnFields = true; fieldList = fields.toArray(new String[fields.size()]); } SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.setParam("fq", "id:[ " + startkey + " TO * ]"); if (returnFields) { query.setFields(fieldList); } query.setRows(recordcount); final QueryResponse response = client.query(table, query); HashMap<String, ByteIterator> entry; for (SolrDocument hit : response.getResults()) { entry = new HashMap<String, ByteIterator>((int) response.getResults().getNumFound()); for (String field : hit.getFieldNames()) { entry.put(field, new StringByteIterator(String.valueOf(hit.getFirstValue(field)))); } result.add(entry); } return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace(); } return Status.ERROR; }

Target:
public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { try { Boolean returnFields = false; String[] fieldList = null; if (fields != null) { returnFields = true; fieldList = fields.toArray(new String[fields.size()]); } SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.setParam("fq", "id:[ " + startkey + " TO * ]"); if (returnFields) { query.setFields(fieldList); } query.setRows(recordcount); final QueryResponse response = client.query(table, query); SolrDocumentList results = response.getResults(); HashMap<String, ByteIterator> entry; for (SolrDocument hit : results) { entry = new HashMap<String, ByteIterator>((int) results.getNumFound()); for (String field : hit.getFieldNames()) { entry.put(field, new StringByteIterator(String.valueOf(hit.getFirstValue(field)))); } result.add(entry); } return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace(); } return Status.ERROR; }
Source:
private boolean isDirSnapshotable(DistributedFileSystem hdfs, Path path) throws FalconException { try { LOG.debug("HDFS Snapshot extension validating if dir is snapshotable.", path.toString()); SnapshottableDirectoryStatus[] snapshotableDirs = hdfs.getSnapshottableDirListing(); if (snapshotableDirs != null && snapshotableDirs.length > 0) { for (SnapshottableDirectoryStatus dir : snapshotableDirs) { if (dir.getFullPath().toString().equals(path.toString())) { return true; } } } return false; } catch (IOException e) { LOG.error("Unable to verify if dir is snapshot-able. {}", path.toString(), e.getMessage()); throw new FalconException("Unable to verify if dir " + path.toString() + " is snapshot-able", e); } }

Target:
private static boolean isDirSnapshotable(DistributedFileSystem hdfs, Path path) throws FalconException { try { LOG.debug("HDFS Snapshot extension validating if dir is snapshotable.", path.toString()); SnapshottableDirectoryStatus[] snapshotableDirs = hdfs.getSnapshottableDirListing(); if (snapshotableDirs != null && snapshotableDirs.length > 0) { for (SnapshottableDirectoryStatus dir : snapshotableDirs) { if (dir.getFullPath().toString().equals(path.toString())) { return true; } } } return false; } catch (IOException e) { LOG.error("Unable to verify if dir is snapshot-able. {}", path.toString(), e.getMessage()); throw new FalconException("Unable to verify if dir " + path.toString() + " is snapshot-able", e); } }
Source:
public RawPacket reverseTransform(RawPacket pkt){ long interArrivalTime = getInterArrivalDelayVariation (pkt.getSSRC(), pkt.getTimestamp(), System.currentTimeMillis(), pkt.getLength()); return pkt; }

Target:
public RawPacket reverseTransform(RawPacket pkt){ getBitrateEstimate (pkt.getSSRC(), pkt.getTimestamp(), System.currentTimeMillis(), pkt.getLength()); return pkt; }
Source:
public void initialize() { config = getConfigAs(${bindingIdCamelCase}Configuration.class); scheduler.execute(() -> { boolean initialized = true; if (initialized) { } else { } }); updateStatus(ThingStatus.OFFLINE); }

Target:
public void initialize() { config = getConfigAs(${bindingIdCamelCase}Configuration.class); scheduler.execute(() -> { boolean thingReachable = true; if (thingReachable) { } else { } }); updateStatus(ThingStatus.UNKNOWN); }
Source:
public void setSyntax (String syntax) { boolean isHighlightEnabled = getTxtOutput().getDocument().getLength() < HIGHLIGHT_SCRIPT_MAX_SIZE_THRESHOLD && !isLargeScriptContent; getTxtOutput().setSyntaxEditingStyle(isHighlightEnabled ? syntax : SyntaxConstants.SYNTAX_STYLE_NONE); }

Target:
public void setSyntax (String syntax) { boolean highlightEnabled = getTxtOutput().getDocument().getLength() < HIGHLIGHT_SCRIPT_MAX_SIZE_THRESHOLD && !largeScriptContentSet; getTxtOutput().setSyntaxEditingStyle(highlightEnabled ? syntax : SyntaxConstants.SYNTAX_STYLE_NONE); }
Source:
public void testEnableSummarization() { SummarizerConfiguration summarizerConfig1 = SummarizerConfiguration.builder("test").build(); NewTableConfiguration ntcSummarization1 = new NewTableConfiguration().enableSummarization(summarizerConfig1); ArrayList<String> summarizerValues = new ArrayList<String>(); for (Map.Entry<String,String> e : ntcSummarization1.getProperties().entrySet()) { if (e.getKey().contains("table.summarizer")) { summarizerValues.add(e.getValue()); } } assertTrue(summarizerValues.get(0) instanceof String); Class<? extends Summarizer> builderClass = FamilySummarizer.class; assertTrue(Summarizer.class.isAssignableFrom(builderClass)); summarizerValues.clear(); SummarizerConfiguration summarizerConfig2 = SummarizerConfiguration.builder(builderClass).build(); NewTableConfiguration ntcSummarization2 = new NewTableConfiguration().enableSummarization(summarizerConfig2); for (Map.Entry<String,String> e : ntcSummarization2.getProperties().entrySet()) { if (e.getKey().contains("table.summarizer")) { summarizerValues.add(e.getValue()); } } assertTrue(summarizerValues.get(0).equals(builderClass.getName())); NewTableConfiguration ntcSummarization3 = new NewTableConfiguration().enableSummarization(summarizerConfig1, summarizerConfig2); summarizerValues.clear(); for (Map.Entry<String,String> e : ntcSummarization3.getProperties().entrySet()) { if (e.getKey().contains("table.summarizer")) { summarizerValues.add(e.getValue()); } } assertEquals(summarizerValues.size(), 2); }

Target:
public void testEnableSummarization() { SummarizerConfiguration summarizerConfig1 = SummarizerConfiguration .builder("com.test.summarizer").setPropertyId("s1").addOption("opt1", "v1").build(); NewTableConfiguration ntcSummarization1 = new NewTableConfiguration().enableSummarization(summarizerConfig1); assertEquals("v1", ntcSummarization1.getProperties().get("table.summarizer.s1.opt.opt1")); assertEquals("com.test.summarizer", ntcSummarization1.getProperties().get("table.summarizer.s1")); Class<? extends Summarizer> builderClass = FamilySummarizer.class; assertTrue(Summarizer.class.isAssignableFrom(builderClass)); SummarizerConfiguration summarizerConfig2 = SummarizerConfiguration.builder(builderClass) .setPropertyId("s2").addOption("opt2", "v2").build(); NewTableConfiguration ntcSummarization2 = new NewTableConfiguration().enableSummarization(summarizerConfig2); assertEquals("v2", ntcSummarization2.getProperties().get("table.summarizer.s2.opt.opt2")); assertEquals(builderClass.getName(), ntcSummarization2.getProperties().get("table.summarizer.s2")); NewTableConfiguration ntcSummarization3 = new NewTableConfiguration().enableSummarization(summarizerConfig1, summarizerConfig2); assertEquals("v1", ntcSummarization1.getProperties().get("table.summarizer.s1.opt.opt1")); assertEquals("v2", ntcSummarization2.getProperties().get("table.summarizer.s2.opt.opt2")); assertEquals("com.test.summarizer", ntcSummarization3.getProperties().get("table.summarizer.s1")); assertEquals(builderClass.getName(), ntcSummarization3.getProperties().get("table.summarizer.s2")); }
Source:
protected Object transformValue(Object value, Field valueField) { if (null == value) { return null; } Schema nonnull = AvroUtils.unwrapIfNullable(valueField.schema()); LogicalType logicalType = nonnull.getLogicalType(); if (logicalType != null) { if (logicalType == LogicalTypes.date() || logicalType == LogicalTypes.timeMillis() || logicalType == LogicalTypes.timestampMillis()) { return new Date(value instanceof Integer ? (Integer) value : (Long) value); } } String talendType = valueField.getProp(TALEND6_COLUMN_TALEND_TYPE); String javaClass = nonnull.getProp(SchemaConstants.JAVA_CLASS_FLAG); if ("id_Short".equals(talendType)) { return value instanceof Number ? ((Number) value).shortValue() : Short.parseShort(String.valueOf(value)); } else if ("id_Date".equals(talendType) || "java.util.Date".equals(javaClass)) { return value instanceof Date ? value : new Date((Long) value); } else if ("id_Byte".equals(talendType)) { return value instanceof Number ? ((Number) value).byteValue() : Byte.parseByte(String.valueOf(value)); } else if ("id_Character".equals(talendType) || "java.lang.Character".equals(javaClass)) { return value instanceof Character ? value : ((String) value).charAt(0); } else if ("id_BigDecimal".equals(talendType) || "java.math.BigDecimal".equals(javaClass)) { return value instanceof BigDecimal ? value : new BigDecimal(String.valueOf(value)); } return value; }

Target:
protected Object transformValue(Object value, Field valueField) { if (null == value) { return null; } Schema nonnull = AvroUtils.unwrapIfNullable(valueField.schema()); LogicalType logicalType = nonnull.getLogicalType(); if (logicalType != null) { if (logicalType == LogicalTypes.date()) { return dateConversion.fromInt((Integer) value, nonnull, logicalType).toDate(); } else if (logicalType == LogicalTypes.timeMillis()) { return value; } else if (logicalType == LogicalTypes.timestampMillis()) { return timestampConversion.fromLong((Long) value, nonnull, logicalType).toDate(); } } String talendType = valueField.getProp(TALEND6_COLUMN_TALEND_TYPE); String javaClass = nonnull.getProp(SchemaConstants.JAVA_CLASS_FLAG); if ("id_Short".equals(talendType)) { return value instanceof Number ? ((Number) value).shortValue() : Short.parseShort(String.valueOf(value)); } else if ("id_Date".equals(talendType) || "java.util.Date".equals(javaClass)) { return value instanceof Date ? value : new Date((Long) value); } else if ("id_Byte".equals(talendType)) { return value instanceof Number ? ((Number) value).byteValue() : Byte.parseByte(String.valueOf(value)); } else if ("id_Character".equals(talendType) || "java.lang.Character".equals(javaClass)) { return value instanceof Character ? value : ((String) value).charAt(0); } else if ("id_BigDecimal".equals(talendType) || "java.math.BigDecimal".equals(javaClass)) { return value instanceof BigDecimal ? value : new BigDecimal(String.valueOf(value)); } return value; }
Source:
public void testFailRemoveOperation() { try { domainManager.failRemoveOperation(domain, domainAccountsForCleanup, domainNetworkIds, true); } catch (Exception e) { Assert.assertEquals(CloudRuntimeException.class, e.getClass()); } }

Target:
public void testFailRemoveOperation() { domainManager.failRemoveOperation(domain, domainAccountsForCleanup, domainNetworkIds, true); }
Source:
public void execute(Context context) throws SQLException { Multimap<Long, PropertyRow> rows = context .prepareSelect("select" + " props.id, props.prop_key, props.resource_id, prj.uuid, props.text_value, props.created_at" + " from properties props" + " left join projects prj on prj.id = props.resource_id and prj.scope = ? and prj.qualifier = ?" + " where" + " props.prop_key like 'sonar.webhooks%'" + " and props.text_value is not null") .setString(1, "PRJ") .setString(2, "TRK") .list(row -> new PropertyRow( row.getLong(1), row.getString(2), row.getNullableLong(3), row.getNullableString(4), row.getString(5), row.getLong(6))) .stream() .collect(MoreCollectors.index(PropertyRow::getResourceId, Function.identity())); for (Map.Entry<Long, Collection<PropertyRow>> entry : rows.asMap().entrySet()) { long projectId = entry.getKey(); if (projectId == NO_RESOURCE_ID) { migrateGlobalWebhooks(context, entry.getValue()); } else { migrateProjectsWebhooks(context, entry.getValue()); } deleteAllWebhookProperties(context); } }

Target:
public void execute(Context context) throws SQLException { Multimap<Long, PropertyRow> rows = context .prepareSelect("select" + " props.id, props.prop_key, props.resource_id, prj.uuid, props.text_value, props.created_at" + " from properties props" + " left join projects prj on prj.id = props.resource_id and prj.scope = ? and prj.qualifier = ? and prj.enabled = ?" + " where" + " props.prop_key like 'sonar.webhooks%'" + " and props.text_value is not null") .setString(1, "PRJ") .setString(2, "TRK") .setBoolean(3, true) .list(row -> new PropertyRow( row.getLong(1), row.getString(2), row.getNullableLong(3), row.getNullableString(4), row.getString(5), row.getLong(6))) .stream() .collect(MoreCollectors.index(PropertyRow::getResourceId, Function.identity())); for (Map.Entry<Long, Collection<PropertyRow>> entry : rows.asMap().entrySet()) { long projectId = entry.getKey(); if (projectId == NO_RESOURCE_ID) { migrateGlobalWebhooks(context, entry.getValue()); } else { migrateProjectsWebhooks(context, entry.getValue()); } deleteAllWebhookProperties(context); } }
Source:
public void setup() { ELEMENTS = getRandomValues(CONTAINER_SIZE, 0); EXPECTED_AGGREGATE = Iterator.of(ELEMENTS).reduce(JmhRunner::aggregate); scalazPersistent = create(v -> { scalaz.Heap<Integer> result = scalaz.Heap.Empty$.MODULE$.apply(); for (Integer element : v) { result = result.insert(element, SCALAZ_ORDER); } return result; }, Arrays.asList(ELEMENTS), v -> v.size() == CONTAINER_SIZE); slangPersistent = create(javaslang.collection.PriorityQueue::of, ELEMENTS, ELEMENTS.length, v -> v.size() == CONTAINER_SIZE); }

Target:
public void setup() { ELEMENTS = getRandomValues(CONTAINER_SIZE, 0); EXPECTED_AGGREGATE = Iterator.of(ELEMENTS).reduce(JmhRunner::aggregate); scalazPersistent = create(v -> scalaz.Heap.Empty$.MODULE$.<Integer> apply().insertAll(asScalaBuffer(v), SCALAZ_ORDER), asList(ELEMENTS), v -> v.size() == CONTAINER_SIZE); slangPersistent = create(javaslang.collection.PriorityQueue::of, ELEMENTS, ELEMENTS.length, v -> v.size() == CONTAINER_SIZE); }
Source:
public void populateCache(UUID uuid) { CompletableFuture.runAsync(() -> { List<String> playerAchievementNamesList = databaseManager.getPlayerAchievementNamesList(uuid); receivedAchievementsCache.put(uuid, new HashSet<>(playerAchievementNamesList)); }); }

Target:
public void populateCache(UUID uuid) { if (receivedAchievementsCache.containsKey(uuid)) return; CompletableFuture.runAsync(() -> { List<String> playerAchievementNamesList = databaseManager.getPlayerAchievementNamesList(uuid); receivedAchievementsCache.put(uuid, new HashSet<>(playerAchievementNamesList)); }); }
Source:
@AfterClass public static void kiwwTheWabbit() { rabbit.start(); }

Target:
@AfterClass public static void kiwwTheWabbit() { rabbit.stop(); }
Source:
protected static void checkIndexBounds(int[] indexList, int bound) { for (int i = 0; i < indexList.length; i++) { if (indexList[i] >= bound || indexList[i] < 0) { throw new IllegalArgumentException("Index value out of bounds"); } } }

Target:
protected void checkIndexBounds(int[] indexList, int bound) { for (int i = 0; i < indexList.length; i++) { if (indexList[i] >= bound || indexList[i] < 0) { fail("Index value out of bounds"); } } }
Source:
public InputStream decrypt(String studyId, InputStream source) { if (StringUtils.isBlank(studyId)) { throw new BadRequestException(String.format(Validate.CANNOT_BE_BLANK, "studyId")); } if (source == null) { throw new BadRequestException(String.format(Validate.CANNOT_BE_NULL, "source")); } CmsEncryptor encryptor = getEncryptorForStudy(studyId); try { return encryptor.decrypt(source); } catch (CertificateEncodingException | CMSException | IOException ex) { throw new BridgeServiceException(ex); } }

Target:
public InputStream decrypt(String studyId, InputStream source) { checkNotNull(studyId); checkArgument(StringUtils.isNotBlank(studyId)); checkNotNull(source); CmsEncryptor encryptor = getEncryptorForStudy(studyId); try { return encryptor.decrypt(source); } catch (CertificateEncodingException | CMSException | IOException ex) { throw new BridgeServiceException(ex); } }
Source:
public int hashCode() { return _apiVersion != null ? _apiVersion.hashCode() : 0; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (_apiVersion != null ? _apiVersion.hashCode() : 0); return result; }
Source:
public Map<String, Object> toMap() { Map<String, Object> rootMap = super.toMap(); Map<String, Object> innerMap = (Map<String, Object>) rootMap.get(GEO_DISTANCE_FIELD); Map<String, Double> location = new HashMap<String, Double>(2); location.put( "lat", center.getLatitude() ); location.put( "lon", center.getLongitude() ); innerMap.put( fieldName, location ); innerMap.put( "unit", "km" ); return rootMap; }

Target:
public Map<String, Object> toMap() { Map<String, Object> rootMap = super.toMap(); Map<String, Object> innerMap = (Map<String, Object>) rootMap.get(GEO_DISTANCE_FIELD); Map<String, Double> location = new HashMap<String, Double>(3); location.put( "lat", center.getLatitude() ); location.put( "lon", center.getLongitude() ); innerMap.put( fieldName, location ); innerMap.put( "unit", "km" ); innerMap.put( "distance_type", "arc" ); return rootMap; }
Source:
public void testSetup() { initMocks(this); accountAdmin = new AccountAdminImpl(); accountAdmin.setLogger(logger); accountAdmin.setAccountStorage(storage); accountAdmin.setAuthenticationAdmin(authenticationAdmin); accountAdmin.start(Collections.<String, Object> emptyMap()); when(newAccount.getGuid()).thenReturn(ID); when(preferences.getId()).thenReturn(ID); when(preferences.getId()).thenReturn(ID); }

Target:
public void testSetup() { initMocks(this); accountAdmin = new AccountAdminImpl(); accountAdmin.setLogger(logger); accountAdmin.setAccountStorage(storage); accountAdmin.setAuthenticationAdmin(authenticationAdmin); accountAdmin.start(Collections.<String, Object> emptyMap()); when(newAccount.getGuid()).thenReturn(ID); when(preferences.getId()).thenReturn(ID); }
Source:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Unable to transform null metacard"); } Map<String, String> aliases = (Map<String, String>) arguments.getOrDefault("aliases", new HashMap<>()); String attributeString = (String) arguments.get("columnOrder"); ArrayList<String> attributes = new ArrayList<String>(Arrays.asList((attributeString).split(","))); ArrayList<AttributeDescriptor> allAttributes = new ArrayList<AttributeDescriptor>(metacard.getMetacardType().getAttributeDescriptors()); ArrayList<AttributeDescriptor> descriptors = new ArrayList<AttributeDescriptor>( attributes == null || attributes.isEmpty() ? allAttributes : allAttributes .stream() .filter(attr -> attributes.contains(attr.getName())) .collect(Collectors.toList())); Appendable appendable = writeMetacardsToCsv(Collections.singletonList(metacard), descriptors, aliases); return createResponse(appendable); }

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Unable to transform null metacard"); } Map<String, String> aliases = (Map<String, String>) arguments.getOrDefault("aliases", new HashMap<>()); String attributeString = arguments.get(CsvQueryResponseTransformer.COLUMN_ORDER_KEY) != null ? (String) arguments.get(CsvQueryResponseTransformer.COLUMN_ORDER_KEY) : ""; List<String> attributes = Arrays.asList((attributeString).split(",")); List<AttributeDescriptor> allAttributes = new ArrayList<AttributeDescriptor>(metacard.getMetacardType().getAttributeDescriptors()); List<AttributeDescriptor> descriptors = CollectionUtils.isEmpty(attributes) ? allAttributes : allAttributes.stream() .filter(attr -> attributes.contains(attr.getName())) .collect(Collectors.toList()); Appendable appendable = writeMetacardsToCsv(Collections.singletonList(metacard), descriptors, aliases); return createResponse(appendable); }
Source:
public static File getFile(Object source, String filename) throws IOException { Class<?> clazz = (source instanceof Class<?>) ? (Class<?>) source : source.getClass(); if (Platform.isRunning()) { ClassLoader classLoader = clazz.getClassLoader(); if (isOsgiVersion310orNewer(classLoader)) { return getFileFromClassLoader4Luna(filename, classLoader); } else if (isOsgiVersion39orOlder(classLoader)) { return getFileFromClassLoaderBeforeLuna(filename, classLoader); } } else { return getFileFromNotRunningPlatform(filename, clazz); } throw new AssertionFailedError("Could not locate " + filename); }

Target:
public static File getFile(Object source, String filename) throws IOException { Class<?> clazz = (source instanceof Class<?>) ? (Class<?>) source : source.getClass(); if (Platform.isRunning()) { ClassLoader classLoader = clazz.getClassLoader(); try { if (isOsgiVersion310orNewer(classLoader)) { return checkNotNull(getFileFromClassLoader4Luna(filename, classLoader)); } else { return checkNotNull(getFileFromClassLoaderBeforeLuna(filename, classLoader)); } } catch (Exception e) { AssertionFailedError exception = new AssertionFailedError(NLS.bind( "Could not locate {0} using classloader for {1}", filename, clazz)); exception.initCause(e); throw exception; } } else { return getFileFromNotRunningPlatform(filename, clazz); } }
Source:
public HashMap<String, ObjectId> getUpdated() { return updated; }

Target:
public Map<String, ObjectId> getUpdated() { return updated; }
Source:
protected void init(final VfsNicLabelModel model) { super.init(model); selectedLabelsChanged(VfsNicLabelWidget.this); for (ListModel<String> labelModel : model.getItems()) { labelModel.getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { selectedLabelsChanged(VfsNicLabelWidget.this); } }); } }

Target:
protected void init(final VfsNicLabelModel model) { super.init(model); selectedLabelsChanged(VfsNicLabelWidget.this); for (ListModel<String> labelModel : model.getItems()) { labelModel.getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { selectedLabelsChanged(this); } }); } }
Source:
private void onLoadAdvancements(Map<ResourceLocation, Advancement.Builder> advancementsIn, CallbackInfo ci) { if (!SpongeImplHooks.isMainThread() || !ShouldFire.GAME_REGISTRY_EVENT_REGISTER) { return; } final SpongeGameRegistryRegisterEvent<org.spongepowered.api.advancement.Advancement> event = new SpongeGameRegistryRegisterEvent<>(Cause.of(EventContext.empty(), SpongeImpl.getRegistry()), org.spongepowered.api.advancement.Advancement.class, AdvancementRegistryModule.getInstance()); try (ListenerPhaseContext context = PluginPhase.Listener.GENERAL_LISTENER.createPhaseContext() .event(event) .source(Sponge.getGame())) { context.buildAndSwitch(); SpongeImpl.postEvent(event); } }

Target:
private void onLoadAdvancements(Map<ResourceLocation, Advancement.Builder> advancementsIn, CallbackInfo ci) { if (!SpongeImplHooks.isMainThread() || !ShouldFire.GAME_REGISTRY_EVENT_REGISTER) { return; } try (ListenerPhaseContext context = PluginPhase.Listener.GENERAL_LISTENER.createPhaseContext() .source(Sponge.getGame())) { context.buildAndSwitch(); SpongeImpl.getCauseStackManager().pushCause(SpongeImpl.getRegistry()); final SpongeGameRegistryRegisterEvent<org.spongepowered.api.advancement.Advancement> event = new SpongeGameRegistryRegisterEvent<>(SpongeImpl.getCauseStackManager().getCurrentCause(), org.spongepowered.api.advancement.Advancement.class, AdvancementRegistryModule.getInstance()); context.event(event); SpongeImpl.postEvent(event); } }
Source:
public Trader(String traderName, double cashInHand) { super(); this.name = name; this.cashInHand = cashInHand; this.position = new ArrayList<Order>(); this.ordersPlaced = new ArrayList<Order>(); }

Target:
public Trader(String traderName, double cashInHand) { this.name = name; this.cashInHand = cashInHand; this.position = new ArrayList<Order>(); this.ordersPlaced = new ArrayList<Order>(); }
Source:
private DefaultHttpClient createHttpClientWithProxy() { try { String webProxyEnabled = System.getProperty("web.proxy.enabled"); String proxyHost = System.getProperty("http.proxyHost"); String proxyPortStr = System.getProperty("http.proxyPort"); if (StringUtils.isEmpty(webProxyEnabled) || StringUtils.isEmpty(proxyHost) || StringUtils.isEmpty(proxyHost)) { return new DefaultHttpClient(); } String proxyMode = System.getProperty("http.proxyScheme"); if (StringUtils.isEmpty(proxyMode)) { proxyMode = HttpHost.DEFAULT_SCHEME_NAME; } int proxyPort = Integer.parseInt(proxyPortStr); HttpHost proxy = new HttpHost(proxyHost, proxyPort, proxyMode); final HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, DEFAULT_TIMEOUT); HttpConnectionParams.setSoTimeout(httpParams, DEFAULT_TIMEOUT); DefaultHttpClient baseHttpClient = new DefaultHttpClient(httpParams); baseHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); return baseHttpClient; } catch (Exception e) { String message = "Can't wrap client, exception: " + e.getMessage(); throw new RuntimeException(message); } }

Target:
private DefaultHttpClient createHttpClientWithProxy() { DefaultHttpClient client = new DefaultHttpClient(); ProxySelector proxySelector = ProxySelector.getDefault(); client.setRoutePlanner(new ProxySelectorRoutePlanner(client.getConnectionManager().getSchemeRegistry(), proxySelector)); return client; }
Source:
public int getPort() { return HTTPS.equals(protocol) && port == 80 ? 443 : port; }

Target:
public int getPort() { return (port != null) ? port : HTTPS.equals(protocol) ? 443 : 80; }
Source:
protected Object getPreAuthenticatedPrincipal(HttpServletRequest request) { final String authHeader = request.getHeader(HttpHeaders.AUTHORIZATION); if (StringUtils.isBlank(authHeader) || !authHeader.startsWith(Headers.BEARER_TOKEN_PREFIX)) { return null; } final String bearerToken = authHeader.substring(Headers.BEARER_TOKEN_PREFIX.length()); try { final Jws<Claims> claims = Jwts.parser().setSigningKey(signatureKey).parseClaimsJws(bearerToken); logger.debug("Found the following pre-authenticated user: {}", claims.toString()); final UserDetails rslt = new SoffitApiUserDetails(claims.getBody().getSubject()); request.setAttribute(USER_DETAILS_REQUEST_ATTRIBUTE, rslt); return rslt; } catch (Exception e) { logger.error( "Unable to identify pre-authenticated user with Bearer token '{}'", bearerToken, e); } return null; }

Target:
protected Object getPreAuthenticatedPrincipal(HttpServletRequest request) { final String authHeader = request.getHeader(HttpHeaders.AUTHORIZATION); if (StringUtils.isBlank(authHeader) || !authHeader.startsWith(Headers.BEARER_TOKEN_PREFIX)) { return null; } final String bearerToken = authHeader.substring(Headers.BEARER_TOKEN_PREFIX.length()); try { final Jws<Claims> claims = Jwts.parser().setSigningKey(signatureKey).parseClaimsJws(bearerToken); logger.debug("Found the following pre-authenticated user: {}", claims.toString()); final List<String> groupsClaim = claims.getBody().get("groups", List.class); final List<String> groupsList = groupsClaim != null ? groupsClaim : Collections.emptyList(); final UserDetails rslt = new SoffitApiUserDetails(claims.getBody().getSubject(), groupsList); request.setAttribute(USER_DETAILS_REQUEST_ATTRIBUTE, rslt); return rslt; } catch (Exception e) { logger.info("The following Bearer token is unusable: '{}'", bearerToken); logger.debug("Failed to validate and/or parse the specified Bearer token", e); } return null; }
Source:
public int getTerminalHeight() { if( !INTERACT ){ return 40; } if(console == null) { try { this.initBasicConsole(null); } catch (CliInitializationException e) { this.error("Failed to initialize the console: " + e.getLocalizedMessage()); return 24; } } return console.getTerminalHeight(); }

Target:
public int getTerminalHeight() { if (!INTERACT) { return 24; } if(console == null) { try { this.initBasicConsole(null); } catch (CliInitializationException e) { this.error("Failed to initialize the console: " + e.getLocalizedMessage()); return 24; } } return console.getTerminalHeight(); }
Source:
public static void report(String testId, Throwable cause) { if (cause == null) { log.severe("Can't call report with a null exception"); return; } long exceptionCount = FAILURE_ID.incrementAndGet(); log.severe("Exception #" + exceptionCount + " detected", cause); String targetFileName = exceptionCount + ".exception"; final File tmpFile = new File(targetFileName + ".tmp"); try { if (!tmpFile.createNewFile()) { throw new IOException("Could not create tmp file:" + tmpFile.getAbsolutePath()); } } catch (IOException e) { log.severe("Could not report exception; this means that this exception is not visible to the coordinator", e); return; } writeCauseToFile(testId, cause, tmpFile); final File file = new File(targetFileName); if (!tmpFile.renameTo(file)) { log.severe("Failed to rename tmp file:" + tmpFile + " to " + file); } }

Target:
public static void report(String testId, Throwable cause) { if (cause == null) { log.severe("Can't call report with a null exception"); return; } long exceptionCount = FAILURE_ID.incrementAndGet(); log.severe("Exception #" + exceptionCount + " detected", cause); String targetFileName = exceptionCount + ".exception"; final File tmpFile = new File(targetFileName + ".tmp"); try { if (!tmpFile.createNewFile()) { throw new IOException("Could not create tmp file:" + tmpFile.getAbsolutePath()+" file already exists."); } } catch (IOException e) { log.severe("Could not report exception; this means that this exception is not visible to the coordinator", e); return; } writeCauseToFile(testId, cause, tmpFile); final File file = new File(targetFileName); if (!tmpFile.renameTo(file)) { log.severe("Failed to rename tmp file:" + tmpFile + " to " + file); } }
Source:
private boolean hasDeploymentInfo() { boolean hasValue = false; for (String s : deploymentDesc) { hasValue |= StringUtils.hasText(s); } if (!hasValue) { return false; } if (StringUtils.isEmpty(deploymentDesc[MODULE_LABEL])) { throw new IllegalStateException("Module label missing"); } if (StringUtils.isEmpty(deploymentDesc[CONTAINER])) { throw new IllegalStateException("Container missing"); } return true; }

Target:
private boolean hasDeploymentInfo() { boolean hasValue = false; for (String s : deploymentDesc) { hasValue |= StringUtils.hasText(s); } if (!hasValue) { return false; } Assert.state(StringUtils.hasText(deploymentDesc[MODULE_LABEL]), "Module label missing"); Assert.state(StringUtils.hasText(deploymentDesc[CONTAINER]), "Container missing"); return true; }
Source:
private List<SearchHit> sendElasticQuery(ElasticsearchQueryBuilder queryBuilder) { ImmutableList.Builder<SearchHit> result = ImmutableList.builder(); SearchResponse response = queryBuilder.buildScrollSearchRequest().execute().actionGet(timeout.toMillis()); if (response.getHits().getTotalHits() > maxHits) { throw new PrestoException(ELASTICSEARCH_MAX_HITS_EXCEEDED, "The number of hits for the query: " + response.getHits().getTotalHits() + " exceeds the configured max hits: " + maxHits); } while (true) { for (SearchHit hit : response.getHits().getHits()) { result.add(hit); } response = queryBuilder.prepareSearchScroll(response.getScrollId()) .execute() .actionGet(timeout.toMillis()); if (response.getHits().getHits().length == 0) { break; } } return result.build(); }

Target:
private List<SearchHit> sendElasticQuery(ElasticsearchQueryBuilder queryBuilder) { ImmutableList.Builder<SearchHit> result = ImmutableList.builder(); SearchResponse response = queryBuilder.buildScrollSearchRequest() .execute() .actionGet(timeout.toMillis()); if (response.getHits().getTotalHits() > maxHits) { throw new PrestoException(ELASTICSEARCH_MAX_HITS_EXCEEDED, format("The number of hits for the query (%d) exceeds the configured max hits (%d)", response.getHits().getTotalHits(), maxHits)); } while (true) { for (SearchHit hit : response.getHits().getHits()) { result.add(hit); } response = queryBuilder.prepareSearchScroll(response.getScrollId()) .execute() .actionGet(timeout.toMillis()); if (response.getHits().getHits().length == 0) { break; } } return result.build(); }
Source:
public void testInheritanceCycle() throws Exception { String error = tapSystemErr(() -> { int exitStatus = catchSystemExit(() -> DynamicConfigValidator.main(new String[] { "--configDir", "src/test/resources/validator/bad_cyclic_inheritance" })); assertEquals(2, exitStatus); }); assert ("Inheriting from table 'A' creates an illegal cyclic dependency.\n".equals(error) || "Inheriting from table 'B' creates an illegal cyclic dependency.\n".equals(error)); }

Target:
public void testInheritanceCycle() throws Exception { String error = tapSystemErr(() -> { int exitStatus = catchSystemExit(() -> DynamicConfigValidator.main(new String[] { "--configDir", "src/test/resources/validator/bad_cyclic_inheritance" })); assertEquals(2, exitStatus); }); assertTrue(error.contains("Inheriting from table")); assertTrue(error.contains("creates an illegal cyclic dependency.")); }
Source:
public void start(BundleContext context) throws Exception { super.start(context); contextStore = new LocalContextStore(commonContextScaling); File storeFile = getDefaultContextLocation().toFile(); if (!storeFile.exists()) { storeFile.mkdirs(); } contextStore.setContextDirectory(storeFile); contextManager = new InteractionContextManager(contextStore); initContextContributor(); }

Target:
public void start(BundleContext context) throws Exception { super.start(context); contextStore = new LocalContextStore(commonContextScaling); File storeFile = getDefaultContextLocation().toFile(); if (!storeFile.exists()) { storeFile.mkdirs(); } contextStore.setContextDirectory(storeFile); contextManager = new InteractionContextManager(contextStore); }
Source:
private RSAPrivateKey getSigningKey(final String signingKeystoreName, final String signingKeystoreAlias, final char[] signingKeystorePassphrase) throws KeystoreServiceException, TokenServiceException { if (signingKeystorePassphrase != null) { char[] passphrase; try { passphrase = getSigningKeyPassphrase(signingKeystorePassphrase); } catch (AliasServiceException e) { throw new TokenServiceException(e); } return (RSAPrivateKey) ks.getSigningKey(signingKeystoreName, getSigningKeyAlias(signingKeystoreAlias), passphrase); } return signingKey; }

Target:
private RSAPrivateKey getSigningKey(final String signingKeystoreName, final String signingKeystoreAlias, final char[] signingKeystorePassphrase) throws KeystoreServiceException, TokenServiceException { if (signingKeystorePassphrase != null) { return (RSAPrivateKey) ks.getSigningKey(signingKeystoreName, getSigningKeyAlias(signingKeystoreAlias), getSigningKeyPassphrase(signingKeystorePassphrase)); } return signingKey; }
Source:
public UpdateImageOptions copyFrom(String url) { headers.put(COPY_FROM.asGlanceHeader(), url); return this; }

Target:
public UpdateImageOptions copyFrom(String url) { headers.put(COPY_FROM, url); return this; }