auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static FeedItem createFeedItem(File f, Feed whichFeed) { long globalId = 0; Date date = new Date(); FeedItem item = new FeedItem(globalId, f.getName(), "item" + Long.toString(date.getTime()), f.toString(), date, FeedItem.UNPLAYED, whichFeed); item.setAutoDownload(false); long duration = getFileDuration(f); long size = f.length(); FeedMedia media = new FeedMedia(0, item, (int)duration, 0, size, "audio/mp3", f.getAbsolutePath(), f.getAbsolutePath(), true, null, 0, 0); item.setMedia(media); return item; }

Target:
private static FeedItem createFeedItem(File f, Feed whichFeed) { long globalId = 0; Date date = new Date(); String uuid = UUID.randomUUID().toString(); FeedItem item = new FeedItem(globalId, f.getName(), uuid, f.toString(), date, FeedItem.UNPLAYED, whichFeed); item.setAutoDownload(false); long duration = getFileDuration(f); long size = f.length(); String absPath = f.getAbsolutePath(); FeedMedia media = new FeedMedia(0, item, (int)duration, 0, size, getMimeType(absPath), absPath, absPath, true, null, 0, 0); item.setMedia(media); return item; }
Source:
public ArrayInterface setBlob(int index, Blob value) { return setObject(index, value); }

Target:
public Array setBlob(int index, Blob value) { return setObject(index, value); }
Source:
void clearStates() { exceptionOnEncryption = new AtomicReference<>(); exceptionOnDecryption = new AtomicReference<>(); }

Target:
void clearStates() { exceptionOnEncryption.set(null); exceptionOnDecryption.set(null); }
Source:
public void searchMethodsExist() throws Exception { context.turnOffAuthorisationSystem(); getClient().perform(get("/api/core/metadatafields")) .andExpect(jsonPath("$._links.search.href", notNullValue())); getClient().perform(get("/api/core/metadatafields/search")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.bySchema", notNullValue())); }

Target:
public void searchMethodsExist() throws Exception { getClient().perform(get("/api/core/metadatafields")) .andExpect(jsonPath("$._links.search.href", notNullValue())); getClient().perform(get("/api/core/metadatafields/search")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.bySchema", notNullValue())); }
Source:
public String retryOrAbortStatus(Integer failureCount) { if (failureCount < maxRetries) { return RETRYING; } return ABORTED; }

Target:
public String retryOrAbortStatus(Integer failureCount) { if (failureCount < maxRetries) { return DeliveryStatuses.RETRYING; } return DeliveryStatuses.ABORTED; }
Source:
public void onClose(Status status, Metadata trailers) { if (status == Status.UNAUTHENTICATED) { LOG.warn("Got unauthenticated response from server, revoking the current token"); revokeUnauthToken(origToken); } super.onClose(status, trailers); }

Target:
public void onClose(Status status, Metadata trailers) { if (status == Status.UNAUTHENTICATED) { revokeUnauthToken(origToken); } super.onClose(status, trailers); }
Source:
public void updateAllInTransaction(List<VmNetworkStatistics> vmInterfaceStatisticsToSave) { updateAllInBatch("updatevm_interface_statistics", vmInterfaceStatisticsToSave, new MapSqlParameterMapper<VmNetworkStatistics>() { @Override public MapSqlParameterSource map(VmNetworkStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource(); paramValue.addValue("id", entity.getId()); paramValue.addValue("rx_drop", entity.getReceiveDropRate()); paramValue.addValue("rx_rate", entity.getReceiveRate()); paramValue.addValue("tx_drop", entity.getTransmitDropRate()); paramValue.addValue("tx_rate", entity.getTransmitRate()); paramValue.addValue("iface_status", entity.getStatus()); paramValue.addValue("vm_id", entity.getVmId()); return paramValue; } }); }

Target:
public void updateAllInTransaction(List<VmNetworkStatistics> vmInterfaceStatisticsToSave) { updateAllInBatch("updatevm_interface_statistics", vmInterfaceStatisticsToSave, new MapSqlParameterMapper<VmNetworkStatistics>() { @Override public MapSqlParameterSource map(VmNetworkStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource() .addValue("id", entity.getId()) .addValue("rx_drop", entity.getReceiveDropRate()) .addValue("rx_rate", entity.getReceiveRate()) .addValue("tx_drop", entity.getTransmitDropRate()) .addValue("tx_rate", entity.getTransmitRate()) .addValue("iface_status", entity.getStatus()) .addValue("vm_id", entity.getVmId()); return paramValue; } }); }
Source:
void rankIndexSearchApply(AbstractPlanNode plan) { if ( ! (plan instanceof IndexScanPlanNode) ) { return; } IndexScanPlanNode indexscan = (IndexScanPlanNode)plan; if (indexscan.getPredicate() != null || indexscan.getEndExpression() != null || indexscan.getSkipNullPredicate() != null || indexscan.getInitialExpression() != null) { return; } if (indexscan.getInlinePlanNodes().isEmpty()) { return; } LimitPlanNode limit = (LimitPlanNode) indexscan.getInlinePlanNodes().get(PlanNodeType.LIMIT); if (limit == null || !limit.hasOffset()) { return; } Index index = indexscan.getCatalogIndex(); if (! index.getCountable()) { return; } if (! indexscan.getSearchKeyExpressions().isEmpty()) { return; } indexscan.setOffsetRank(true); }

Target:
void rankIndexSearchApply(AbstractPlanNode plan) { if ( ! (plan instanceof IndexScanPlanNode) ) { return; } IndexScanPlanNode indexscan = (IndexScanPlanNode)plan; if (indexscan.getPredicate() != null || indexscan.getEndExpression() != null || indexscan.getSkipNullPredicate() != null || indexscan.getInitialExpression() != null) { return; } if (indexscan.getInlinePlanNodes().isEmpty()) { return; } LimitPlanNode limit = (LimitPlanNode) indexscan.getInlinePlanNodes().get(PlanNodeType.LIMIT); if (limit == null || !limit.hasOffset()) { return; } if (AggregatePlanNode.getInlineAggregationNode(indexscan) != null) { return; } Index index = indexscan.getCatalogIndex(); if (! index.getCountable()) { return; } if (! indexscan.getSearchKeyExpressions().isEmpty()) { return; } indexscan.setOffsetRank(true); }
Source:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); NetworkView network = getSelectedItem(); if (network == null || !network.isExternal()) { externalSubnetListModel.setIsAvailable(false); } else { AsyncDataProvider.getInstance().getProviderById( new AsyncQuery<>(provider -> externalSubnetListModel.setIsAvailable(!provider.getIsUnmanaged())), network.getProvidedBy().getProviderId()); } }

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); NetworkView network = getSelectedItem(); if (network == null || !network.isExternal()) { externalSubnetListModel.setIsAvailable(false); } else { AsyncDataProvider.getInstance().getProviderById( new AsyncQuery<>(provider -> { boolean available = provider != null ? !provider.getIsUnmanaged() : false; externalSubnetListModel.setIsAvailable(available); }), network.getProvidedBy().getProviderId()); } }
Source:
public BaseProfitBricksRequestBinder(String paramName) { this.paramName = checkNotNull(paramName, "Initialize 'paramName' in constructor"); }

Target:
protected BaseProfitBricksRequestBinder(String paramName) { this.paramName = checkNotNull(paramName, "Initialize 'paramName' in constructor"); }
Source:
private PointSensitivityBuilder calculateRateSensitivity() { PointSensitivityBuilder combinedPointSensitivity = PointSensitivityBuilder.none(); double factor = pastCompositionFactor() * valuationCompositionFactor() / accrualFactorTotal; ObjectDoublePair<PointSensitivityBuilder> compositionFactorAndSensitivityNonCutoff = compositionFactorAndSensitivityNonCutoff(); ObjectDoublePair<PointSensitivityBuilder> compositionFactorAndSensitivityCutoff = compositionFactorAndSensitivityCutoff(); combinedPointSensitivity = combinedPointSensitivity.combinedWith(compositionFactorAndSensitivityNonCutoff .getFirst().multipliedBy(compositionFactorAndSensitivityCutoff.getSecond())); combinedPointSensitivity = combinedPointSensitivity.combinedWith(compositionFactorAndSensitivityCutoff .getFirst().multipliedBy(compositionFactorAndSensitivityNonCutoff.getSecond())); combinedPointSensitivity = combinedPointSensitivity.multipliedBy(factor); return combinedPointSensitivity; }

Target:
private PointSensitivityBuilder calculateRateSensitivity() { double factor = pastCompositionFactor() * valuationCompositionFactor() / accrualFactorTotal; ObjectDoublePair<PointSensitivityBuilder> compositionFactorAndSensitivityNonCutoff = compositionFactorAndSensitivityNonCutoff(); ObjectDoublePair<PointSensitivityBuilder> compositionFactorAndSensitivityCutoff = compositionFactorAndSensitivityCutoff(); PointSensitivityBuilder combinedPointSensitivity = compositionFactorAndSensitivityNonCutoff.getFirst(). multipliedBy(compositionFactorAndSensitivityCutoff.getSecond() * factor); combinedPointSensitivity = combinedPointSensitivity.combinedWith(compositionFactorAndSensitivityCutoff .getFirst().multipliedBy(compositionFactorAndSensitivityNonCutoff.getSecond() * factor)); return combinedPointSensitivity; }
Source:
public void repairHand(User user) throws Exception { final ItemStack item = user.getBase().getInventory().getItemInMainHand(); if (item == null || item.getType().isBlock() || item.getDurability() == 0) { throw new Exception(tl("repairInvalidType")); } if (!item.getEnchantments().isEmpty() && !ess.getSettings().getRepairEnchanted() && !user.isAuthorized("essentials.repair.enchanted")) { throw new Exception(tl("repairEnchanted")); } final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH); final Trade charge = getCharge(item.getType()); charge.isAffordableFor(user); repairItem(item); charge.charge(user); user.getBase().updateInventory(); user.sendMessage(tl("repair", itemName.replace('_', ' '))); }

Target:
public void repairHand(User user) throws Exception { final ItemStack item = user.getItemInHand(); if (item == null || item.getType().isBlock() || item.getDurability() == 0) { throw new Exception(tl("repairInvalidType")); } if (!item.getEnchantments().isEmpty() && !ess.getSettings().getRepairEnchanted() && !user.isAuthorized("essentials.repair.enchanted")) { throw new Exception(tl("repairEnchanted")); } final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH); final Trade charge = getCharge(item.getType()); charge.isAffordableFor(user); repairItem(item); charge.charge(user); user.getBase().updateInventory(); user.sendMessage(tl("repair", itemName.replace('_', ' '))); }
Source:
public void showImages(List<PostImage> images, int position, Loadable loadable) { MultiImageView.Mode newMode; if(this.images.size() < 1) { newMode = MultiImageView.Mode.LOWRES; } else { newMode = callback.getImageMode(getCurrentPostImage()); } this.images.addAll(images); this.selectedPosition = position; this.loadable = loadable; this.progress = new ArrayList<>(this.images.size()); for (int i = 0; i < this.images.size(); i++) { this.progress.add(i, -1f); } callback.setPagerItems(this.images, selectedPosition); callback.setImageMode(this.images.get(selectedPosition), newMode); }

Target:
public void showImages(List<PostImage> images, int position, Loadable loadable) { MultiImageView.Mode newMode; if(this.images.isEmpty()) { newMode = MultiImageView.Mode.LOWRES; } else { newMode = callback.getImageMode(getCurrentPostImage()); } this.images.addAll(images); this.selectedPosition = position; this.loadable = loadable; progress = new ArrayList<>(this.images.size()); for (int i = 0; i < this.images.size(); i++) { progress.add(i, -1f); } callback.setPagerItems(this.images, selectedPosition); callback.setImageMode(this.images.get(selectedPosition), newMode); }
Source:
@Test public void shouldOpenCompareEditorInWorksaceModel() throws Exception { resetRepository(PROJ1); createTag(PROJ1, "compare2"); changeFilesInProject(); showDialog(PROJ1, "Team", "Synchronize..."); bot.shell("Synchronize repository: " + REPO1 + File.separator + ".git") .activate(); bot.comboBox(2) .setSelection(UIText.SynchronizeWithAction_tagsName); bot.comboBox(3).setSelection("compare2"); bot.button(IDialogConstants.OK_LABEL).click(); SWTBotView syncView = bot.viewByTitle("Synchronize"); syncView.toolbarDropDownButton("Show File System Resources").click() .menuItem("Workspace").click(); SWTBotTree syncViewTree = syncView.bot().tree(); syncViewTree.getAllItems()[0].collapse().doubleClick(); syncViewTree.getAllItems()[0].getNode(FOLDER).getNode(FILE1) .doubleClick(); SWTBot compare = bot.editorByTitle(FILE1).bot(); assertNotNull(compare); }

Target:
@Test public void shouldOpenCompareEditorInWorksaceModel() throws Exception { resetRepository(PROJ1); createTag(PROJ1, "compare2"); changeFilesInProject(); showDialog(PROJ1, "Team", "Synchronize..."); bot.shell("Synchronize repository: " + REPO1 + File.separator + ".git") .activate(); bot.comboBox(2) .setSelection(UIText.SynchronizeWithAction_tagsName); bot.comboBox(3).setSelection("compare2"); bot.button(IDialogConstants.OK_LABEL).click(); SWTBotView syncView = bot.viewByTitle("Synchronize"); syncView.toolbarDropDownButton("Show File System Resources").click() .menuItem("Workspace").click(); SWTBotTree syncViewTree = syncView.bot().tree(); syncViewTree.getAllItems()[0].expand().getItems()[0].expand() .getItems()[0].doubleClick(); SWTBot compare = bot.editorByTitle(FILE1).bot(); assertNotNull(compare); }
Source:
protected void setupInternals() throws IOException { if (getObjectDirectory() == null) { if (getGitCommonDir() != null) setObjectDirectory( safeFS().resolve(getGitCommonDir(), OBJECTS)); else if (getGitDir() != null) setObjectDirectory(safeFS().resolve(getGitDir(), OBJECTS)); } }

Target:
protected void setupInternals() throws IOException { if (getObjectDirectory() == null) { if (getGitCommonDir() != null) { setObjectDirectory( safeFS().resolve(getGitCommonDir(), OBJECTS)); } else if (getGitDir() != null) { setObjectDirectory(safeFS().resolve(getGitDir(), OBJECTS)); } } }
Source:
public static HostController create(final File jbossHomeDir, final ModuleLoader moduleLoader, final Properties systemProps, final Map<String, String> systemEnv, final String[] cmdargs) { assert jbossHomeDir != null : "jbossHomeDir is null"; assert moduleLoader != null : "moduleLoader is null"; assert systemProps != null : "systemProps is null"; assert systemEnv != null : "systemEnv is null"; assert cmdargs != null : "cmdargs is null"; setupCleanDirectories(jbossHomeDir, systemProps); return new HostControllerImpl(jbossHomeDir, cmdargs, systemProps, systemEnv, moduleLoader); }

Target:
public static HostController create(final File jbossHomeDir, final ModuleLoader moduleLoader, final Properties systemProps, final Map<String, String> systemEnv, final String[] cmdargs) { if (jbossHomeDir == null) throw EmbeddedLogger.ROOT_LOGGER.nullVar("jbossHomeDir"); if (moduleLoader == null) throw EmbeddedLogger.ROOT_LOGGER.nullVar("moduleLoader"); if (systemProps == null) throw EmbeddedLogger.ROOT_LOGGER.nullVar("systemProps"); if (systemEnv == null) throw EmbeddedLogger.ROOT_LOGGER.nullVar("systemEnv"); if (cmdargs == null) throw EmbeddedLogger.ROOT_LOGGER.nullVar("cmdargs"); setupCleanDirectories(jbossHomeDir, systemProps); return new HostControllerImpl(jbossHomeDir, cmdargs, systemProps, systemEnv, moduleLoader); }
Source:
public void testFlatten() { Properties prop1 = new Properties(); prop1.put("key1", "value1"); Properties prop2 = new Properties(prop1); prop2.put("key2", "value2"); Properties prop3 = new Properties(prop2); prop3.put("key3", "value3"); Properties flattened = flatten(prop3); Assert.assertEquals(flattened.get("key1"), prop3.getProperty("key1")); Assert.assertEquals(flattened.get("key2"), prop3.getProperty("key2")); Assert.assertEquals(flattened.get("key3"), prop3.getProperty("key3")); Assert.assertNotEquals(flattened.get("key1"), prop3.get("key1")); Assert.assertNotEquals(flattened.get("key2"), prop3.get("key2")); Assert.assertEquals(flattened.get("key3"), prop3.get("key3")); Assert.assertEquals(flattened.get("key1"), "value1"); Assert.assertEquals(flattened.get("key2"), "value2"); Assert.assertEquals(flattened.get("key3"), "value3"); }

Target:
public void testFlatten() { Properties prop1 = new Properties(); prop1.put("key1", "value1"); Properties prop2 = new Properties(prop1); prop2.put("key2", "value2"); Properties prop3 = new Properties(prop2); prop3.put("key3", "value3"); Properties flattened = flatten(prop3); Assert.assertEquals(flattened.get("key1"), "value1"); Assert.assertEquals(flattened.get("key2"), "value2"); Assert.assertEquals(flattened.get("key3"), "value3"); }
Source:
public void setStartDate(Date startDate) { this.startDate = endDate != null ? (Date) startDate.clone() : null; }

Target:
public void setStartDate(Date startDate) { this.startDate = startDate != null ? new Date(startDate.getTime()) : null; }
Source:
public void shutdown() { LOGGER.entering(); running = false; proxyLogger.fine("Interrupting NodeRecycleThread."); interrupt(); LOGGER.exiting(); }

Target:
public void shutdown() { LOGGER.entering(); running = false; proxyLogger.fine("Shutting down NodeRecycleThread for node " + nodeId); interrupt(); LOGGER.exiting(); }
Source:
public List<StudentProfile> getStudentProfileEntities() { Query q = getPm().newQuery(StudentProfile.class); return (List<StudentProfile>) q.execute(); }

Target:
private List<StudentProfile> getStudentProfileEntities() { Query q = getPm().newQuery(StudentProfile.class); return (List<StudentProfile>) q.execute(); }
Source:
private boolean checkSumsHolder(DiscreteNaiveBayesSumsHolder holder1, DiscreteNaiveBayesSumsHolder holder2) { if (holder1 == null || holder2 == null) { return false; } Optional<long[][]> optinalFirst = holder1.valuesInBucketPerLbl.values().stream().findFirst(); Optional<long[][]> optinalSecond = holder2.valuesInBucketPerLbl.values().stream().findFirst(); if (optinalFirst.isPresent()) { if (optinalSecond.isPresent()) { return optinalFirst.get().length == optinalSecond.get().length; } else { return false; } } else { return !optinalSecond.isPresent(); } }

Target:
private boolean checkSumsHolder(DiscreteNaiveBayesSumsHolder holder1, DiscreteNaiveBayesSumsHolder holder2) { if (holder1 == null || holder2 == null) { return false; } Optional<long[][]> optionalFirst = holder1.valuesInBucketPerLbl.values().stream().findFirst(); Optional<long[][]> optionalSecond = holder2.valuesInBucketPerLbl.values().stream().findFirst(); if (optionalFirst.isPresent()) { if (optionalSecond.isPresent()) { return optionalFirst.get().length == optionalSecond.get().length; } else { return false; } } else { return !optionalSecond.isPresent(); } }
Source:
protected FSDataOutputStream openStreamInAppendMode(Path filepath) { FSDataOutputStream fsOutput = null; try { fsOutput = fs.append(filepath); } catch (IOException e) { if (e.getMessage().contains("Not supported")) { fsOutput = openStreamForNonAppendFS(filepath); } } return fsOutput; }

Target:
protected FSDataOutputStream openStreamInAppendMode(Path filepath) { FSDataOutputStream fsOutput = null; try { fsOutput = fs.append(filepath); } catch (IOException e) { if (e.getMessage().equals("Not supported")) { fsOutput = openStreamForNonAppendFS(filepath); } } return fsOutput; }
Source:
private List<JBPMProcessModel> findModels(final Path path, final Predicate<Definitions> filter) { Path rootPath = moduleService.resolveModule(path).getRootPath(); return VFSScanner.scan(ioService, Paths.convert(rootPath), ResourceType.getResourceType("BPMN2").getAllExtensions(), this::toDefinitions, filter) .stream() .filter(Objects::nonNull) .map(VFSScanner.ScanResult::getResource) .map(definitions -> parseToModel(definitions, path)) .collect(Collectors.toList()); }

Target:
private Stream<JBPMProcessModel> findModels(final Path path, final Predicate<Definitions> filter) { Path rootPath = moduleService.resolveModule(path).getRootPath(); return VFSScanner.scan(ioService, Paths.convert(rootPath), ResourceType.getResourceType("BPMN2").getAllExtensions(), this::toDefinitions, filter) .stream() .filter(Objects::nonNull) .map(VFSScanner.ScanResult::getResource) .map(definitions -> parseToModel(definitions, path)); }
Source:
protected FirebaseRecyclerAdapter<Chat, ChatHolder> getAdapter() { return new FirebaseRecyclerAdapter<Chat, ChatHolder>( new FirebaseIndexArray<>( mChatIndicesRef.limitToLast(50), mChatRef, new ClassSnapshotParser<>(Chat.class)), R.layout.message, ChatHolder.class, this) { @Override public void populateViewHolder(ChatHolder holder, Chat chat, int position) { holder.bind(chat); } @Override public void onDataChanged() { mEmptyListMessage.setVisibility(getItemCount() == 0 ? View.VISIBLE : View.GONE); } }; }

Target:
protected FirebaseRecyclerAdapter<Chat, ChatHolder> getAdapter() { return new FirebaseIndexRecyclerAdapter<Chat, ChatHolder>( Chat.class, R.layout.message, ChatHolder.class, mChatIndicesRef.limitToLast(50), mChatRef, this) { @Override public void populateViewHolder(ChatHolder holder, Chat chat, int position) { holder.bind(chat); } @Override public void onDataChanged() { mEmptyListMessage.setVisibility(getItemCount() == 0 ? View.VISIBLE : View.GONE); } }; }
Source:
public ConfigRenderOptions setComments(boolean value) { if (value == comments) return this; else return new ConfigRenderOptions(originComments, value, formatted, json, new DefaultComparator()); }

Target:
public ConfigRenderOptions setComments(boolean value) { if (value == comments) return this; else return new ConfigRenderOptions(originComments, value, formatted, json, comparator); }
Source:
private static JobInfo waitFor(final long jobId, AlluxioConfiguration alluxioConf) throws InterruptedException { try (final JobMasterClient client = JobMasterClient.Factory.create(JobMasterClientContext .newBuilder(ClientContext.create(alluxioConf)).build())) { JobInfo resultInfo = CommonUtils.waitForResult("Job to finish", ()-> { try { return client.getJobStatus(jobId); } catch (Exception e) { LOG.warn("Failed to get status for job (jobId={})", jobId, e); return null; } }, (jobInfo) -> { if (jobInfo != null) { switch (jobInfo.getStatus()) { case FAILED: case CANCELED: case COMPLETED: return true; case RUNNING: case CREATED: return false; default: throw new IllegalStateException("Unrecognized job status: " + jobInfo.getStatus()); } } return true; }, WaitForOptions.defaults().setInterval(1000)); if (resultInfo != null) { resultInfo = client.getJobStatusDetailed(resultInfo.getId()); } return resultInfo; } catch (IOException e) { LOG.warn("Failed to close job master client: {}", e.toString()); return null; } catch (TimeoutException e) { throw new IllegalStateException(e); } }

Target:
private static JobInfo waitFor(final long jobId, AlluxioConfiguration alluxioConf) throws InterruptedException { try (final JobMasterClient client = JobMasterClient.Factory.create(JobMasterClientContext .newBuilder(ClientContext.create(alluxioConf)).build())) { return CommonUtils.waitForResult("Job to finish", ()-> { try { return client.getJobStatus(jobId); } catch (Exception e) { LOG.warn("Failed to get status for job (jobId={})", jobId, e); return null; } }, (jobInfo) -> { if (jobInfo != null) { switch (jobInfo.getStatus()) { case FAILED: case CANCELED: case COMPLETED: return true; case RUNNING: case CREATED: return false; default: throw new IllegalStateException("Unrecognized job status: " + jobInfo.getStatus()); } } return true; }, WaitForOptions.defaults().setInterval(1000)); } catch (IOException e) { LOG.warn("Failed to close job master client: {}", e.toString()); return null; } catch (TimeoutException e) { throw new IllegalStateException(e); } }
Source:
public void testBroadcastCorrelatedSubqueryAvoidsRemoteExchangeBeforeAggregation() { Session broadcastJoin = Session.builder(this.getQueryRunner().getDefaultSession()) .setSystemProperty(DISTRIBUTED_JOIN, Boolean.toString(false)) .setSystemProperty(FORCE_SINGLE_NODE_OUTPUT, Boolean.toString(false)) .build(); PlanMatchPattern joinBuildSideWithRemoteExchange = anyTree( node(JoinNode.class, anyTree( node(TableScanNode.class)), anyTree( exchange(REMOTE, ExchangeNode.Type.REPLICATE, anyTree( node(TableScanNode.class)))))); Consumer<Plan> validateSingleRemoteExchange = plan -> assertEquals( countOfMatchingNodes( plan, node -> node instanceof ExchangeNode && ((ExchangeNode) node).getScope() == REMOTE), 1); Consumer<Plan> validateSingleAggregation = plan -> assertEquals( countOfMatchingNodes( plan, node -> node instanceof AggregationNode && ((AggregationNode) node).getGroupingKeys().contains(new Symbol("unique"))), 1); assertPlanWithSession( "SELECT (SELECT count(*) FROM region r2 WHERE r2.regionkey > r1.regionkey) FROM region r1", broadcastJoin, false, joinBuildSideWithRemoteExchange, validateSingleRemoteExchange.andThen(validateSingleAggregation)); assertPlanWithSession( "SELECT count(count) " + "FROM (SELECT o1.orderkey orderkey, (SELECT count(*) FROM orders o2 WHERE o2.orderkey > o1.orderkey) count FROM orders o1) " + "GROUP BY orderkey", broadcastJoin, false, joinBuildSideWithRemoteExchange, validateSingleRemoteExchange.andThen(validateSingleAggregation)); }

Target:
public void testBroadcastCorrelatedSubqueryAvoidsRemoteExchangeBeforeAggregation() { Session broadcastJoin = Session.builder(this.getQueryRunner().getDefaultSession()) .setSystemProperty(DISTRIBUTED_JOIN, Boolean.toString(false)) .setSystemProperty(FORCE_SINGLE_NODE_OUTPUT, Boolean.toString(false)) .build(); PlanMatchPattern joinBuildSideWithRemoteExchange = anyTree( node(JoinNode.class, anyTree( node(TableScanNode.class)), anyTree( exchange(REMOTE, ExchangeNode.Type.REPLICATE, anyTree( node(TableScanNode.class)))))); Consumer<Plan> validateSingleRemoteExchange = plan -> assertEquals( countOfMatchingNodes( plan, node -> node instanceof ExchangeNode && ((ExchangeNode) node).getScope() == REMOTE), 1); Consumer<Plan> validateSingleStreamingAggregation = plan -> assertEquals( countOfMatchingNodes( plan, node -> node instanceof AggregationNode && ((AggregationNode) node).getGroupingKeys().contains(new Symbol("unique")) && ((AggregationNode) node).isStreamable()), 1); assertPlanWithSession( "SELECT (SELECT count(*) FROM region r2 WHERE r2.regionkey > r1.regionkey) FROM region r1", broadcastJoin, false, joinBuildSideWithRemoteExchange, validateSingleRemoteExchange.andThen(validateSingleStreamingAggregation)); assertPlanWithSession( "SELECT count(count) " + "FROM (SELECT o1.orderkey orderkey, (SELECT count(*) FROM orders o2 WHERE o2.orderkey > o1.orderkey) count FROM orders o1) " + "GROUP BY orderkey", broadcastJoin, false, joinBuildSideWithRemoteExchange, validateSingleRemoteExchange.andThen(validateSingleStreamingAggregation)); }
Source:
public void editBuffersPerSlice() throws Exception { final int value = 10; ModelNodeResult modelNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFERS_PER_SLICE); modelNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFERS_PER_SLICE, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(BUFFERS_PER_SLICE, value); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFERS_PER_SLICE, modelNodeResult.value()); } }

Target:
public void editBuffersPerSlice() throws Exception { final int value = 10; final ModelNodeResult originalNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFERS_PER_SLICE); originalNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFERS_PER_SLICE, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(BUFFERS_PER_SLICE, value); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFERS_PER_SLICE, originalNodeResult.value()); } }
Source:
private Entity buildMandateConnectorRequestPayload(MandateConnectorRequest requestPayload) { JsonStringBuilder jsonStringBuilder = new JsonStringBuilder() .add(MandateConnectorRequest.RETURN_URL_FIELD_NAME, requestPayload.getReturnUrl()) .add(MandateConnectorRequest.AGREEMENT_TYPE_FIELD_NAME, requestPayload.getAgreementType().toString()); if (isNotBlank(requestPayload.getServiceReference())) { jsonStringBuilder.add(MandateConnectorRequest.SERVICE_REFERENCE_FIELD_NAME, requestPayload.getServiceReference()); } return json(jsonStringBuilder.build()); }

Target:
private Entity buildMandateConnectorRequestPayload(MandateConnectorRequest requestPayload) { JsonStringBuilder jsonStringBuilder = new JsonStringBuilder() .add(MandateConnectorRequest.RETURN_URL_FIELD_NAME, requestPayload.getReturnUrl()) .add(MandateConnectorRequest.AGREEMENT_TYPE_FIELD_NAME, requestPayload.getAgreementType()); if (isNotBlank(requestPayload.getServiceReference())) { jsonStringBuilder.add(MandateConnectorRequest.SERVICE_REFERENCE_FIELD_NAME, requestPayload.getServiceReference()); } return json(jsonStringBuilder.build()); }
Source:
void initialiseLockManager() { lockManager.init( new LockTarget( currentPath, parent.getView().asWidget(), placeRequest, new LockTarget.TitleProvider() { @Override public String getTitle() { return currentPath.getFileName() + " - " + resourceType.getDescription(); } }, new Runnable() { @Override public void run() { } } ), parent ); }

Target:
void initialiseLockManager() { lockManager.init( new LockTarget( currentPath, parent.getView().asWidget(), placeRequest, () -> currentPath.getFileName() + " - " + resourceType.getDescription(), () -> { } ), parent ); }
Source:
public void setUp() throws MalformedURLException { base = new URL("http://localhost:" + port); }

Target:
public void setUp() throws Exception { base = new URL("http://localhost:" + port); }
Source:
public SearchResults search(String searchText) throws IOException { SearchResults results = new SearchResults(searchText); try { StringBuilder sb = new StringBuilder(); String encodedSearch = URLEncoder.encode(searchText, "UTF-8"); String request = "<LINK_0>" + Runtime.getInstance().getLocaleTag() + "&q=" + encodedSearch + "&aqs=chrome..69i57.5547j0j7&sourceid=chrome&ie=UTF-8"; Document doc = Jsoup.connect(request).userAgent(USER_AGENT).get(); if (saveSearchToFile) { FileOutputStream fos = new FileOutputStream(getDataDir() + fs + encodedSearch + ".html"); fos.write(doc.toString().getBytes()); fos.close(); } for (Element header : doc.select("h2")) { String title = header.text(); if (title.equals("Description")) { Element parent = header.parent(); Elements spans = parent.select("span"); for (Element span : spans) { log.info("description - ", span.text()); String text = null; if (lowerCase != null && lowerCase) { text = span.text().toLowerCase(); } else if (lowerCase != null && !lowerCase) { text = span.text().toUpperCase(); } for (String filter : excludeTextFilter) { text = text.replace(filter.toLowerCase(), ""); } sb.append(text); results.text.add(text); } } } invoke("publishText", sb.toString()); results.images = imageSearch(searchText); invoke("publishResults", results); } catch (Exception e) { results.errorText = e.getMessage(); error(e); } return results; }

Target:
public SearchResults search(String searchText) throws IOException { SearchResults results = new SearchResults(searchText); try { StringBuilder sb = new StringBuilder(); String encodedSearch = URLEncoder.encode(searchText, "UTF-8"); String request = "<LINK_0>" + locale.getTag() + "&q=" + encodedSearch + "&aqs=chrome..69i57.5547j0j7&sourceid=chrome&ie=UTF-8"; Document doc = Jsoup.connect(request).userAgent(USER_AGENT).get(); if (saveSearchToFile) { FileOutputStream fos = new FileOutputStream(getDataDir() + fs + encodedSearch + ".html"); fos.write(doc.toString().getBytes()); fos.close(); } for (Element header : doc.select("h2")) { String title = header.text(); if (title.equals("Description")) { Element parent = header.parent(); Elements spans = parent.select("span"); for (Element span : spans) { log.info("description - ", span.text()); String text = null; if (lowerCase != null && lowerCase) { text = span.text().toLowerCase(); } else if (lowerCase != null && !lowerCase) { text = span.text().toUpperCase(); } for (String filter : excludeTextFilter) { text = text.replace(filter.toLowerCase(), ""); } sb.append(text); results.text.add(text); } } } invoke("publishText", sb.toString()); results.images = imageSearch(searchText); invoke("publishResults", results); } catch (Exception e) { results.errorText = e.getMessage(); error(e); } return results; }
Source:
protected void run(Registration registration, String executionCourseId) throws FenixServiceException { ServiceMonitoring.logService(this.getClass(), registration, executionCourseId); if (registration == null) { throw new FenixServiceException("error.registration.not.exist"); } ExecutionCourse executionCourse = readExecutionCourse(executionCourseId); for (Registration registration2 : registration.getStudent().getAllRegistrations()) { if (!registration.getExternalId().equals(registration2.getExternalId()) && registration2.attends(executionCourse)) { throw new FenixServiceException("error.registration.executionCourse.alreadyAttends"); } } registration.addAttendsTo(executionCourse); }

Target:
protected void run(Registration registration, String executionCourseId) throws FenixServiceException { ServiceMonitoring.logService(this.getClass(), registration, executionCourseId); if (registration == null) { throw new FenixServiceException("error.registration.not.exist"); } ExecutionCourse executionCourse = readExecutionCourse(executionCourseId); if (registration.getStudent().getRegistrationStream().filter(r -> !r.equals(registration)).anyMatch(r -> r.attends(executionCourse))) { throw new FenixServiceException("error.registration.executionCourse.alreadyAttends"); } registration.addAttendsTo(executionCourse); }
Source:
private void parseDelete(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); String refName = ctl.getRefName(); if (refName.startsWith("refs/changes/")) { errors.put(Error.DELETE_CHANGES, refName); reject(cmd, "cannot delete changes"); } else if (ctl.canDelete()) { batch.addCommand(cmd); } else { if (GitRepositoryManager.REF_CONFIG.equals(refName)) { reject(cmd, "cannot delete project configuration"); } else { errors.put(Error.DELETE, ctl.getRefName()); reject(cmd, "cannot delete references"); } } }

Target:
private void parseDelete(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.getRefName().startsWith("refs/changes/")) { errors.put(Error.DELETE_CHANGES, ctl.getRefName()); reject(cmd, "cannot delete changes"); } else if (ctl.canDelete()) { batch.addCommand(cmd); } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { reject(cmd, "cannot delete project configuration"); } else { errors.put(Error.DELETE, ctl.getRefName()); reject(cmd, "cannot delete references"); } } }
Source:
public Image(Device device, String[] filenames) { super(device); if (filenames == null || filenames.length == 0) SWT.error(SWT.ERROR_NULL_ARGUMENT); dpiFilename = filenames; int imageSelectorIndex = device.getImageSelector (); if (imageSelectorIndex > 0 && !DPIUtil.fileExists (filenames [imageSelectorIndex])) { imageSelectorIndex = 0; } initNative (filenames [imageSelectorIndex]); if (this.handle == 0) init(new ImageData (filenames [imageSelectorIndex])); init(); }

Target:
public Image(Device device, String[] filenames) { super(device); if (filenames == null || filenames.length == 0) SWT.error(SWT.ERROR_NULL_ARGUMENT); imageRepFileNames = filenames; int imageSelectorIndex = getImageSelector (); if (imageSelectorIndex > 0 && !DPIUtil.fileExists (filenames [imageSelectorIndex])) { imageSelectorIndex = 0; } initNative (filenames [imageSelectorIndex]); data [imageSelectorIndex] = new ImageData (filenames [imageSelectorIndex]); if (this.handle == 0) init(data [imageSelectorIndex]); init(); }
Source:
public void testGetOrComputeIfAbsentRemovesFault() throws CacheAccessException { final OnHeapStore<String, String> store = newStore(); final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); final CountDownLatch latch3 = new CountDownLatch(1); Thread thread = new Thread(new Runnable() { @Override public void run() { try { try { latch3.await(); } catch (InterruptedException e) { e.printStackTrace(); } store.remove("1"); store.getOrComputeIfAbsent("1", new Function<String, ValueHolder<String>>() { @Override public ValueHolder<String> apply(final String s) { latch2.countDown(); try { latch1.await(); } catch (InterruptedException e) { e.printStackTrace(); } return null; } }); } catch (CacheAccessException e) { e.printStackTrace(); } } }); thread.start(); store.getOrComputeIfAbsent("1", new Function<String, ValueHolder<String>>() { @Override public ValueHolder<String> apply(final String s) { try { latch3.countDown(); latch2.await(); } catch (InterruptedException e) { e.printStackTrace(); } return null; } }); latch1.countDown(); }

Target:
public void testGetOrComputeIfAbsentRemovesFault() throws CacheAccessException { final OnHeapStore<String, String> store = newStore(); final CountDownLatch testCompletionLatch = new CountDownLatch(1); final CountDownLatch threadFaultCompletionLatch = new CountDownLatch(1); final CountDownLatch mainFaultCreationLatch = new CountDownLatch(1); Thread thread = new Thread(new Runnable() { @Override public void run() { try { try { mainFaultCreationLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); } store.remove("1"); store.getOrComputeIfAbsent("1", new Function<String, ValueHolder<String>>() { @Override public ValueHolder<String> apply(final String s) { threadFaultCompletionLatch.countDown(); try { testCompletionLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); } return null; } }); } catch (CacheAccessException e) { e.printStackTrace(); } } }); thread.start(); store.getOrComputeIfAbsent("1", new Function<String, ValueHolder<String>>() { @Override public ValueHolder<String> apply(final String s) { try { mainFaultCreationLatch.countDown(); threadFaultCompletionLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); } return null; } }); testCompletionLatch.countDown(); }
Source:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET == request.getMethod()) { ZooKeeper zk = ZooKeeperClient.newBuilder() .connectString(conf.getZkServers()) .sessionTimeoutMs(conf.getZkTimeout()) .build(); BookieSocketAddress bookieId = null; try { bookieId = AuditorElector.getCurrentAuditor(conf, zk); if (bookieId == null) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("No auditor elected"); return response; } } catch (Exception e) { e.printStackTrace(); response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Exception when get." + e.getMessage()); return response; } response.setCode(HttpServer.StatusCode.OK); response.setBody("Auditor: " + bookieId.getSocketAddress().getAddress().getCanonicalHostName() + "/" + bookieId.getSocketAddress().getAddress().getHostAddress() + ":" + bookieId.getSocketAddress().getPort()); LOG.debug("response body:" + response.getBody()); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be GET method"); return response; } }

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET == request.getMethod()) { BookieSocketAddress bookieId = null; try { bookieId = AuditorElector.getCurrentAuditor(conf, zk); if (bookieId == null) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("No auditor elected"); return response; } } catch (Exception e) { LOG.error("Meet Exception: ", e); response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Exception when get." + e.getMessage()); return response; } response.setCode(HttpServer.StatusCode.OK); response.setBody("Auditor: " + bookieId.getSocketAddress().getAddress().getCanonicalHostName() + "/" + bookieId.getSocketAddress().getAddress().getHostAddress() + ":" + bookieId.getSocketAddress().getPort()); LOG.debug("response body:" + response.getBody()); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be GET method"); return response; } }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); List<InstructorAttributes> instructorsOfCourse = logic.getInstructorsForCourse(courseId); InstructorsData data; String intentStr = getRequestParamValue(Const.ParamsNames.INTENT); if (intentStr == null) { instructorsOfCourse = instructorsOfCourse.stream() .filter(InstructorAttributes::isDisplayedToStudents) .collect(Collectors.toList()); data = new InstructorsData(instructorsOfCourse); data.getInstructors().forEach(i -> { i.setGoogleId(null); i.setJoinState(null); i.setIsDisplayedToStudents(null); i.setRole(null); }); } else if (intentStr.equals(Intent.FULL_DETAIL.toString())) { if (userInfo.isAdmin || logic.getInstructorForGoogleId(courseId, userInfo.getId()).getRole().equals( Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER)) { data = new InstructorsData(); for (InstructorAttributes instructor : instructorsOfCourse) { InstructorData instructorData = new InstructorData(instructor); instructorData.setGoogleId(instructor.googleId); data.getInstructors().add(instructorData); } } else { data = new InstructorsData(instructorsOfCourse); } } else { throw new InvalidHttpParameterException("unknown intent"); } return new JsonResult(data); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); List<InstructorAttributes> instructorsOfCourse = logic.getInstructorsForCourse(courseId); InstructorsData data; String intentStr = getRequestParamValue(Const.ParamsNames.INTENT); if (intentStr == null) { instructorsOfCourse = instructorsOfCourse.stream() .filter(InstructorAttributes::isDisplayedToStudents) .collect(Collectors.toList()); data = new InstructorsData(instructorsOfCourse); data.getInstructors().forEach(i -> { i.setGoogleId(null); i.setJoinState(null); i.setIsDisplayedToStudents(null); i.setRole(null); }); } else if (intentStr.equals(Intent.FULL_DETAIL.toString())) { if (userInfo.isAdmin || logic.getInstructorForGoogleId(courseId, userInfo.getId()).getPrivileges() .isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR)) { data = new InstructorsData(); for (InstructorAttributes instructor : instructorsOfCourse) { InstructorData instructorData = new InstructorData(instructor); instructorData.setGoogleId(instructor.googleId); data.getInstructors().add(instructorData); } } else { data = new InstructorsData(instructorsOfCourse); } } else { throw new InvalidHttpParameterException("unknown intent"); } return new JsonResult(data); }
Source:
public void addCookie(Cookie cookie) { this.cookies.add(new ZestCookie(cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getExpiryDate(), cookie.getSecure())); }

Target:
public void addCookie(Cookie cookie) { addCookie(cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getExpiryDate(), cookie.getSecure()); }
Source:
public void onReceiveResult(int resultCode, Bundle resultData) { long progress; if (resultCode == Constants.UPDATE_DOWNLOAD_PROGRESS) { progress = resultData.getLong(ProgressResponseBody.TAG_PROGRESS); updateProgressDialog(progress); } else if (resultCode == Constants.UPDATE_DOWNLOAD_SUCCESS) { progress = resultData.getLong(ProgressResponseBody.TAG_PROGRESS); updateProgressDialog(progress); ToastUtil.showSuccess(WebViewActivity.this, "Download successful"); } else { dismissProgressDialog(); ToastUtil.showError(WebViewActivity.this, "Download failed"); } }

Target:
public void onReceiveResult(int resultCode, Bundle resultData) { long progress; switch (resultCode) { case UPDATE_DOWNLOAD_PROGRESS: progress = resultData.getLong(ProgressResponseBody.TAG_PROGRESS); updateProgressDialog(progress); break; case UPDATE_DOWNLOAD_SUCCESS: progress = resultData.getLong(ProgressResponseBody.TAG_PROGRESS); updateProgressDialog(progress); ToastUtil.showSuccess(this, R.string.status_download_finished); break; default: dismissProgressDialog(); ToastUtil.showError(this, R.string.download_failed); } }
Source:
public void onViewStateRestored(Bundle savedInstanceState) { if (savedInstanceState != null) { layoutManagerSavedState = savedInstanceState.getParcelable(LAYOUT_MANAGER_STATE); prevLeftAction = savedInstanceState.getString("prevLeftAction", ""); prevRightAction = savedInstanceState.getString("prevRightAction", ""); } super.onViewStateRestored(savedInstanceState); }

Target:
public void onViewStateRestored(Bundle savedInstanceState) { if (savedInstanceState != null) layoutManagerSavedState = savedInstanceState.getParcelable(LAYOUT_MANAGER_STATE); super.onViewStateRestored(savedInstanceState); }
Source:
private static String asHtml(String text) { if (qualifiesAsHtml(text)) { if (qualifiesAsSymbolReplacement(text)) { int contentOffset = text.indexOf('['); String assignment = text.substring(0, contentOffset); String content = text.substring(contentOffset); return HtmlUtil.escapeHTML(assignment) + content; } return text; } if(containsHtml(text) && qualifiesAsConvertedList(text)) { return text; } return HtmlUtil.escapeHTML(text); }

Target:
private static String asHtml(String text) { if (qualifiesAsHtml(text)) { if (qualifiesAsSymbolReplacement(text)) { int contentOffset = text.indexOf('['); String assignment = text.substring(0, contentOffset); String content = text.substring(contentOffset); return HtmlUtil.escapeHTML(assignment) + content; } return text; } if (containsHtmlTable(text) && qualifiesAsConvertedList(text)) { return text; } return HtmlUtil.escapeHTML(text); }
Source:
private static String getSettingValue( String tag, String defaultValue ) { final PluginSettings settings = PluginEnvironment.env().getPluginSettings(); String value = settings.getTagValue( tag ).get( 0 ); if ( value == null ) { value = defaultValue; } return value; }

Target:
private static String getSettingValue( String tag, String defaultValue ) { final PluginSettings settings = PluginEnvironment.env().getPluginSettings(); List<String> values = settings.getTagValue( tag ); return values.isEmpty() ? defaultValue : values.get( 0 ); }
Source:
public CustomUIPane(HaskellCatalog catalog) { this.connectionCreationManager = new ConnectionCreationManager(this); this.selectedBlock = new SimpleObjectProperty<>(Optional.empty()); this.errorOccurred = new SimpleBooleanProperty(false); this.dragStart = Point2D.ZERO; this.offset = Point2D.ZERO; this.catalog = catalog; this.envInstance = catalog.asEnvironment(); exprToFunction = new HashMap<Expr, FunctionBlock>(); try { this.ghci = Optional.of(new GhciSession()); } catch (GhciException e) { this.ghci = Optional.empty(); } this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handlePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleDrag); this.addEventHandler(ScrollEvent.SCROLL, this::handleScroll); this.addEventHandler(KeyEvent.KEY_PRESSED, this::handleKey); Platform.runLater(() -> { inspector = new InspectorWindow(this); inspector.blockProperty().bind(this.selectedBlock); }); }

Target:
public CustomUIPane(HaskellCatalog catalog) { this.connectionCreationManager = new ConnectionCreationManager(this); this.selectedBlock = new SimpleObjectProperty<>(Optional.empty()); this.errorOccurred = new SimpleBooleanProperty(false); this.dragStart = Point2D.ZERO; this.offset = Point2D.ZERO; this.catalog = catalog; this.envInstance = catalog.asEnvironment(); this.exprToFunction = new HashMap<Expr, FunctionBlock>(); try { this.ghci = Optional.of(new GhciSession()); } catch (GhciException e) { this.ghci = Optional.empty(); } this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handlePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleDrag); this.addEventHandler(ScrollEvent.SCROLL, this::handleScroll); this.addEventHandler(KeyEvent.KEY_PRESSED, this::handleKey); Platform.runLater(() -> { inspector = new InspectorWindow(this); inspector.blockProperty().bind(this.selectedBlock); }); }
Source:
public DozerBeanMapperFactoryBean dozerMapper() throws IOException { DozerBeanMapperFactoryBean factoryBean = new DozerBeanMapperFactoryBean(); factoryBean.setMappingFiles(configurationProperties.getMappingFiles()); factoryBean.setApplicationContext(applicationContext); return factoryBean; }

Target:
public DozerBeanMapperFactoryBean dozerMapper() throws IOException { DozerBeanMapperFactoryBean factoryBean = new DozerBeanMapperFactoryBean(); factoryBean.setMappingFiles(configurationProperties.getMappingFiles()); return factoryBean; }