auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private StartupStrategyProvider() { if (strategyName == null || strategyName.length() == 0) { strategyName = ControllerBasedStartupStrategy.class.getSimpleName(); } System.setProperty(KieServerConstants.KIE_SERVER_STARTUP_STRATEGY, strategyName); if ("OpenShiftStartupStrategy".equals(strategyName) || "KubernetesStartupStrategy".equals(strategyName)) System.setProperty(KieServerConstants.KIE_SERVER_STATE_REPO_TYPE, "KieServerStateCloudRepository"); strategies.forEach( s -> { foundStrategies.put(s.getClass().getSimpleName(), s); logger.debug("Discovered '{}' startup strategy and registered under '{}'", s, s.getClass().getSimpleName()); } ); foundStrategies.put(ControllerBasedStartupStrategy.class.getSimpleName(), new ControllerBasedStartupStrategy()); }

Target:
private StartupStrategyProvider() { if (strategyName == null || strategyName.length() == 0) { strategyName = ControllerBasedStartupStrategy.class.getSimpleName(); } strategies.forEach( s -> { foundStrategies.put(s.getClass().getSimpleName(), s); logger.debug("Discovered '{}' startup strategy and registered under '{}'", s, s.getClass().getSimpleName()); } ); foundStrategies.put(ControllerBasedStartupStrategy.class.getSimpleName(), new ControllerBasedStartupStrategy()); }
Source:
private static long retrieveIsoFileSize(Map.Entry<String, Map<String, String>> isoFileWithMetadata) { String sizeValue = isoFileWithMetadata.getValue().get("size"); if (sizeValue == null) { return SIZE_IS_NOT_AVAILABLE; } try { return Long.valueOf(sizeValue); } catch (NumberFormatException e) { log.errorFormat("File's '{0}' size is illegal number", isoFileWithMetadata.getKey(), e); return SIZE_IS_NOT_AVAILABLE; } }

Target:
private static long retrieveIsoFileSize(Map.Entry<String, Map<String, String>> isoFileWithMetadata) { String sizeValue = isoFileWithMetadata.getValue().get("size"); try { return Long.valueOf(sizeValue); } catch (NumberFormatException e) { log.errorFormat("File's '{0}' size is illegal number", isoFileWithMetadata.getKey(), e); return SIZE_IS_NOT_AVAILABLE; } }
Source:
public CollapsedNode(InternalNode wrapped) { wrappedNode = wrapped; wrappedNode.getChildren().forEach(child -> child.setVisible(false)); wrappedNode.getChildren().add(0, this); wrappedNode.marginProperty().bind(this.marginProperty()); this.label = new Text(LeafNode.LABEL_X_OFFSET, LeafNode.LABEL_Y_OFFSET, "collapsed."); this.label.onMouseClickedProperty().bind(shape.onMouseClickedProperty()); this.label.setTextAlignment(TextAlignment.CENTER); getChildren().add(this.label); this.marginProperty().set(LeafNode.LEAFHEIGHT); }

Target:
public CollapsedNode(InternalNode wrapped) { wrappedNode = wrapped; wrappedNode.getChildren().forEach(child -> child.setVisible(false)); wrappedNode.getChildren().add(this); wrappedNode.marginProperty().bind(this.marginProperty()); this.label = new Text(LeafNode.LABEL_X_OFFSET, LeafNode.LABEL_Y_OFFSET, ""); this.label.textProperty().bind(wrapped.leafCountProperty().asString().concat(" strains")); this.label.onMouseClickedProperty().bind(shape.onMouseClickedProperty()); this.label.setTextAlignment(TextAlignment.CENTER); getChildren().add(this.label); this.marginProperty().set(LeafNode.LEAFHEIGHT); }
Source:
public void test() throws Exception { ChatManager m1 = ChatManager.getInstanceFor(conOne); ChatManager m2 = ChatManager.getInstanceFor(conTwo); m2.addIncomingListener(listener); Chat chat = m1.chatWith(conTwo.getUser().asEntityBareJid()); chat.send(body); syncPoint.waitForResult(10 * 1000); }

Target:
public void test() throws Exception { ChatManager chatManagerOne = ChatManager.getInstanceFor(conOne); ChatManager chatManagerTwo = ChatManager.getInstanceFor(conTwo); final String body = StringUtils.randomString(16); final SimpleResultSyncPoint syncPoint = new SimpleResultSyncPoint(); final IncomingChatMessageListener listener = new IncomingChatMessageListener() { @Override public void newIncomingMessage(EntityBareJid from, Message message, Chat chat) { if (body.equals(message.getBody())) { syncPoint.signal(); } } }; try { chatManagerTwo.addIncomingListener(listener); Chat chat = chatManagerOne.chatWith(conTwo.getUser().asEntityBareJid()); chat.send(body); syncPoint.waitForResult(10 * 1000); } finally { chatManagerTwo.removeIncomingListener(listener); } }
Source:
private void parseWordDocument(File officeFile, String objectID) { String filePath = officeFile.getAbsolutePath(); List<XWPFParagraph> paragraphs; try { FileInputStream fs = new FileInputStream(filePath); XWPFDocument xwpfDoc = new XWPFDocument(fs); paragraphs = (xwpfDoc).getParagraphs(); } catch (IOException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } catch (SchemaTypeLoaderException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } for (int i = 0; i < paragraphs.size(); i++) { XWPFParagraph paragraph = paragraphs.get(i); if (paragraph != null) { CapraWordRequirement cRequirement = new CapraWordRequirement(paragraph, officeFile, i); if (!objectID.equals(OBJECT_ID_NOT_SPECIFIED)) { if (cRequirement.getId().equals(objectID)) { selection.add(cRequirement); break; } } else if (!cRequirement.getData().isEmpty()) selection.add(cRequirement); } } }

Target:
private void parseWordDocument(File officeFile, String objectID) { List<XWPFParagraph> paragraphs; try { FileInputStream fs = new FileInputStream(officeFile); XWPFDocument xwpfDoc = new XWPFDocument(fs); paragraphs = (xwpfDoc).getParagraphs(); } catch (IOException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } catch (SchemaTypeLoaderException e) { e.printStackTrace(); showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Couldn't open the file."); return; } for (int i = 0; i < paragraphs.size(); i++) { XWPFParagraph paragraph = paragraphs.get(i); if (paragraph != null) { CapraWordRequirement cRequirement = new CapraWordRequirement(paragraph, officeFile, i); if (!objectID.equals(OBJECT_ID_NOT_SPECIFIED)) { if (cRequirement.getId().equals(objectID)) { selection.add(cRequirement); break; } } else if (!cRequirement.getData().isEmpty()) selection.add(cRequirement); } } }
Source:
public void whenEmptyResponseThenGetProjectFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(PROJECT_FEATURE_FLAGS_URI_PATTERN, ProjectFeatureFlags.class, PROJECT_ID)).thenReturn(null); service.listProjectFeatureFlags(project); }

Target:
public void whenEmptyResponseThenGetProjectFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(new URI(PROJECT_FEATURE_FLAGS_URI), ProjectFeatureFlags.class)).thenReturn(null); service.listProjectFeatureFlags(project); }
Source:
private boolean wrapInChannelEvent(ChannelEvent event, ChannelHandlerContext ctx, Runnable operation, Runnable eventFillerBefore, Runnable eventFillerAfter) { event.begin(); eventFillerBefore.run(); try { operation.run(); } catch (Throwable t) { event.completedExceptionally(t); throw t; } finally { event.end(); if (event.shouldCommit()) { event.setChannel(ctx.channel()); eventFillerAfter.run(); } return event.shouldCommit(); } }

Target:
private static boolean wrapInChannelEvent(ChannelEvent event, ChannelHandlerContext ctx, Runnable operation, Runnable eventFillerBefore, Runnable eventFillerAfter) { if (event.isEnabled()) { event.begin(); eventFillerBefore.run(); } operation.run(); if (event.isEnabled()) { event.end(); if (event.shouldCommit()) { event.setChannel(ctx.channel()); eventFillerAfter.run(); return true; } } return false; }
Source:
ReferenceDialog(@NonNull Context context, int selectedIndex, List<ReferenceHandler.Reference> adjacentReferences, LinkHandler referenceLinkHandler) { super(context); View rootView = LayoutInflater.from(context).inflate(R.layout.fragment_references_pager, null); setContentView(rootView); ButterKnife.bind(this); this.referenceLinkHandler = referenceLinkHandler; referencesViewPager.setAdapter(new ReferencesAdapter(adjacentReferences)); referencesViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { pageIndicatorView.setSelection(position); } @Override public void onPageScrollStateChanged(int state) { } }); if (adjacentReferences.size() != 1) { multipleCitationsContainer.setVisibility(View.VISIBLE); singleCitationContainer.setVisibility(View.GONE); pageIndicatorView.setCount(adjacentReferences.size()); referencesViewPager.setCurrentItem(selectedIndex, true); } else { multipleCitationsContainer.setVisibility(View.GONE); singleCitationContainer.setVisibility(View.VISIBLE); singleCitationReferenceText.setText(StringUtil.fromHtml(adjacentReferences.get(0).getHref())); singleCitationTitleText.setText(getContext().getString(R.string.reference_title, adjacentReferences.get(0).getLinkText())); } }

Target:
ReferenceDialog(@NonNull Context context, int selectedIndex, List<ReferenceHandler.Reference> adjacentReferences, LinkHandler referenceLinkHandler) { super(context); View rootView = LayoutInflater.from(context).inflate(R.layout.fragment_references_pager, null); setContentView(rootView); ButterKnife.bind(this); this.referenceLinkHandler = referenceLinkHandler; referencesViewPager.setAdapter(new ReferencesAdapter(adjacentReferences)); referencesViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { pageIndicatorView.setSelection(position); } @Override public void onPageScrollStateChanged(int state) { } }); if (adjacentReferences.size() > 1) { multipleCitationsContainer.setVisibility(View.VISIBLE); singleCitationContainer.setVisibility(View.GONE); pageIndicatorView.setCount(adjacentReferences.size()); referencesViewPager.setCurrentItem(selectedIndex, true); } else { multipleCitationsContainer.setVisibility(View.GONE); singleCitationContainer.setVisibility(View.VISIBLE); singleCitationReferenceText.setText(StringUtil.fromHtml(adjacentReferences.get(0).getLinkHtml())); singleCitationTitleText.setText(getContext().getString(R.string.reference_title, adjacentReferences.get(0).getLinkText())); } }
Source:
private void setupMixin(Project project) { List<String> mixins = appContext.getCurrentProject().getRootProject().getMixins(); if (!mixins.contains(OPENSHIFT_PROJECT_TYPE_ID)) { mixins.add(OPENSHIFT_PROJECT_TYPE_ID); } Map<String, List<String>> attributes = appContext.getCurrentProject().getRootProject().getAttributes(); attributes.put(OPENSHIFT_APPLICATION_VARIABLE_NAME, newArrayList(osAppName)); attributes.put(OPENSHIFT_NAMESPACE_VARIABLE_NAME, newArrayList(project.getMetadata().getName())); final ProjectConfigDto updateProject = newDto(ProjectConfigDto.class) .withMixins(mixins) .withType(appContext.getCurrentProject().getRootProject().getType()) .withAttributes(attributes); newPromise(new RequestCall<ProjectDescriptor>() { @Override public void makeCall(AsyncCallback<ProjectDescriptor> callback) { projectService.updateProject(appContext.getCurrentProject().getRootProject().getPath(), updateProject, newCallback(callback, dtoUnmarshaller.newUnmarshaller(ProjectDescriptor.class))); } }).then(new Operation<ProjectDescriptor>() { @Override public void apply(ProjectDescriptor project) throws OperationException { eventBus.fireEvent(new ProjectUpdatedEvent(appContext.getCurrentProject().getRootProject().getPath(), project)); notificationManager.showInfo(locale.linkProjectWithExistingSuccess(appContext.getCurrentProject().getRootProject().getName(), osAppName)); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { final ServiceError serviceError = dtoFactory.createDtoFromJson(arg.getMessage(), ServiceError.class); notificationManager.showError(serviceError.getMessage()); } }); }

Target:
private void setupMixin(Project project) { final ProjectDescriptor projectDescriptor = appContext.getCurrentProject().getRootProject(); List<String> mixins = projectDescriptor.getMixins(); if (!mixins.contains(OPENSHIFT_PROJECT_TYPE_ID)) { mixins.add(OPENSHIFT_PROJECT_TYPE_ID); } Map<String, List<String>> attributes = projectDescriptor.getAttributes(); attributes.put(OPENSHIFT_APPLICATION_VARIABLE_NAME, newArrayList(osAppName)); attributes.put(OPENSHIFT_NAMESPACE_VARIABLE_NAME, newArrayList(project.getMetadata().getName())); newPromise(new RequestCall<ProjectDescriptor>() { @Override public void makeCall(AsyncCallback<ProjectDescriptor> callback) { projectService.updateProject(projectDescriptor.getPath(), projectDescriptor, newCallback(callback, dtoUnmarshaller.newUnmarshaller(ProjectDescriptor.class))); } }).then(new Operation<ProjectDescriptor>() { @Override public void apply(ProjectDescriptor project) throws OperationException { eventBus.fireEvent(new ProjectUpdatedEvent(appContext.getCurrentProject().getRootProject().getPath(), project)); notificationManager.showInfo( locale.linkProjectWithExistingSuccess(appContext.getCurrentProject().getRootProject().getName(), osAppName)); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { final ServiceError serviceError = dtoFactory.createDtoFromJson(arg.getMessage(), ServiceError.class); notificationManager.showError(serviceError.getMessage()); } }); }
Source:
public void stopActionMode() { Intent intent = new Intent("recent-list-stop-action-mode"); LocalBroadcastManager.getInstance(context).sendBroadcast(intent); }

Target:
public void stopActionMode() { recentListActionModeUtil.stopActionMode(); }
Source:
public void setFecPacket(FlexFec03Packet p) { logger.debug("Have " + mediaPackets.size() + " saved media packets"); numMissing = 0; logger.debug("Reconstructor checking if recovery is " + "possible: fec packet " + p.getSequenceNumber() + " protects packets:\n" + p.getProtectedSequenceNumbers()); this.fecPacket = p; if (p == null) { logger.error("Error creating flexfec packet"); return; } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { logger.debug("Checking if we've received media " + "packet " + protectedSeqNum); if (!mediaPackets.containsKey(protectedSeqNum)) { logger.debug("We haven't, mark as missing"); numMissing++; missingSequenceNumber = protectedSeqNum; } } logger.debug("There were " + numMissing + " missing media " + "packets for flexfec " + p.getSequenceNumber()); if (numMissing > 1) { missingSequenceNumber = -1; } }

Target:
public void setFecPacket(FlexFec03Packet p) { if (p == null) { logger.error("Error setting flexfec packet"); return; } this.fecPacket = p; if (logger.isDebugEnabled()) { logger.debug("Have " + mediaPackets.size() + " saved media packets"); } numMissing = 0; if (logger.isDebugEnabled()) { logger.debug("Reconstructor checking if recovery is " + "possible: fec packet " + p.getSequenceNumber() + " protects packets:\n" + p.getProtectedSequenceNumbers()); } for (Integer protectedSeqNum : fecPacket.getProtectedSequenceNumbers()) { if (logger.isDebugEnabled()) { logger.debug("Checking if we've received media " + "packet " + protectedSeqNum); } if (!mediaPackets.containsKey(protectedSeqNum)) { if (logger.isDebugEnabled()) { logger.debug("We haven't, mark as missing"); } numMissing++; missingSequenceNumber = protectedSeqNum; } } if (logger.isDebugEnabled()) { logger.debug("There were " + numMissing + " missing media " + "packets for flexfec " + p.getSequenceNumber()); } if (numMissing > 1) { missingSequenceNumber = -1; } }
Source:
public void canSerializeAndDeserializeKeepingNonLoggability() { TableMetadataPersistence.NamedColumnDescription.Builder builder = NAME_NOT_LOGGABLE_DESCRIPTION.persistToProto(); assertThat(NamedColumnDescription.hydrateFromProto(builder.build())) .isEqualTo(NAME_NOT_LOGGABLE_DESCRIPTION) .matches(description -> !description.isNameLoggable()); }

Target:
public void canSerializeAndDeserializeKeepingNonLoggability() { assertCanSerializeAndDeserializeWithLoggability(NAME_NOT_LOGGABLE_DESCRIPTION, false); }
Source:
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { LockControlCommand lockControlCommand = (LockControlCommand) rCommand; boolean sync = !lockControlCommand.isUnlock(); ((LocalTxInvocationContext) rCtx).remoteLocksAcquired(rpcManager.getTransport().getMembers()); CompletionStage<Map<Address, Response>> remoteInvocation = rpcManager.invokeCommandOnAll(lockControlCommand, new MapResponseCollector(true), rpcManager.getSyncRpcOptions()); return asyncValue(remoteInvocation.thenApply(responses -> null)); }); }

Target:
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { LockControlCommand lockControlCommand = (LockControlCommand) rCommand; boolean sync = !lockControlCommand.isUnlock(); ((LocalTxInvocationContext) rCtx).remoteLocksAcquired(rpcManager.getTransport().getMembers()); if (sync) { CompletionStage<Void> remoteInvocation = rpcManager.invokeCommandOnAll(lockControlCommand, new VoidResponseCollector(true), rpcManager.getSyncRpcOptions()); return asyncValue(remoteInvocation); } else { rpcManager.sendToAll(lockControlCommand, DeliverOrder.PER_SENDER); return null; } }); }
Source:
public void requestExactCompletesImmediately() { TestSubscriber<Integer> ts = TestSubscriber.create(10); Observable.range(1, 10).observeOn(Schedulers.computation()).subscribe(ts); ts.awaitTerminalEvent(1, TimeUnit.SECONDS); ts.assertValueCount(10); ts.assertNoErrors(); ts.assertCompleted(); }

Target:
public void requestExactCompletesImmediately() { TestSubscriber<Integer> ts = TestSubscriber.create(0); TestScheduler test = Schedulers.test(); Observable.range(1, 10).observeOn(test).subscribe(ts); test.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertNoValues(); ts.assertNoErrors(); ts.assertNotCompleted(); ts.requestMore(10); test.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValueCount(10); ts.assertNoErrors(); ts.assertCompleted(); }
Source:
public void definitionList() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.DEFINITION_LIST)); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_LIST) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_ITEM) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.DEFINITION_TERM) instanceof SupportedBlockStrategy); }

Target:
public void definitionList() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.DEFINITION_LIST)); assertSupported(strategies, BlockType.DEFINITION_LIST); assertSupported(strategies, BlockType.DEFINITION_ITEM); assertSupported(strategies, BlockType.DEFINITION_TERM); }
Source:
public Set<PushServerInfo> getAvailablePushTargets() { try { XWikiContext context = getXContext(); XWiki xwiki = context.getWiki(); XWikiDocument prefsDoc = xwiki.getDocument(new DocumentReference(context.getWikiId(), "XWiki", "XWikiPreferences"), context); List<BaseObject> servers = prefsDoc.getXObjects(new DocumentReference(context.getWikiId(), Constants.CODE_SPACE, "PushPatientServer")); Set<PushServerInfo> response = new TreeSet<>(); if (servers == null || servers.isEmpty()) { return response; } for (BaseObject serverConfiguration : servers) { if (serverConfiguration == null) { continue; } this.logger.debug(" ...available: [{}]", serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME)); String name = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME); String url = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_URL_PROPERTY_NAME); if (StringUtils.isEmpty(name) || StringUtils.isEmpty(url)) { continue; } PushServerInfo info = new DefaultPushServerInfo(name, url, serverConfiguration.displayView(DefaultPushPatientData.PUSH_SERVER_CONFIG_DESC_PROPERTY_NAME, context)); response.add(info); } return response; } catch (Exception ex) { this.logger.error("Failed to get server list: {}", ex.getMessage(), ex); return Collections.emptySet(); } }

Target:
public Set<PushServerInfo> getAvailablePushTargets() { try { XWikiContext context = getXContext(); XWiki xwiki = context.getWiki(); XWikiDocument prefsDoc = xwiki.getDocument(new DocumentReference(context.getWikiId(), "XWiki", "XWikiPreferences"), context); List<BaseObject> servers = prefsDoc.getXObjects(new DocumentReference(context.getWikiId(), Constants.CODE_SPACE, "PushPatientServer")); Set<PushServerInfo> response = new TreeSet<>(); if (servers == null || servers.isEmpty()) { return response; } for (BaseObject serverConfiguration : servers) { if (serverConfiguration == null) { continue; } this.logger.debug(" ...available: [{}]", serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME)); String name = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_ID_PROPERTY_NAME); String url = serverConfiguration.getStringValue(DefaultPushPatientData.PUSH_SERVER_CONFIG_URL_PROPERTY_NAME); if (StringUtils.isBlank(name) || StringUtils.isBlank(url)) { continue; } PushServerInfo info = new DefaultPushServerInfo(name, url, serverConfiguration.displayView(DefaultPushPatientData.PUSH_SERVER_CONFIG_DESC_PROPERTY_NAME, context)); response.add(info); } return response; } catch (Exception ex) { this.logger.error("Failed to get server list: {}", ex.getMessage(), ex); return Collections.emptySet(); } }
Source:
private List<String> optionCellValues(Long questionId, String value, boolean useQuestionId, List<QuestionOptionDto> options, Boolean allowOther) { List<String> cells = new ArrayList<>(); List<Map<String,String>> optionNodes = getNodes(value); String optionString = buildOptionString(optionNodes); cells.add(optionString); if (useQuestionId){ String text; String code; String cacheId; String other = null; boolean found; int numOptions = options.size(); boolean[] optionFound = new boolean[numOptions]; String qId = questionId.toString(); for (Map<String,String> optAnswer : optionNodes){ text = optAnswer.get("text") != null ? optAnswer.get("text") : ""; code = optAnswer.get("code") != null ? optAnswer.get("code") : ""; found = false; cacheId = qId + text + code; if (optionCache.containsKey(cacheId)){ optionFound[optionCache.get(cacheId)] = true; found = true; } if (!found){ for (int i = 0; i < numOptions; i++){ if (text != null && text.equalsIgnoreCase(options.get(i).getText()) && text.length() > 0){ optionFound[i] = true; found = true; optionCache.put(cacheId, i); break; } } } if (!found){ for (int i = 0; i < numOptions; i++){ if (code != null && code.equalsIgnoreCase(options.get(i).getCode()) && code.length() > 0){ optionFound[i] = true; found = true; optionCache.put(cacheId, i); break; } } } if (!found){ other = text; } } for (int i = 0; i < numOptions; i++){ cells.add(optionFound[i] ? "1" : "0"); } if (allowOther){ cells.add(other != null ? other : ""); } } return cells; }

Target:
private List<String> optionCellValues(Long questionId, String value, boolean useQuestionId, List<QuestionOptionDto> options, Boolean allowOther) { List<String> cells = new ArrayList<>(); List<Map<String, String>> optionNodes = getNodes(value); String optionString = buildOptionString(optionNodes); cells.add(optionString); if (useQuestionId) { String text; String code; String cacheId; String other = null; boolean found; int numOptions = options.size(); boolean[] optionFound = new boolean[numOptions]; String qId = questionId.toString(); for (Map<String, String> optAnswer : optionNodes) { text = optAnswer.get("text") != null ? optAnswer.get("text") : ""; code = optAnswer.get("code") != null ? optAnswer.get("code") : ""; found = false; cacheId = qId + text + code; if (optionsPositionCache.containsKey(cacheId)) { optionFound[optionsPositionCache.get(cacheId)] = true; found = true; } if (!found) { for (int i = 0; i < numOptions; i++) { if (text != null && text.length() > 0 && text.equalsIgnoreCase(options.get(i).getText())) { optionFound[i] = true; found = true; optionsPositionCache.put(cacheId, i); break; } } } if (!found) { for (int i = 0; i < numOptions; i++) { if (code != null && code.length() > 0 && code.equalsIgnoreCase(options.get(i).getCode())) { optionFound[i] = true; found = true; optionsPositionCache.put(cacheId, i); break; } } } if (!found) { other = text; } } for (int i = 0; i < numOptions; i++) { cells.add(optionFound[i] ? "1" : "0"); } if (allowOther) { cells.add(other != null ? other : ""); } } return cells; }
Source:
public WordsObject createObject(String objectName, String className, WordsPosition position) throws WordsRuntimeException { try { getObject(objectName); throw new WordsObjectAlreadyExistsException(objectName); } catch (WordsObjectNotFoundException e){ WordsClass wordsClass = getClass(className); if (wordsClass == null) { throw new WordsClassNotFoundException(className); } WordsObject newObject = new WordsObject(objectName, wordsClass, position); objects.put(objectName, newObject); newObject.enqueueAction(new WordsWait(1)); return newObject; } }

Target:
public WordsObject createObject(String objectName, String className, WordsPosition position) throws WordsRuntimeException { try { getObject(objectName); throw new WordsObjectAlreadyExistsException(objectName); } catch (WordsObjectNotFoundException e){ WordsClass wordsClass = getClass(className); WordsObject newObject = new WordsObject(objectName, wordsClass, position); objects.put(objectName, newObject); newObject.enqueueAction(new WordsWait(1)); return newObject; } }
Source:
public View getView(int position, View convertView, ViewGroup parent) { PollingLocation location = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.location_list_item, parent, false); viewHolder.name = (TextView) convertView.findViewById(R.id.location_list_item_name); viewHolder.address = (TextView) convertView.findViewById(R.id.location_list_item_address); viewHolder.distance = (TextView) convertView.findViewById(R.id.location_list_item_distance); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (location.name != null && !location.name.isEmpty()) { viewHolder.name.setText(location.name); } else if (location.address.locationName != null && !location.address.locationName.isEmpty()) { viewHolder.name.setText(location.address.locationName); } String addr = location.address.toGeocodeString(); if (!addr.isEmpty()) { viewHolder.address.setText(addr); } else { viewHolder.address.setVisibility(View.GONE); } if (location.address.distance > 0) { viewHolder.distance.setText(distanceFormat.format(location.address.distance) + " mi."); } if (location.id != null) { viewHolder.distance.setTag(location.id); } else { viewHolder.distance.setTag(addr); } return convertView; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { PollingLocation location = getItem(position); ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.location_list_item, parent, false); viewHolder.name = (TextView) convertView.findViewById(R.id.location_list_item_name); viewHolder.address = (TextView) convertView.findViewById(R.id.location_list_item_address); viewHolder.distance = (TextView) convertView.findViewById(R.id.location_list_item_distance); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (location.name != null && !location.name.isEmpty()) { viewHolder.name.setText(location.name); } else if (location.address.locationName != null && !location.address.locationName.isEmpty()) { viewHolder.name.setText(location.address.locationName); } String addr = location.address.toGeocodeString(); if (!addr.isEmpty()) { viewHolder.address.setText(addr); } else { viewHolder.address.setVisibility(View.GONE); } if (location.address.distance > 0) { viewHolder.distance.setText(distanceFormat.format(location.address.distance) + distanceSuffix); } if (location.id != null) { viewHolder.distance.setTag(location.id); } else { viewHolder.distance.setTag(addr); } return convertView; }
Source:
public void shutdown() { scheduler.shutdownNow(); }

Target:
public void shutdown() { LOG.info("Shutting down HeartbeatScheduler"); scheduler.shutdownNow(); }
Source:
private @Nullable Map<@NonNull String, @NonNull SegmentStoreStatistics> getPerTypeStats(long start, long end , IProgressMonitor monitor) { Collection<@NonNull ISegment> store = getSegmentStore(start, end); if (store == null) { return null; } if (monitor.isCanceled()) { return Collections.EMPTY_MAP; } return calculateTotalPerType(store, monitor); }

Target:
private @Nullable Map<@NonNull String, @NonNull SegmentStoreStatistics> getPerTypeStats(long start, long end , IProgressMonitor monitor) { Collection<@NonNull ISegment> store = getSegmentStore(start, end); if (store == null || monitor.isCanceled()) { return null; } return calculateTotalPerType(store, monitor); }
Source:
public VR transform(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { return delegateTransformer.transform(k, v); } catch (Throwable e) { error = e; throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }

Target:
public VR transform(K k, V v) { Span span = kafkaStreamsTracing.nextSpan(processorContext); if (!span.isNoop()) { span.name(spanName); span.start(); } Tracer.SpanInScope ws = tracer.withSpanInScope(span); Throwable error = null; try { return delegateTransformer.transform(k, v); } catch (Throwable e) { error = e; propagateIfFatal(e); throw e; } finally { kafkaStreamsTracing.injector.inject(span.context(), processorContext.headers()); if (error != null) span.error(error); span.finish(); ws.close(); } }
Source:
public void testLoadAccountMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = new HashMap<String, String>(); idToNames = createRecordsOnServer(1, Constants.ACCOUNT); String[] names = idToNames.values().toArray(new String[1]);; String[] ids = idToNames.keySet().toArray(new String[1]); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); assertEquals("Recently viewed object name is incorrect", mruObjects_before.get(0).getName(), mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }

Target:
public void testLoadAccountMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = createRecordsOnServer(1, Constants.ACCOUNT); Set<String> ids = idToNames.keySet(); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); assertEquals("Recently viewed object name is incorrect", mruObjects_before.get(0).getName(), mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }
Source:
public void init() { post( "/login", (req, res) -> { Map<String, String> formParams = new HashMap<>(); String body = req.body(); Pattern regExp = Pattern.compile( "^Content-Disposition: form-data; name=\"(.+)\"$[\r\n]+(.+)$", Pattern.MULTILINE); Matcher matcher = regExp.matcher(body); while (matcher.find()) { String key = matcher.group(1); String value = matcher.group(2); formParams.put(key, value); } authenticationService.login( req.raw(), formParams.get("username"), formParams.get("password"), formParams.get("prevurl")); res.redirect(formParams.get("prevurl"), 303); return res; }); }

Target:
public void init() { post( "/login", (req, res) -> { authenticationService.login( req.raw(), req.queryParams("username"), req.queryParams("password"), req.queryParams("prevurl")); res.redirect(req.queryParams("prevurl"), HttpStatus.SC_SEE_OTHER); return res; }); }
Source:
public FlowIdentifier restoreClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { LOGGER.debug("Starting cluster database restore: " + nameOrCrn); if (nameOrCrn.hasName()) { return databaseBackupRestoreService.restoreDatabase(workspaceId, nameOrCrn.getName(), location, backupId); } else { LOGGER.debug("No stack name provided for restore, found: " + nameOrCrn); throw new BadRequestException("Please provide a stack name for restore"); } }

Target:
public FlowIdentifier restoreClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { databaseBackupRestoreService.validate(workspaceId, nameOrCrn, location, backupId); LOGGER.debug("Starting cluster database restore: " + nameOrCrn); return databaseBackupRestoreService.restoreDatabase(workspaceId, nameOrCrn, location, backupId); }
Source:
public String toString() { if (format != null) { if (format.equals("epoch")) { return String.valueOf(date.getTime()); } if (format.equals("unix")) { return String.valueOf(date.getTime() / 1000L); } return formatCustom(); } return timezoneName != null ? ISO8601Utils.format(date, false, TimeZone.getTimeZone(timezoneName)) : ISO8601Utils.format(date, false); }

Target:
public String toString() { if (format != null) { if (format.equals("epoch")) { return String.valueOf(date.getTime()); } if (format.equals("unix")) { return String.valueOf(date.getTime() / DIVIDE_MILLISECONDS_TO_SECONDS); } return formatCustom(); } return timezoneName != null ? ISO8601Utils.format(date, false, TimeZone.getTimeZone(timezoneName)) : ISO8601Utils.format(date, false); }
Source:
public void testQueryByNoBusinessAdmin() { String role1 = "role1"; String role2 = "role2"; String userId = "userId"; when(identityProvider.getRoles()).thenReturn(Arrays.asList(role1, role2)); when(identityProvider.getName()).thenReturn(userId); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); when(identityProvider.getRoles()).thenReturn(Collections.emptyList()); when(identityProvider.getName()).thenReturn(userId); dataSetLookup= new DataSetLookup(); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); }

Target:
public void testQueryByNoBusinessAdmin() { dataSetLookup = new DataSetLookup(); String role1 = "role1"; String role2 = "role2"; String userId = "userId"; when(identityProvider.getRoles()).thenReturn(Arrays.asList(role1, role2)); when(identityProvider.getName()).thenReturn(userId); businessAdminPreprocessor.preprocess(dataSetLookup); assertEquals("TASKID = -1", dataSetLookup.getFirstFilterOp().getColumnFilterList().get(0).toString()); }
Source:
String getPathToImageDirectory() { return Utils.buildPath(Utils.buildProjectPath(ProjectManager.getInstance().getCurrentProject().getName()), getSceneNameByLookData(), Constants.IMAGE_DIRECTORY); }

Target:
String getPathToImageDirectory() { return Utils.buildPath(Utils.buildScenePath(ProjectManager.getInstance().getCurrentProject().getName(), getSceneNameByLookData()), Constants.IMAGE_DIRECTORY); }
Source:
public boolean doSupportClouderaNavigator() { return true; }

Target:
public boolean doSupportClouderaNavigator() { return false; }
Source:
public LockResource lockShared() throws InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Thread-%d entered lockShared().", Thread.currentThread().getId()); } long exclusiveOnlyRemainingMs = mExclusiveOnlyDeadlineMs - System.currentTimeMillis(); if (exclusiveOnlyRemainingMs > 0) { String safeModeMsg = String.format( "Master still in exclusive-only phase (%dms remaining) for the state-lock. " + "Please see documentation for %s.", exclusiveOnlyRemainingMs, PropertyKey.Name.MASTER_BACKUP_STATE_LOCK_EXCLUSIVE_DURATION); throw new IllegalStateException(safeModeMsg); } mSharedWaitersAndHolders.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedWaitersAndHolders.remove(Thread.currentThread()); }); }

Target:
public LockResource lockShared() throws InterruptedException { LOG.debug("Thread-{} entered lockShared().", ThreadUtils.getCurrentThreadIdentifier()); long exclusiveOnlyRemainingMs = mExclusiveOnlyDeadlineMs - System.currentTimeMillis(); if (exclusiveOnlyRemainingMs > 0) { String safeModeMsg = String.format( "Master still in exclusive-only phase (%dms remaining) for the state-lock. " + "Please see documentation for %s.", exclusiveOnlyRemainingMs, PropertyKey.Name.MASTER_BACKUP_STATE_LOCK_EXCLUSIVE_DURATION); throw new IllegalStateException(safeModeMsg); } mSharedWaitersAndHolders.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedWaitersAndHolders.remove(Thread.currentThread()); }); }
Source:
@Test public void testAddElementToQueueAboutToOverrun() throws IOException { QueueFile queue = new QueueFile(file); final int elementSize = QueueFile.MAX_ELEMENT_SIZE / 2; byte[] expected = new byte[elementSize]; for (int i = 0; i < (Integer.MAX_VALUE / 2 / elementSize - 1); i++) { queue.add(expected); } try { queue.add(expected); fail("Should have failed with IllegalArgumentException for element too large."); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Cannot add data of length " + elementSize + " to the " + "queue which already has a length of " + (Integer.MAX_VALUE / 2 + 1) + ". The max file size is " + "1,073,741,823 (half of Integer.MAX_VALUE)."); } finally { queue.close(); } }

Target:
@Test public void testAddElementToQueueAboutToOverrun() throws IOException { QueueFile queue = new QueueFile(file); final int elementSize = Integer.MAX_VALUE / 8; byte[] expected = new byte[elementSize]; for (int i = 0; i < (Integer.MAX_VALUE / 2 / elementSize - 1); i++) { queue.add(expected); } try { queue.add(expected); fail("Should have failed with IllegalArgumentException for element too large."); } catch (IllegalArgumentException e) { String message = e.getMessage(); assertThat(message).contains("Cannot add data of length " + elementSize); } finally { queue.close(); } }
Source:
public void createInstructorAccount(String googleId, String courseId, String name, String email, Boolean isArchived, String roleParam, boolean isDisplayedToStudents, String displayedNameParam, String privileges, String institute) throws EntityAlreadyExistsException, InvalidParametersException { Assumption.assertNotNull(googleId); Assumption.assertNotNull(courseId); Assumption.assertNotNull(name); Assumption.assertNotNull(email); Assumption.assertNotNull(institute); if (accountsLogic.getAccount(googleId) == null) { AccountAttributes account = new AccountAttributes(googleId, name, true, email, institute); accountsLogic.createAccount(account); } InstructorAttributes instructor = InstructorAttributes.builder(googleId, courseId, name, email) .withRole(roleParam).withDisplayedName(displayedNameParam) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents) .withIsArchived(isArchived) .build(); if (privileges == null && roleParam != null) { instructor.privileges = new InstructorPrivileges(roleParam); } instructorsLogic.createInstructor(instructor); }

Target:
public void createInstructorAccount(String googleId, String courseId, String name, String email, Boolean isArchived, String roleParam, boolean isDisplayedToStudents, String displayedNameParam, String privileges, String institute) throws EntityAlreadyExistsException, InvalidParametersException { Assumption.assertNotNull(googleId); Assumption.assertNotNull(courseId); Assumption.assertNotNull(name); Assumption.assertNotNull(email); Assumption.assertNotNull(institute); if (accountsLogic.getAccount(googleId) == null) { AccountAttributes account = new AccountAttributes(googleId, name, true, email, institute); accountsLogic.createAccount(account); } InstructorAttributes instructor = InstructorAttributes.builder(googleId, courseId, name, email) .withRole(roleParam).withDisplayedName(displayedNameParam) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents) .withIsArchived(isArchived) .build(); instructorsLogic.createInstructor(instructor); }
Source:
public void process(IncomingMessageEnvelope envelope, ReadableCoordinator coordinator, TaskCallbackFactory callbackFactory) { TaskCallback callback = callbackFactory.createCallback(); this.metrics.processes().inc(); try { this.taskSideInputHandler.process(envelope); this.metrics.messagesActuallyProcessed().inc(); callback.complete(); } catch (Exception e) { callback.failure(e); } }

Target:
synchronized public void process(IncomingMessageEnvelope envelope, ReadableCoordinator coordinator, TaskCallbackFactory callbackFactory) { TaskCallback callback = callbackFactory.createCallback(); this.metrics.processes().inc(); try { this.taskSideInputHandler.process(envelope); this.metrics.messagesActuallyProcessed().inc(); callback.complete(); } catch (Exception e) { callback.failure(e); } }
Source:
public Mono<Void> cancelScheduledMessage(long sequenceNumber) { return isAuthorized(CANCEL_SCHEDULED_MESSAGE_OPERATION).thenMany(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(CANCEL_SCHEDULED_MESSAGE_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(SEQUENCE_NUMBERS, new Long[]{sequenceNumber}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode == AmqpResponseCode.OK.getValue()) { return Mono.empty(); } return Mono.error(new AmqpException(false, "Could not cancel scheduled message with sequence number " + sequenceNumber, getErrorContext())); })).then(); }

Target:
public Mono<Void> cancelScheduledMessage(long sequenceNumber) { return isAuthorized(CANCEL_SCHEDULED_MESSAGE_OPERATION).then(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(CANCEL_SCHEDULED_MESSAGE_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(SEQUENCE_NUMBERS, new Long[]{sequenceNumber}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode == AmqpResponseCode.OK.getValue()) { return Mono.empty(); } return Mono.error(new AmqpException(false, "Could not cancel scheduled message with sequence number " + sequenceNumber, getErrorContext())); })).then(); }
Source:
public String toString() { return getLang(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getLang()).append(" (").append(this.confidence).append(")"); return sb.toString(); }
Source:
public Map<Integer, Integer> getSitesPerHostMapFromZK() throws KeeperException, InterruptedException, JSONException { Map<Integer, Integer> sphMap = new HashMap<>(); List<String> children = m_zk.getChildren(CoreZK.hosts, false); for (String child : children) { byte[] payload = m_zk.getData( ZKUtil.joinZKPath(CoreZK.hosts, child), false, new Stat()); final HostInfo info = HostInfo.fromBytes(payload); sphMap.put(parseHostId(child), info.m_localSitesCount); } return sphMap; }

Target:
public Map<Integer, Integer> getSitesPerHostMapFromZK() throws KeeperException, InterruptedException, JSONException { Map<Integer, Integer> sphMap = Maps.newHashMap(); List<String> children = m_zk.getChildren(CoreZK.hosts, false); Queue<ZKUtil.ByteArrayCallback> callbacks = new ArrayDeque<ZKUtil.ByteArrayCallback>(); for (int i = 0; i < children.size() - 1; i++) { ZKUtil.ByteArrayCallback cb = new ZKUtil.ByteArrayCallback(); m_zk.getData(ZKUtil.joinZKPath(CoreZK.hosts, children.get(i)), false, cb, null); callbacks.offer(cb); } ZKUtil.ByteArrayCallback lastCallback = new ZKUtil.ByteArrayCallback(); String lastChild = children.get(children.size() - 1); m_zk.getData(ZKUtil.joinZKPath(CoreZK.hosts, lastChild), false, lastCallback, null); byte[] lastPayload = lastCallback.getData(); final HostInfo lastOne = HostInfo.fromBytes(lastPayload); sphMap.put(parseHostId(lastChild), lastOne.m_localSitesCount); for (int i = 0; i < children.size() - 1; i++) { byte[] payload = callbacks.poll().getData(); final HostInfo info = HostInfo.fromBytes(payload); sphMap.put(parseHostId(children.get(i)), info.m_localSitesCount); } return sphMap; }
Source:
private VirtualFile createPlaceholder(VirtualFile parent, String name) { MutableVirtualFile file = new MutableVirtualFile(parent, name); file.withCanProvideOutputStream(ignored -> true); file.withDirectoryFlagSupplier(ignored -> false); file.withOutputStreamSupplier(ignored -> { VirtualFile storedFile = createFile(name); JobPreset jobPreset = getPreset(parent); OutputStream out = storedFile.createOutputStream(); return overrideOutputStream(out, jobPreset, storedFile); }); return file; }

Target:
private VirtualFile createPlaceholder(VirtualFile parent, String name) { MutableVirtualFile placeholder = new MutableVirtualFile(parent, name); placeholder.withCanProvideOutputStream(ignored -> true); placeholder.withDirectoryFlagSupplier(ignored -> false); placeholder.withOutputStreamSupplier(ignored -> { VirtualFile storedFile = createFile(name); JobPreset jobPreset = getPreset(parent); OutputStream out = storedFile.createOutputStream(); return overrideOutputStream(out, jobPreset, storedFile); }); return placeholder; }
Source:
public void close() { if (httpClient != null) { httpClient.close(); } }

Target:
public void close() { httpClient.close(); }
Source:
protected String makeFieldKey(String schema, String element, String qualifier) { if (StringUtils.isBlank(qualifier)) { return schema + "_" + element; } else { return schema + "_" + element + "_" + qualifier; } }

Target:
protected String makeFieldKey(String schema, String element, String qualifier) { return Utils.standardize(schema, element, qualifier, "_"); }