auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ConnectorPageSink createPageSink(HiveWritableTableHandle handle, boolean isCreateTable, ConnectorSession session) { OptionalInt bucketCount = OptionalInt.empty(); List<SortingColumn> sortedBy = ImmutableList.of(); if (handle.getBucketProperty().isPresent()) { bucketCount = OptionalInt.of(handle.getBucketProperty().get().getBucketCount()); sortedBy = handle.getBucketProperty().get().getSortedBy(); } HiveWriterFactory writerFactory = new HiveWriterFactory( fileWriterFactories, handle.getSchemaName(), handle.getTableName(), isCreateTable, handle.getInputColumns(), handle.getTableStorageFormat(), handle.getPartitionStorageFormat(), bucketCount, sortedBy, handle.getLocationHandle(), locationService, handle.getFilePrefix(), new HivePageSinkMetadataProvider(handle.getPageSinkMetadata(), metastore), typeManager, hdfsEnvironment, pageSorter, writerSortBufferSize, maxOpenSortFiles, immutablePartitions, session, nodeManager, eventClient, hiveSessionProperties, hiveWriterStats); return new HivePageSink( writerFactory, handle.getInputColumns(), handle.getBucketProperty(), pageIndexerFactory, typeManager, hdfsEnvironment, hiveSessionProperties.getMaxPartitionsPerWriter(session), writeVerificationExecutor, partitionUpdateCodec, session); }

Target:
private ConnectorPageSink createPageSink(HiveWritableTableHandle handle, boolean isCreateTable, ConnectorSession session) { OptionalInt bucketCount = OptionalInt.empty(); List<SortingColumn> sortedBy = ImmutableList.of(); if (handle.getBucketProperty().isPresent()) { bucketCount = OptionalInt.of(handle.getBucketProperty().get().getBucketCount()); sortedBy = handle.getBucketProperty().get().getSortedBy(); } HiveWriterFactory writerFactory = new HiveWriterFactory( fileWriterFactories, handle.getSchemaName(), handle.getTableName(), isCreateTable, handle.getInputColumns(), handle.getTableStorageFormat(), handle.getPartitionStorageFormat(), bucketCount, sortedBy, handle.getLocationHandle(), locationService, handle.getFilePrefix(), new HivePageSinkMetadataProvider(handle.getPageSinkMetadata(), metastore), typeManager, hdfsEnvironment, pageSorter, writerSortBufferSize, maxOpenSortFiles, immutablePartitions, session, nodeManager, eventClient, hiveSessionProperties, hiveWriterStats); return new HivePageSink( writerFactory, handle.getInputColumns(), handle.getBucketProperty(), pageIndexerFactory, typeManager, hdfsEnvironment, getMaxPartitionsPerWriter(session), writeVerificationExecutor, partitionUpdateCodec, session); }
Source:
public <T extends IResource> T stub(String kind, String name, String namespace) { String[] elements = ResourceKind.parse(kind); IVersionedType type = client.adapt(IApiTypeMapper.class).getType(elements[0], elements[1]); if (type != null) { KubernetesResource resource = (KubernetesResource) create(type.getApiGroupNameAndVersion(), elements[1]); resource.setName(name); resource.setNamespace(namespace); if (StringUtils.isNotEmpty(namespace)) { resource.setNamespace(namespace); } return (T) resource; } else { throw new ResourceFactoryException(null, "Unable to create resource from kind %s", kind); } }

Target:
public <T extends IResource> T stub(String kind, String name, String namespace) { String[] elements = ResourceKind.parse(kind); IVersionedType type = client.adapt(IApiTypeMapper.class).getType(elements[0], elements[1]); if (type != null) { KubernetesResource resource = create(type.getApiGroupNameAndVersion(), elements[1]); resource.setName(name); resource.setNamespace(namespace); if (StringUtils.isNotEmpty(namespace)) { resource.setNamespace(namespace); } return (T) resource; } else { throw new ResourceFactoryException(null, "Unable to create resource from kind %s", kind); } }
Source:
public ColumnWriterV2( ColumnDescriptor path, PageWriter pageWriter, ParquetProperties parquetProps, int pageSize) { this.path = path; this.pageWriter = pageWriter; resetStatistics(); this.repetitionLevelColumn = new RunLengthBitPackingHybridEncoder(getWidthFromMaxInt(path.getMaxRepetitionLevel()), MIN_SLAB_SIZE, pageSize, pageWriter.getAllocator()); this.definitionLevelColumn = new RunLengthBitPackingHybridEncoder(getWidthFromMaxInt(path.getMaxDefinitionLevel()), MIN_SLAB_SIZE, pageSize, pageWriter.getAllocator()); int initialSlabSize = CapacityByteArrayOutputStream.initialSlabSizeHeuristic(MIN_SLAB_SIZE, pageSize, 10); this.dataColumn = parquetProps.getValuesWriter(path, initialSlabSize, pageSize); }

Target:
public ColumnWriterV2( ColumnDescriptor path, PageWriter pageWriter, ParquetProperties parquetProps, int pageSize) { this.path = path; this.pageWriter = pageWriter; resetStatistics(); this.repetitionLevelColumn = new RunLengthBitPackingHybridEncoder( getWidthFromMaxInt(path.getMaxRepetitionLevel()), MIN_SLAB_SIZE, pageSize, parquetProps.getAllocator()); this.definitionLevelColumn = new RunLengthBitPackingHybridEncoder( getWidthFromMaxInt(path.getMaxDefinitionLevel()), MIN_SLAB_SIZE, pageSize, parquetProps.getAllocator()); int initialSlabSize = CapacityByteArrayOutputStream.initialSlabSizeHeuristic(MIN_SLAB_SIZE, pageSize, 10); this.dataColumn = parquetProps.getValuesWriter(path, initialSlabSize, pageSize); }
Source:
protected QuantileResult quantile(double level, DoubleArray sample, boolean isExtrapolated) { ArgChecker.isTrue(level > 0, "Quantile should be above 0."); ArgChecker.isTrue(level < 1, "Quantile should be below 1."); int sampleSize = sampleCorrection(sample.size()); double adjustedLevel = checkIndex(level * sampleSize + indexCorrection(), sample.size(), isExtrapolated); double[] order = createIndexArray(sample.size()); double[] s = sample.toArray(); DoubleArrayMath.sortPairs(s, order); int lowerIndex = (int) Math.floor(adjustedLevel); int upperIndex = (int) Math.ceil(adjustedLevel); double lowerWeight = upperIndex - adjustedLevel; double upperWeight = 1d - lowerWeight; return QuantileResult.of( lowerWeight * s[lowerIndex - 1] + upperWeight * s[upperIndex - 1], new int[]{(int) order[(int) Math.floor(adjustedLevel) - 1], (int) order[(int) Math.ceil(adjustedLevel) - 1]}, DoubleArray.of(lowerWeight, upperWeight)); }

Target:
protected QuantileResult quantile(double level, DoubleArray sample, boolean isExtrapolated) { ArgChecker.isTrue(level > 0, "Quantile should be above 0."); ArgChecker.isTrue(level < 1, "Quantile should be below 1."); int sampleSize = sampleCorrection(sample.size()); double adjustedLevel = checkIndex(level * sampleSize + indexCorrection(), sample.size(), isExtrapolated); double[] order = createIndexArray(sample.size()); double[] s = sample.toArray(); DoubleArrayMath.sortPairs(s, order); int lowerIndex = (int) Math.floor(adjustedLevel); int upperIndex = (int) Math.ceil(adjustedLevel); double lowerWeight = upperIndex - adjustedLevel; double upperWeight = 1d - lowerWeight; return QuantileResult.of( lowerWeight * s[lowerIndex - 1] + upperWeight * s[upperIndex - 1], new int[]{(int) order[lowerIndex - 1], (int) order[upperIndex - 1]}, DoubleArray.of(lowerWeight, upperWeight)); }
Source:
public void testReaperReapsAnEmptyGroupAfterConfiguredDelay() throws Exception { final MessageGroupStore groupStore = new SimpleMessageStore(); AggregatingMessageHandler handler = new AggregatingMessageHandler(group -> group, groupStore); final List<Message<?>> outputMessages = new ArrayList<Message<?>>(); handler.setOutputChannel((message, timeout) -> { outputMessages.add(message); return true; }); handler.setReleaseStrategy(group -> group.size() == 1); Message<String> message = MessageBuilder.withPayload("foo") .setCorrelationId("bar") .build(); handler.handleMessage(message); handler.setMinimumTimeoutForEmptyGroups(100); assertEquals(1, outputMessages.size()); assertEquals(1, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); groupStore.expireMessageGroups(0); assertEquals(1, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); int n = 0; while (n++ < 100) { groupStore.expireMessageGroups(0); if (TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size() > 0) { Thread.sleep(50); } else { break; } } assertTrue(n < 100); assertEquals(0, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); }

Target:
public void testReaperReapsAnEmptyGroupAfterConfiguredDelay() throws Exception { final MessageGroupStore groupStore = new SimpleMessageStore(); AggregatingMessageHandler handler = new AggregatingMessageHandler(group -> group, groupStore); final List<Message<?>> outputMessages = new ArrayList<Message<?>>(); handler.setOutputChannel((message, timeout) -> { outputMessages.add(message); return true; }); handler.setReleaseStrategy(group -> group.size() == 1); Message<String> message = MessageBuilder.withPayload("foo") .setCorrelationId("bar") .build(); handler.handleMessage(message); handler.setMinimumTimeoutForEmptyGroups(100); assertEquals(1, outputMessages.size()); assertEquals(1, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); groupStore.expireMessageGroups(0); assertEquals(1, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); int n = 0; while (n++ < 200) { groupStore.expireMessageGroups(0); if (TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size() > 0) { Thread.sleep(50); } else { break; } } assertTrue(n < 200); assertEquals(0, TestUtils.getPropertyValue(handler, "messageStore.groupIdToMessageGroup", Map.class).size()); }
Source:
public int getCommentID(String content) { this.commentsList = getDriver().findElements(By.className("xwikicomment")); for (int i = 0; i < this.commentsList.size(); i++) { if (this.commentsList.get(i).findElement(By.className("commentcontent")).getText().equals(content)) { return Integer .parseInt(this.commentsList.get(i).getAttribute("id").substring("xwikicomment_".length())); } } return -1; }

Target:
public int getCommentID(String content) { this.commentsList = getDriver().findElementsWithoutWaiting(By.className("xwikicomment")); for (int i = 0; i < this.commentsList.size(); i++) { if (this.commentsList.get(i).findElement(By.className("commentcontent")).getText().equals(content)) { return Integer .parseInt(this.commentsList.get(i).getAttribute("id").substring("xwikicomment_".length())); } } return -1; }
Source:
public boolean shouldStreamEntireSSTable() { if (!isZeroCopySSTableTransfersEnabled || ref.get().getSSTableMetadata().hasLegacyCounterShards) return false; ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(getTableId()); if (cfs == null) return false; AbstractCompactionStrategy compactionStrategy = cfs.getCompactionStrategyManager() .getCompactionStrategyFor(ref.get()); if (compactionStrategy instanceof LeveledCompactionStrategy) return contained(ranges, ref.get()); if (compactionStrategy instanceof SizeTieredCompactionStrategy) { return (ranges != null && ranges.size() == 1 && ranges.get(0) .contains(new Range<>(ref.get().first.getToken(), ref.get().last.getToken()))); } return false; }

Target:
public boolean shouldStreamEntireSSTable() { if (!DatabaseDescriptor.isZeroCopySSTableTransfersEnabled() || ref.get().getSSTableMetadata().hasLegacyCounterShards) return false; ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(getTableId()); if (cfs == null) return false; AbstractCompactionStrategy compactionStrategy = cfs.getCompactionStrategyManager() .getCompactionStrategyFor(ref.get()); if (compactionStrategy instanceof LeveledCompactionStrategy) return contained(ranges, ref.get()); return false; }
Source:
public synchronized Map<String, DbColumnType> getMetadata(final String name) throws DatabaseEngineException { final Map<String, DbColumnType> metaMap = new LinkedHashMap<>(); Statement s = null; ResultSet rsColumns = null; try { getConnection(); s = conn.createStatement(); rsColumns = s.executeQuery(format( "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION FROM ALL_TAB_COLS WHERE TABLE_NAME = '%s' AND OWNER = '%s'", name, this.currentSchema )); while (rsColumns.next()) { String columnName = rsColumns.getString("COLUMN_NAME"); if (!columnName.toUpperCase().startsWith("SYS_")) { final String dataPrecision = rsColumns.getString("DATA_PRECISION"); final DbColumnType value = toPdbType( dataPrecision == null ? rsColumns.getString("DATA_TYPE") : (rsColumns.getString("DATA_TYPE") + dataPrecision) ); if (value != DbColumnType.UNMAPPED) { metaMap.put(columnName, value); } } } return metaMap; } catch (Exception e) { throw new DatabaseEngineException("Could not get metadata", e); } finally { try { if (rsColumns != null) { rsColumns.close(); } } catch (Exception a) { logger.trace("Error closing result set.", a); } try { if (s != null) { s.close(); } } catch (Exception a) { logger.trace("Error closing statement.", a); } } }

Target:
public synchronized Map<String, DbColumnType> getMetadata(final String name) throws DatabaseEngineException { final Map<String, DbColumnType> metaMap = new LinkedHashMap<>(); Statement s = null; ResultSet rsColumns = null; try { getConnection(); s = conn.createStatement(); rsColumns = s.executeQuery(format( "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION FROM ALL_TAB_COLS WHERE TABLE_NAME = '%s' AND OWNER = '%s'", name, this.currentSchema )); while (rsColumns.next()) { String columnName = rsColumns.getString("COLUMN_NAME"); if (!columnName.toUpperCase().startsWith("SYS_")) { final String dataPrecision = rsColumns.getString("DATA_PRECISION"); final DbColumnType value = toPdbType( dataPrecision == null ? rsColumns.getString("DATA_TYPE") : (rsColumns.getString("DATA_TYPE") + dataPrecision) ); if (value != DbColumnType.UNMAPPED) { metaMap.put(columnName, value); } } } return metaMap; } catch (final Exception e) { throw new DatabaseEngineException("Could not get metadata", e); } finally { try { if (rsColumns != null) { rsColumns.close(); } } catch (final Exception a) { logger.trace("Error closing result set.", a); } try { if (s != null) { s.close(); } } catch (final Exception a) { logger.trace("Error closing statement.", a); } } }
Source:
public void deserialize(InputStream input) throws IOException { byte[] bytes = new byte[1024]; int read = 0; ByteArrayOutputStream out = new ByteArrayOutputStream(); while((read = input.read(bytes)) > 0) out.write(bytes, 0, read); this.setString(out.toString()); }

Target:
public void deserialize(InputStream input) throws IOException { byte[] bytes = new byte[1024]; int read = 0; ByteArrayOutputStream out = new ByteArrayOutputStream(); while((read = input.read(bytes)) > 0) { out.write(bytes, 0, read); } this.setString(out.toString()); }
Source:
private void validateConfigOptions(ReadableConfig config) { config.getOptional(URL).orElseThrow(() -> new IllegalArgumentException( String.format("Could not find required property: %s", URL.key()))); config.getOptional(TABLE_NAME).orElseThrow(() -> new IllegalArgumentException( String.format("Could not find required property: %s", TABLE_NAME.key()))); String jdbcUrl = config.get(URL); final Optional<JdbcDialect> dialect = JdbcDialects.get(jdbcUrl); checkState(dialect.isPresent(), "Cannot handle such jdbc url: " + jdbcUrl); if (config.getOptional(USERNAME).isPresent()) { checkState(config.getOptional(PASSWORD).isPresent(), "Database username must be provided when database password is provided"); } checkAllOrNone(config, new ConfigOption[]{ SCAN_PARTITION_COLUMN, SCAN_PARTITION_NUM, SCAN_PARTITION_LOWER_BOUND, SCAN_PARTITION_UPPER_BOUND }); if (config.getOptional(SCAN_PARTITION_LOWER_BOUND).isPresent() && config.getOptional(SCAN_PARTITION_UPPER_BOUND).isPresent()) { checkState(config.get(SCAN_PARTITION_LOWER_BOUND) <= config.get(SCAN_PARTITION_UPPER_BOUND), String.format("%s must not be larger than %s", SCAN_PARTITION_LOWER_BOUND.key(), SCAN_PARTITION_UPPER_BOUND.key())); } checkAllOrNone(config, new ConfigOption[]{ LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); }

Target:
private void validateConfigOptions(ReadableConfig config) { config.getOptional(URL).orElseThrow(() -> new IllegalArgumentException( String.format("Could not find required option: %s", URL.key()))); config.getOptional(TABLE_NAME).orElseThrow(() -> new IllegalArgumentException( String.format("Could not find required option: %s", TABLE_NAME.key()))); String jdbcUrl = config.get(URL); final Optional<JdbcDialect> dialect = JdbcDialects.get(jdbcUrl); checkState(dialect.isPresent(), "Cannot handle such jdbc url: " + jdbcUrl); if (config.getOptional(USERNAME).isPresent()) { checkState(config.getOptional(PASSWORD).isPresent(), "Database username must be provided when database password is provided"); } checkAllOrNone(config, new ConfigOption[]{ SCAN_PARTITION_COLUMN, SCAN_PARTITION_NUM, SCAN_PARTITION_LOWER_BOUND, SCAN_PARTITION_UPPER_BOUND }); if (config.getOptional(SCAN_PARTITION_LOWER_BOUND).isPresent() && config.getOptional(SCAN_PARTITION_UPPER_BOUND).isPresent()) { checkState(config.get(SCAN_PARTITION_LOWER_BOUND) <= config.get(SCAN_PARTITION_UPPER_BOUND), String.format("%s must not be larger than %s", SCAN_PARTITION_LOWER_BOUND.key(), SCAN_PARTITION_UPPER_BOUND.key())); } checkAllOrNone(config, new ConfigOption[]{ LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); }
Source:
public void testCreateListenerIllegalStateException() throws Exception { final Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); final LocalizedMessage loadPropertiesMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, "Main.createListener", new String[] {"myformat", "plain", "xml"}, null, getClass(), null); method.setAccessible(true); try { method.invoke(null, "myformat", null); fail("InvocationTargetException is expected"); } catch (InvocationTargetException ex) { assertEquals(loadPropertiesMessage.getMessage(), ex.getCause().getLocalizedMessage()); assertTrue(ex.getCause() instanceof IllegalStateException); } }

Target:
public void testCreateListenerIllegalStateException() throws Exception { final Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); method.setAccessible(true); try { method.invoke(null, "myformat", null); fail("InvocationTargetException is expected"); } catch (InvocationTargetException ex) { final LocalizedMessage loadPropertiesMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, "Main.createListener", new String[] {"myformat", "plain", "xml"}, null, getClass(), null); assertEquals(loadPropertiesMessage.getMessage(), ex.getCause().getLocalizedMessage()); assertTrue(ex.getCause() instanceof IllegalStateException); } }
Source:
private boolean isAllNulls(ColumnChunkMetaData column) { return (column.getStatistics().isEmpty()) || (column.getStatistics().getNumNulls() == column.getValueCount()); }

Target:
private boolean isAllNulls(ColumnChunkMetaData column) { return column.getStatistics().getNumNulls() == column.getValueCount(); }
Source:
private Row internalNext() { if (cache == null && !yielder.isDone()) { cache = yielder.get(); yielder = yielder.next(cache); cacheIter = cache.getRows().iterator(); } Row r = null; if (cacheIter != null) { if (cacheIter.hasNext()) { r = cacheIter.next(); Map<String, Object> key = MovingAverageHelper.getDimKeyFromRow(dims, r); seenKeys.add(key); r = computeMovingAverage(key, r, false); if (r != null) { return r; } else { throw new NoSuchElementException(); } } else { Set<Map<String, Object>> averagerKeys = new HashSet<>(averagers.keySet()); averagerKeys.removeAll(seenKeys); averagersKeysIter = averagerKeys.iterator(); cacheIter = null; } } if (averagersKeysIter != null) { while (averagersKeysIter.hasNext()) { Map<String, Object> dims = averagersKeysIter.next(); Map<String, Object> fakeEventsCopy = new HashMap<>(fakeEvents); dims.forEach((dim, value) -> { fakeEventsCopy.put(dim, value); }); r = computeMovingAverage(dims, new MapBasedRow(cache.getDateTime(), fakeEventsCopy), true); if (r != null) { return r; } } seenKeys.clear(); averagersKeysIter = null; cache = null; } if (cacheIter == null && averagersKeysIter == null && yielder.isDone()) { throw new NoSuchElementException(); } return internalNext(); }

Target:
private Row internalNext() { while (true) { if (cache == null && !yielder.isDone()) { cache = yielder.get(); yielder = yielder.next(cache); cacheIter = cache.getRows().iterator(); } Row r; if (cacheIter != null) { if (cacheIter.hasNext()) { r = cacheIter.next(); Map<String, Object> key = MovingAverageHelper.getDimKeyFromRow(dims, r); seenKeys.add(key); r = computeMovingAverage((MapBasedRow) r, false); if (r != null) { return r; } else { throw new NoSuchElementException(); } } else { Set<Map<String, Object>> averagerKeys = new HashSet<>(averagers.keySet()); averagerKeys.removeAll(seenKeys); averagersKeysIter = averagerKeys.iterator(); cacheIter = null; } } if (averagersKeysIter != null) { while (averagersKeysIter.hasNext()) { Map<String, Object> dims = averagersKeysIter.next(); Map<String, Object> emptyEventsCopy = new HashMap<>(emptyEvents); dims.forEach((dim, value) -> emptyEventsCopy.put(dim, value)); r = computeMovingAverage(new MapBasedRow(cache.getDateTime(), emptyEventsCopy), true); if (r != null) { return r; } } seenKeys.clear(); averagersKeysIter = null; cache = null; } if (cacheIter == null && yielder.isDone()) { return null; } } }
Source:
public static boolean anyRunning() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()) return true; } } return false; }

Target:
public static boolean anyRunning() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()){ return true; } } } return false; }
Source:
public void testCompactFooterModifiedSchemaRegistration() throws Exception { try (Ignite ignite = Ignition.start(Config.getServerConfiguration())) { ignite.getOrCreateCache(Config.DEFAULT_CACHE_NAME); try (IgniteClient client1 = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER) .setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(true))); IgniteClient client2 = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER) .setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(true))) ) { ClientCache<Integer, Object> cache1 = client1.cache(Config.DEFAULT_CACHE_NAME).withKeepBinary(); ClientCache<Integer, Object> cache2 = client2.cache(Config.DEFAULT_CACHE_NAME).withKeepBinary(); String type = "Person"; BinaryObjectBuilder builder1 = client1.binary().builder(type); BinaryObject val1 = builder1.setField("Name", "Person 1").build(); cache1.put(1, val1); assertEquals("Person 1", ((BinaryObject)cache2.get(1)).field("Name")); BinaryObjectBuilder builder2 = client1.binary().builder(type); BinaryObject val2 = builder2.setField("Name", "Person 2").setField("Age", 2).build(); cache1.put(2, val2); assertEquals("Person 2", ((BinaryObject)cache2.get(2)).field("Name")); assertEquals((Integer)2, ((BinaryObject)cache2.get(2)).field("Age")); } } }

Target:
public void testCompactFooterModifiedSchemaRegistration() throws Exception { try (Ignite ignite = Ignition.start(Config.getServerConfiguration())) { ignite.getOrCreateCache(Config.DEFAULT_CACHE_NAME); ClientConfiguration cfg = new ClientConfiguration().setAddresses(Config.SERVER) .setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(true)); try (IgniteClient client1 = Ignition.startClient(cfg); IgniteClient client2 = Ignition.startClient(cfg)) { ClientCache<Integer, Object> cache1 = client1.cache(Config.DEFAULT_CACHE_NAME).withKeepBinary(); ClientCache<Integer, Object> cache2 = client2.cache(Config.DEFAULT_CACHE_NAME).withKeepBinary(); String type = "Person"; BinaryObjectBuilder builder = client1.binary().builder(type); BinaryObject val1 = builder.setField("Name", "Person 1").build(); cache1.put(1, val1); assertEquals("Person 1", ((BinaryObject)cache2.get(1)).field("Name")); BinaryObject val2 = builder.setField("Name", "Person 2").setField("Age", 2).build(); cache1.put(2, val2); assertEquals("Person 2", ((BinaryObject)cache2.get(2)).field("Name")); assertEquals((Integer)2, ((BinaryObject)cache2.get(2)).field("Age")); } } }
Source:
public View newView(Context context, Cursor cursor, ViewGroup parent) { return ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)) .inflate(android.R.layout.simple_list_item_1, parent, false); }

Target:
public View newView(Context context, Cursor cursor, ViewGroup parent) { return LayoutInflater.from(context) .inflate(android.R.layout.simple_list_item_1, parent, false); }
Source:
public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException { return root.retrieve() .method("POST") .with("subscribed", subscribed) .with("ignored", ignored) .method("PUT") .withUrlPath(getApiTailUrl("subscription")) .to(GHSubscription.class) .wrapUp(this); }

Target:
public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException { return root.createRequest() .method("PUT") .with("subscribed", subscribed) .with("ignored", ignored) .withUrlPath(getApiTailUrl("subscription")) .fetch(GHSubscription.class) .wrapUp(this); }
Source:
public void onLivingAttack(LivingAttackEvent event) { if (event.getEntity() instanceof EntityPlayer) { if (!FactionPlayerHandler.get((EntityPlayer) event.getEntity()).onEntityAttacked(event.getSource(), event.getAmount())) { event.setCanceled(true); } if (VampirePlayer.get((EntityPlayer) event.getEntity()).getSpecialAttributes().half_invulnerable) { if (event.getAmount() >= event.getEntityLiving().getMaxHealth() * Balance.vpa.HALINVULNERABLE_BORDER && event.getAmount() < 10000) event.setCanceled(true); } } }

Target:
public void onLivingAttack(LivingAttackEvent event) { if (event.getEntity() instanceof EntityPlayer) { if (!FactionPlayerHandler.get((EntityPlayer) event.getEntity()).onEntityAttacked(event.getSource(), event.getAmount())) { event.setCanceled(true); } } }
Source:
public void refresh(ExtensionComponentSet delta) { synchronized (getLoadLock()) { if (extensions==null) return; Collection<ExtensionComponent<T>> found = load(delta); if (!found.isEmpty()) { List<ExtensionComponent<T>> l = Lists.newArrayList(extensions); l.addAll(found); extensions = sort(l); fireOnChangeListeners(); } } }

Target:
public void refresh(ExtensionComponentSet delta) { boolean fireOnChangeListeners = false; synchronized (getLoadLock()) { if (extensions==null) return; Collection<ExtensionComponent<T>> found = load(delta); if (!found.isEmpty()) { List<ExtensionComponent<T>> l = Lists.newArrayList(extensions); l.addAll(found); extensions = sort(l); fireOnChangeListeners = true; } } if (fireOnChangeListeners) { fireOnChangeListeners(); } }
Source:
protected void runOneIteration() { for (Map.Entry<JobId, Job> entry : masterModel.getJobs().entrySet()) { JobId jobId = entry.getKey(); Job job = entry.getValue(); if (job.getExpires() == null) { continue; } else if (job.getExpires().getTime() <= System.currentTimeMillis()) { final JobStatus status = masterModel.getJobStatus(jobId); List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet()); for (String host : hosts) { try { masterModel.undeployJob(host, jobId); } catch (HostNotFoundException e) { log.error("couldn't undeploy job from host when it hit deadline", jobId, host, e); } catch (JobNotDeployedException e) { log.debug("job was already undeployed when it hit deadline", jobId, e); } } try { masterModel.removeJob(jobId); } catch (JobDoesNotExistException e) { log.debug("job was already removed when it hit deadline", jobId, e); } catch (JobStillDeployedException e) { log.debug("job still deployed on some host(s) after expiry reap", jobId, e); } } } }

Target:
protected void runOneIteration() { for (Entry<JobId, Job> entry : masterModel.getJobs().entrySet()) { JobId jobId = entry.getKey(); Job job = entry.getValue(); if (job.getExpires() == null) { continue; } else if (job.getExpires().getTime() <= System.currentTimeMillis()) { final JobStatus status = masterModel.getJobStatus(jobId); final List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet()); for (String host : hosts) { try { masterModel.undeployJob(host, jobId); } catch (HostNotFoundException e) { log.error("couldn't undeploy job from host when it hit deadline", jobId, host, e); } catch (JobNotDeployedException e) { log.debug("job was already undeployed when it hit deadline", jobId, e); } } try { masterModel.removeJob(jobId); } catch (JobDoesNotExistException e) { log.debug("job was already removed when it hit deadline", jobId, e); } catch (JobStillDeployedException e) { log.debug("job still deployed on some host(s) after expiry reap", jobId, e); } } } }
Source:
public String toPythonCode() { final StringBuilder builder = new StringBuilder(); builder.append("if self.response.status == ").append(code).append(":\n") .append(pythonIndent(3)) .append("self.result = response.read()"); return builder.toString(); }

Target:
public String toPythonCode() { final StringBuilder builder = new StringBuilder("if self.response.status == "); builder.append(code).append(":\n") .append(pythonIndent(3)) .append("self.result = response.read()"); return builder.toString(); }
Source:
public void discoverPackageDependencies() { if (discoveringDependencies_) return; if (sentinel_ == null) return; discoveringDependencies_ = true; server_.discoverPackageDependencies( sentinel_.getId(), docDisplay_.getFileType().getDefaultExtension(), new ServerRequestCallback<JsArrayString>() { @Override public void onResponseReceived(JsArrayString response) { discoveringDependencies_ = false; if (response.length() > 0) target_.showRequiredPackagesMissingWarning(JsUtil.toList(response)); } @Override public void onError(ServerError error) { discoveringDependencies_ = false; Debug.logError(error); } }); }

Target:
public void discoverPackageDependencies() { if (discoveringDependencies_) return; if (sentinel_ == null) return; boolean canDiscoverDependencies = docDisplay_.getFileType().isR() || docDisplay_.getFileType().isRmd() || docDisplay_.getFileType().isRnw(); if (!canDiscoverDependencies) return; discoveringDependencies_ = true; server_.discoverPackageDependencies( sentinel_.getId(), docDisplay_.getFileType().getDefaultExtension(), new ServerRequestCallback<AvailablePackagesReadyEvent.Data>() { @Override public void onResponseReceived(AvailablePackagesReadyEvent.Data response) { discoveringDependencies_ = false; if (!response.isReady()) return; JsArrayString packages = response.getPackages(); if (packages.length() > 0) target_.showRequiredPackagesMissingWarning(JsUtil.toList(packages)); } @Override public void onError(ServerError error) { discoveringDependencies_ = false; Debug.logError(error); } }); }
Source:
public CreateRequest processPreCreate(CreateRequest input) { ddf.security.Subject subject = setSubjectOnRequestProperties(input); if (input.getMetacards() != null && subject != null) { input .getMetacards() .stream() .filter(metacard -> metacard.getAttribute(Metacard.POINT_OF_CONTACT) == null) .forEach( metacard -> { String id = subjectIdentity.getUniqueIdentifier(subject); if ((metacard.getTags().isEmpty() || metacard.getTags().contains("resource")) && StringUtils.isNotBlank(id)) { metacard.setAttribute(new AttributeImpl(Metacard.POINT_OF_CONTACT, id)); } }); } return input; }

Target:
public CreateRequest processPreCreate(CreateRequest input) { ddf.security.Subject subject = setSubjectOnRequestProperties(input); if (input.getMetacards() != null && subject != null) { input .getMetacards() .stream() .filter(metacard -> metacard.getAttribute(Metacard.POINT_OF_CONTACT) == null) .forEach( metacard -> { String id = subjectIdentity.getUniqueIdentifier(subject); if ((metacard.getTags().isEmpty() || metacard.getTags().contains(Metacard.DEFAULT_TAG)) && StringUtils.isNotBlank(id)) { metacard.setAttribute(new AttributeImpl(Metacard.POINT_OF_CONTACT, id)); } }); } return input; }
Source:
public AlleleFractionInitializer(final AlleleFractionData data) { state = new AlleleFractionState(INITIAL_MEAN_BIAS, INITIAL_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY, initialMinorFractions(data)); double previousIterationLogLikelihood; double nextIterationLogLikelihood = Double.NEGATIVE_INFINITY; int iteration = 1; System.out.format("Initializing allele fraction model. Iterating until log likelihood converges to within %.3f.%n", LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); do { previousIterationLogLikelihood = nextIterationLogLikelihood; state = new AlleleFractionState(estimateMeanBias(data), estimateBiasVariance(data), estimateOutlierProbability(data), estimateMinorFractions(data)); nextIterationLogLikelihood = AlleleFractionModeller.logLikelihood(state, data); System.out.format("Iteration %d, model log likelihood = %.3f.%n", iteration, nextIterationLogLikelihood); iteration++; } while (nextIterationLogLikelihood - previousIterationLogLikelihood > LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); }

Target:
public AlleleFractionInitializer(final AlleleFractionData data) { state = new AlleleFractionState(INITIAL_MEAN_BIAS, INITIAL_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY, initialMinorFractions(data)); double previousIterationLogLikelihood; double nextIterationLogLikelihood = Double.NEGATIVE_INFINITY; int iteration = 1; logger.info(String.format("Initializing allele fraction model. Iterating until log likelihood converges to within %.3f.%n", LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD)); do { previousIterationLogLikelihood = nextIterationLogLikelihood; state = new AlleleFractionState(estimateMeanBias(data), estimateBiasVariance(data), estimateOutlierProbability(data), estimateMinorFractions(data)); nextIterationLogLikelihood = AlleleFractionModeller.logLikelihood(state, data); logger.info(String.format("Iteration %d, model log likelihood = %.3f.%n", iteration, nextIterationLogLikelihood)); iteration++; } while (iteration < MAX_ITERATIONS && nextIterationLogLikelihood - previousIterationLogLikelihood > LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); }
Source:
public boolean checkIndex(DBBroker broker) { Connection conn = null; try { conn = acquireConnection(); return checkIndex(broker, conn); } catch (SQLException | SpatialIndexException e) { LOG.error(e); return false; } finally { try { if (conn != null) releaseConnection(conn); } catch (SQLException e) { LOG.error(e); return false; } } }

Target:
public boolean checkIndex(DBBroker broker) { Connection conn = null; try { conn = acquireConnection(); return checkIndex(broker, conn); } catch (final SQLException | SpatialIndexException e) { LOG.error(e); return false; } finally { try { if (conn != null) releaseConnection(conn); } catch (SQLException e) { LOG.error(e); return false; } } }
Source:
protected List<ResourceGroupSelector> buildSelectors(ManagerSpec managerSpec) { ImmutableList.Builder<ResourceGroupSelector> selectors = ImmutableList.builder(); for (SelectorSpec spec : managerSpec.getSelectors()) { validateSelectors(managerSpec.getRootGroups(), spec); selectors.add(new StaticSelector( spec.getUserRegex(), spec.getSourceRegex(), spec.getClientTags(), spec.getResourceEstimatesRange(), spec.getQueryType(), spec.getGroup())); } return selectors.build(); }

Target:
protected List<ResourceGroupSelector> buildSelectors(ManagerSpec managerSpec) { ImmutableList.Builder<ResourceGroupSelector> selectors = ImmutableList.builder(); for (SelectorSpec spec : managerSpec.getSelectors()) { validateSelectors(managerSpec.getRootGroups(), spec); selectors.add(new StaticSelector( spec.getUserRegex(), spec.getSourceRegex(), spec.getClientTags(), spec.getResourceEstimate(), spec.getQueryType(), spec.getGroup())); } return selectors.build(); }
Source:
public String displaySkinCssHeader(RenderRequest request, RenderResponse response, Model model) throws IOException { ENDER_HEADERS phase may be called before or at the same time as the RENDER_MARKUP. The spec is ENDER_HEADERS phase is included before ENDER_MARKUP phase). uPortal inserts the HTML markup returned from RENDER_HEADERS execution into the HEAD if (PortletRequest.RENDER_HEADERS.equals(request.getAttribute(PortletRequest.RENDER_PART))) { PortletPreferences prefs = request.getPreferences(); Boolean enabled = Boolean.valueOf(prefs.getValue(PREF_DYNAMIC, "")); String defaultSkinName = prefs.getValue(PREF_SKIN_NAME, DEFAULT_SKIN_NAME); String cssUrl = enabled ? calculateDynamicSkinUrlPathToUse(request, defaultSkinName) : calculateCssLocationInWebapp(defaultSkinName, ""); model.addAttribute("skinCssUrl", cssUrl); return "jsp/DynamicRespondrSkin/skinHeader"; } else { ENDER_MARKUP return null; } }

Target:
public String displaySkinCssHeader(RenderRequest request, RenderResponse response, Model model) throws IOException { ENDER_HEADERS phase may be called before or at the same time as the RENDER_MARKUP. The spec is ENDER_HEADERS phase is included before ENDER_MARKUP phase). uPortal inserts the HTML markup returned from RENDER_HEADERS execution into the HEAD if (PortletRequest.RENDER_HEADERS.equals(request.getAttribute(PortletRequest.RENDER_PART))) { PortletPreferences prefs = request.getPreferences(); Boolean enabled = Boolean.valueOf(prefs.getValue(PREF_DYNAMIC, "false")); String defaultSkinName = prefs.getValue(PREF_SKIN_NAME, DEFAULT_SKIN_NAME); String cssUrl = enabled ? calculateDynamicSkinUrlPathToUse(request, defaultSkinName) : calculateCssLocationInWebapp(defaultSkinName, ""); model.addAttribute("skinCssUrl", cssUrl); return "jsp/DynamicRespondrSkin/skinHeader"; } else { ENDER_MARKUP return "jsp/DynamicRespondrSkin/skinBody"; } }
Source:
public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException { int blockHeight = rawBlock.getHeight(); log.trace("Parse block at height={} ", blockHeight); validateIfBlockIsConnecting(rawBlock); daoStateService.onNewBlockHeight(blockHeight); final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash()); if (isBlockAlreadyAdded(rawBlock)) { log.warn("Block was already added."); DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock); } else { daoStateService.onNewBlockWithEmptyTxs(block); } long startTs = System.currentTimeMillis(); rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply) .ifPresent(daoStateService::onNewTxForLastBlock)); log.info("Parsing transactions at block height took ms", rawBlock.getRawTxs().size(), blockHeight, System.currentTimeMillis() - startTs); daoStateService.onParseBlockComplete(block); return block; }

Target:
public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException { int blockHeight = rawBlock.getHeight(); log.trace("Parse block at height={} ", blockHeight); validateIfBlockIsConnecting(rawBlock); daoStateService.onNewBlockHeight(blockHeight); final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash()); if (isBlockAlreadyAdded(rawBlock)) { log.warn("Block was already added."); DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock); } else { daoStateService.onNewBlockWithEmptyTxs(block); } long startTs = System.currentTimeMillis(); rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply) .ifPresent(tx -> daoStateService.onNewTxForLastBlock(block, tx))); log.info("Parsing transactions at block height took ms", rawBlock.getRawTxs().size(), blockHeight, System.currentTimeMillis() - startTs); daoStateService.onParseBlockComplete(block); return block; }
Source:
private static TypedSource[] createTypedSourcesForImportContainer(SourceTuple tuple, IImportContainer container) throws JavaModelException, CoreException { IJavaElement[] imports= container.getChildren(); List<TypedSource> result= new ArrayList<>(imports.length); for (IJavaElement i : imports) { result.addAll(Arrays.asList(createTypedSources(i, tuple))); } return result.toArray(new TypedSource[result.size()]); }

Target:
private static TypedSource[] createTypedSourcesForImportContainer(SourceTuple tuple, IImportContainer container) throws JavaModelException, CoreException { IJavaElement[] imports= container.getChildren(); List<TypedSource> result= new ArrayList<>(imports.length); for (IJavaElement importedElement : imports) { result.addAll(Arrays.asList(createTypedSources(importedElement, tuple))); } return result.toArray(new TypedSource[result.size()]); }
Source:
public boolean applicableInState(State state, String[] params) { if (!super.applicableInState(state, params)) { return false; } ObjectInstance agent = state.getObject(params[0]); ObjectInstance container = state.getObject(params[1]); if (ContainerFactory.isEmptyContainer(container)) { return false; } if (ContainerFactory.isReceivingContainer(container)) { return false; } if (ContainerFactory.isMixingContainer(container)) { return false; } if (ContainerFactory.getContentNames(container).size() != 1) { return false; } Set<String> contents = ContainerFactory.getContentNames(container); for (String ingredient : contents) { ObjectInstance ingredientObject = state.getObject(ingredient); if (IngredientFactory.isPeeledIngredient(ingredientObject)) { return false; } } return true; }

Target:
public boolean applicableInState(State state, String[] params) { if (!super.applicableInState(state, params)) { return false; } ObjectInstance container = state.getObject(params[1]); if (ContainerFactory.isEmptyContainer(container)) { return false; } if (ContainerFactory.getContentNames(container).size() != 1) { return false; } Set<String> contents = ContainerFactory.getContentNames(container); for (String ingredient : contents) { ObjectInstance ingredientObject = state.getObject(ingredient); if (IngredientFactory.isPeeledIngredient(ingredientObject)) { return false; } } return true; }
Source:
private void handleVariantsReceived(JSONArray variants) { final SharedPreferences preferences = getSharedPreferences(); final SharedPreferences.Editor editor = preferences.edit(); if(variants != null) { editor.putString(SHARED_PREF_CHANGES_KEY, variants.toString()); } else { editor.remove(SHARED_PREF_CHANGES_KEY); } editor.apply(); initializeChanges(); }

Target:
private void handleVariantsReceived(JSONArray variants) { final SharedPreferences preferences = getSharedPreferences(); final SharedPreferences.Editor editor = preferences.edit(); if(variants.length() > 0) { editor.putString(SHARED_PREF_CHANGES_KEY, variants.toString()); } else { editor.remove(SHARED_PREF_CHANGES_KEY); } editor.apply(); initializeChanges(); }
Source:
public void shutdown(Optional<Duration> maximumCompletionWait) throws InterruptedException { stop = true; taskServer.interruptLocalWait(); synchronized (shutdownLock) { executor.shutdown(); shutdownLock.notifyAll(); } if (maximumCompletionWait.isPresent()) { long seconds = maximumCompletionWait.get().getSeconds(); if (!executor.awaitTermination(seconds, TimeUnit.SECONDS)) { logger.warn("Some tasks didn't finish within maximum wait time ({} seconds)", seconds); } } else { while (!executor.awaitTermination(24, TimeUnit.HOURS)) ; } }

Target:
public void shutdown(Optional<Duration> maximumCompletionWait) throws InterruptedException { stop = true; taskServer.interruptLocalWait(); int activeCount; synchronized (newTaskLock) { executor.shutdown(); activeCount = executor.getActiveCount(); newTaskLock.notifyAll(); } if (activeCount > 0) { logger.info("Waiting for completion of running tasks...", activeCount); } if (maximumCompletionWait.isPresent()) { long seconds = maximumCompletionWait.get().getSeconds(); if (!executor.awaitTermination(seconds, TimeUnit.SECONDS)) { logger.warn("Some tasks didn't finish within maximum wait time ({} seconds)", seconds); } } else { while (!executor.awaitTermination(24, TimeUnit.HOURS)) ; } }
Source:
private TaskRepository createRepository(Attributes attributes) { String kind = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); String url = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_URL)); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { return new TaskRepository(kind, url); } return null; }

Target:
private TaskRepository createRepository(Attributes attributes) { String kind = attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND); String url = attributes.getValue(IRepositoryConstants.PROPERTY_URL); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { return new TaskRepository(kind, url); } return null; }
Source:
protected void executeCommand() { GlusterVolumeEntity volume = getDbFacade().getGlusterVolumeDao().getById(snapshot.getVolumeId()); VDSReturnValue retVal = runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, new GlusterVolumeCreateSnapshotVDSParameters(upServer.getId(), volume.getName(), snapshot.getSnapshotName(), snapshot.getDescription(), force)); setSucceeded(retVal.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, retVal.getVdsError().getMessage()); } else { GlusterVolumeSnapshotEntity createdSnapshot = (GlusterVolumeSnapshotEntity)(retVal.getReturnValue()); createdSnapshot.setClusterId(volume.getClusterId()); createdSnapshot.setVolumeId(volume.getId()); createdSnapshot.setDescription(snapshot.getDescription()); createdSnapshot.setSnapshotName(snapshot.getSnapshotName()); createdSnapshot.setCreatedAt(new Date()); createdSnapshot.setStatus(GlusterSnapshotStatus.ACTIVATED); getDbFacade().getGlusterVolumeSnapshotDao().save(createdSnapshot); } addCustomValue(GlusterConstants.VOLUME_SNAPSHOT_NAME, getParameters().getSnapshot().getSnapshotName()); }

Target:
protected void executeCommand() { VDSReturnValue retVal = runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, new GlusterVolumeCreateSnapshotVDSParameters(upServer.getId(), volume.getName(), snapshot.getSnapshotName(), snapshot.getDescription(), force)); setSucceeded(retVal.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, retVal.getVdsError().getMessage()); } else { GlusterVolumeSnapshotEntity createdSnapshot = getParameters().getSnapshot(); createdSnapshot.setSnapshotId(((GlusterVolumeSnapshotEntity) retVal.getReturnValue()).getSnapshotId()); createdSnapshot.setCreatedAt(new Date()); createdSnapshot.setStatus(GlusterSnapshotStatus.STARTED); getDbFacade().getGlusterVolumeSnapshotDao().save(createdSnapshot); } }
Source:
public ActiveListItem deleteActiveListItem(ActiveListItem item) throws DAOException { sessionFactory.getCurrentSession().delete(item); return null; }

Target:
public void deleteActiveListItem(ActiveListItem item) throws DAOException { sessionFactory.getCurrentSession().delete(item); }
Source:
public void init(ConfigurationContext configurationContext, TransportOutDescription transportOutDescription) { LOG.info("init"); HttpWsConnectorFactory httpWsConnectorFactory = new DefaultHttpWsConnectorFactory(); SenderConfiguration senderConfiguration = new SenderConfiguration(); ConnectionManager connectionManager = new ConnectionManager(senderConfiguration.getPoolConfiguration()); clientConnector = httpWsConnectorFactory .createHttpClientConnector(new HashMap<>(), senderConfiguration, connectionManager); workerPool = WorkerPoolFactory.getWorkerPool( BridgeConstants.DEFAULT_WORKER_POOL_SIZE_CORE, BridgeConstants.DEFAULT_WORKER_POOL_SIZE_MAX, BridgeConstants.DEFAULT_WORKER_THREAD_KEEPALIVE_SEC, BridgeConstants.DEFAULT_WORKER_POOL_QUEUE_LENGTH, BridgeConstants.HTTP_WORKER_THREAD_GROUP_NAME, BridgeConstants.HTTP_WORKER_THREAD_ID); }

Target:
public void init(ConfigurationContext configurationContext, TransportOutDescription transportOutDescription) { LOG.info("Initializing AxisToClientConnectorBridge"); HttpWsConnectorFactory httpWsConnectorFactory = new DefaultHttpWsConnectorFactory(); SenderConfiguration senderConfiguration = new SenderConfiguration(); ConnectionManager connectionManager = new ConnectionManager(senderConfiguration.getPoolConfiguration()); clientConnector = httpWsConnectorFactory .createHttpClientConnector(new HashMap<>(), senderConfiguration, connectionManager); workerPool = WorkerPoolFactory.getWorkerPool( BridgeConstants.DEFAULT_WORKER_POOL_SIZE_CORE, BridgeConstants.DEFAULT_WORKER_POOL_SIZE_MAX, BridgeConstants.DEFAULT_WORKER_THREAD_KEEPALIVE_SEC, BridgeConstants.DEFAULT_WORKER_POOL_QUEUE_LENGTH, BridgeConstants.HTTP_WORKER_THREAD_GROUP_NAME, BridgeConstants.HTTP_WORKER_THREAD_ID); }