auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DefaultApiRequestAuthenticator(Application application, HttpRequest httpRequest) { Assert.notNull(application, "application argument cannot be null."); Assert.notNull(httpRequest, "httpRequest argument cannot be null."); this.application = application; if (HttpRequest.class.isAssignableFrom(httpRequest.getClass())) { this.httpRequest = (HttpRequest) httpRequest; } else { Assert.isInstanceOf(com.stormpath.sdk.impl.http.ServletHttpRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HttpRequest.class.getName() + " or " + ServletHttpRequest.class.getName()); this.httpRequest = (ServletHttpRequest) httpRequest; } }

Target:
public DefaultApiRequestAuthenticator(Application application, HttpRequest httpRequest) { Assert.notNull(application, "application argument cannot be null."); Assert.notNull(httpRequest, "httpRequest argument cannot be null."); this.application = application; if (HttpRequest.class.isAssignableFrom(httpRequest.getClass())) { this.httpRequest = httpRequest; } else { Assert.isInstanceOf(com.stormpath.sdk.impl.http.ServletHttpRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HttpRequest.class.getName() + " or " + ServletHttpRequest.class.getName()); this.httpRequest = httpRequest; } }
Source:
private void tryReopenClientConnection() throws IOException { if (writer == null) { LOG.debug("Trying to reopen stream writer ", streamName); try { createStreamClient(); } catch (IOException e) { LOG.error("Error during reopening client by name: for host: {}, port: {}. Reason: ", new Object[]{streamName, host, port, e.getMessage(), e}); throw new IOException(e); } } }

Target:
private void tryReopenClientConnection() throws IOException { if (writer == null) { LOG.debug("Trying to reopen stream writer ", streamName); try { createStreamClient(); } catch (IOException e) { LOG.error("Error during reopening client by name: for host: {}, port: {}. Reason: ", new Object[]{streamName, host, port, e.getMessage(), e}); throw e; } } }
Source:
public void init(Shell splash) { super.init(splash); String progressString = null; String messageString = null; IProduct product = Platform.getProduct(); if(product != null) { progressString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); } Rectangle progressRect = StringConverter.asRectangle(progressString, new Rectangle(10, 300, 480, 15)); setProgressRect(progressRect); Rectangle messageRect = StringConverter.asRectangle(messageString, new Rectangle(10, 280, 490, 0)); setMessageRect(messageRect); try { setForeground(getSplash().getDisplay().getSystemColor(SWT.COLOR_WHITE).getRGB()); } catch(IllegalArgumentException e) { } getContent().addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { e.gc.setForeground(getForeground()); e.gc.drawText( NLS.bind(Messages.SplahScreen_VersionString, TracingRcpPlugin.getDefault().getBundle().getVersion().toString()), VERSION_LOCATION.x, VERSION_LOCATION.y, true); } }); }

Target:
public void init(Shell splash) { super.init(splash); String progressString = null; String messageString = null; IProduct product = Platform.getProduct(); if(product != null) { progressString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); messageString = product.getProperty(IProductConstants.STARTUP_MESSAGE_RECT); } Rectangle progressRect = StringConverter.asRectangle(progressString, new Rectangle(10, 300, 480, 15)); setProgressRect(progressRect); Rectangle messageRect = StringConverter.asRectangle(messageString, new Rectangle(10, 280, 490, 0)); setMessageRect(messageRect); try { setForeground(getSplash().getDisplay().getSystemColor(SWT.COLOR_WHITE).getRGB()); } catch(IllegalArgumentException e) { } getContent().addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { e.gc.setForeground(getForeground()); e.gc.drawText( NLS.bind(Messages.SplahScreen_VersionString, TracingRcpPlugin.getDefault().getBundle().getVersion().toString()), VERSION_LOCATION.x, VERSION_LOCATION.y, true); } }); }
Source:
public void createActionArea(final Composite parent) { final Composite createButton = new Composite(parent, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(createButton); GridLayoutFactory.fillDefaults().margins(7, 7).applyTo(createButton); createButton.setBackground(getBackground()); final Label createLabel = new Label(createButton, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(createLabel); createLabel.setBackground(getBackground()); createLabel.setText(Messages.TargetSelector_CreateNewTarget); MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(org.eclipse.swt.events.MouseEvent event) { NewWizardAction newWizardAction = new NewWizardAction( PlatformUI.getWorkbench().getActiveWorkbenchWindow()); newWizardAction.setCategoryId("org.eclipse.launchbar.ui.targetWizards"); newWizardAction.run(); } }; createButton.addMouseListener(mouseListener); createLabel.addMouseListener(mouseListener); MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { Color highlightColor = getHighlightColor(); createButton.setBackground(highlightColor); createLabel.setBackground(highlightColor); } @Override public void mouseExit(MouseEvent e) { Color backgroundColor = getBackground(); createButton.setBackground(backgroundColor); createLabel.setBackground(backgroundColor); } }; createButton.addMouseTrackListener(mouseTrackListener); createLabel.addMouseTrackListener(mouseTrackListener); }

Target:
public void createActionArea(final Composite parent) { final Composite createButton = new Composite(parent, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(createButton); GridLayoutFactory.fillDefaults().margins(7, 7).applyTo(createButton); createButton.setBackground(getBackground()); final Label createLabel = new Label(createButton, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(createLabel); createLabel.setBackground(getBackground()); createLabel.setText(Messages.TargetSelector_CreateNewTarget); MouseListener mouseListener = new MouseAdapter() { @Override public void mouseUp(org.eclipse.swt.events.MouseEvent event) { NewLaunchTargetWizardAction newWizardAction = new NewLaunchTargetWizardAction( PlatformUI.getWorkbench().getActiveWorkbenchWindow(), targetUIManager.getLaunchTargetWizards()); newWizardAction.run(); } }; createButton.addMouseListener(mouseListener); createLabel.addMouseListener(mouseListener); MouseTrackListener mouseTrackListener = new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { Color highlightColor = getHighlightColor(); createButton.setBackground(highlightColor); createLabel.setBackground(highlightColor); } @Override public void mouseExit(MouseEvent e) { Color backgroundColor = getBackground(); createButton.setBackground(backgroundColor); createLabel.setBackground(backgroundColor); } }; createButton.addMouseTrackListener(mouseTrackListener); createLabel.addMouseTrackListener(mouseTrackListener); }
Source:
public void processSoftwareCapabilities(VDS vds) { if (vds.getKvmEnabled() != null && vds.getKvmEnabled().equals(false) && vds.getStatus() != VDSStatus.NonOperational) { vdsNonOperational(vds, NonOperationalReason.KVM_NOT_RUNNING, null); vds.setStatus(VDSStatus.NonOperational); } VDSGroup vdsGroup = DbFacade.getInstance().getVdsGroupDao().get(vds.getVdsGroupId()); if (!hostCompliesWithClusterEmulationMode(vds, vdsGroup) && vds.getStatus() != VDSStatus.NonOperational) { Map<String, String> customLogValues = new HashMap<>(); customLogValues.put("hostSupportedEmulatedMachines", vds.getSupportedEmulatedMachines()); customLogValues.put("clusterEmulatedMachines", StringUtils.isEmpty(vdsGroup.getEmulatedMachine()) ? Config.<String>GetValue(ConfigValues.ClusterEmulatedMachines, vds.getVdsGroupCompatibilityVersion().getValue()) : vdsGroup.getEmulatedMachine()); vdsNonOperational(vds, NonOperationalReason.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER, customLogValues); vds.setStatus(VDSStatus.NonOperational); } }

Target:
public void processSoftwareCapabilities(VDS vds) { if (vds.getKvmEnabled() != null && vds.getKvmEnabled().equals(false) && vds.getStatus() != VDSStatus.NonOperational) { vdsNonOperational(vds, NonOperationalReason.KVM_NOT_RUNNING, null); vds.setStatus(VDSStatus.NonOperational); } VDSGroup vdsGroup = vdsGroupDao.get(vds.getVdsGroupId()); if (!hostCompliesWithClusterEmulationMode(vds, vdsGroup) && vds.getStatus() != VDSStatus.NonOperational) { Map<String, String> customLogValues = new HashMap<>(); customLogValues.put("hostSupportedEmulatedMachines", vds.getSupportedEmulatedMachines()); customLogValues.put("clusterEmulatedMachines", StringUtils.isEmpty(vdsGroup.getEmulatedMachine()) ? Config.<String>GetValue(ConfigValues.ClusterEmulatedMachines, vds.getVdsGroupCompatibilityVersion().getValue()) : vdsGroup.getEmulatedMachine()); vdsNonOperational(vds, NonOperationalReason.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER, customLogValues); vds.setStatus(VDSStatus.NonOperational); } }
Source:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { ensureDirectory(); String name = getDirectory() + FILE_SEPARATOR + getFileName() + '.' + getFileExtension(); DateFormat dateFormat = new SimpleDateFormat(getFormat()); PrintWriter writer = null; try { writer = new PrintWriter(new BufferedWriter(new FileWriter(name))); writer.println(dateFormat.format(new Date())); } finally { if (writer != null) { writer.close(); } } return RepeatStatus.FINISHED; }

Target:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws IOException { ensureDirectory(); String name = directory + FILE_SEPARATOR + fileName + '.' + fileExtension; DateFormat dateFormat = new SimpleDateFormat(format); PrintWriter writer = null; try { writer = new PrintWriter(new BufferedWriter(new FileWriter(name))); writer.println(dateFormat.format(new Date())); } finally { if (writer != null) { writer.close(); } } return RepeatStatus.FINISHED; }
Source:
public void applyWritableMetadata(List<String> metadataKeys, DataType consumedDataType) { this.consumedDataType = consumedDataType; this.metadataKeys = metadataKeys; }

Target:
public void applyWritableMetadata(List<String> metadataKeys, DataType consumedDataType) { this.metadataKeys = metadataKeys; }
Source:
void set(CommentLinkProcessor commentLinkProcessor, ChangeInfo change, String revision) { RevisionInfo revInfo = change.revision(revision); CommitInfo commit = revInfo.commit(); String sub = commit.subject(); String msg = commit.message(); if (msg.startsWith(sub)) { msg = msg.substring(sub.length()); if (msg.length() > 0 && msg.charAt(0) == '\n') { msg = msg.substring(1); } } commitName.setText("Commit-Id: " + revision); commitName.setPreviewText(revision); idText.setText("Change-Id: " + change.change_id()); idText.setPreviewText(change.change_id()); formatLink(commit.author(), authorNameEmail, authorDate, change.status()); formatLink(commit.committer(), committerNameEmail, committerDate, change.status()); text.setHTML(commentLinkProcessor.apply( new SafeHtmlBuilder().append(msg).linkify())); GitwebLink gw = Gerrit.getGitwebLink(); if (gw != null && gw.canLink(revInfo)) { browserLink.setInnerText(gw.getLinkName()); browserLink.setHref(gw.toRevision(change.project(), revision)); } else { UIObject.setVisible(browserLink, false); } }

Target:
void set(CommentLinkProcessor commentLinkProcessor, ChangeInfo change, String revision) { RevisionInfo revInfo = change.revision(revision); CommitInfo commit = revInfo.commit(); String sub = commit.subject(); String msg = commit.message(); if (msg.startsWith(sub)) { msg = msg.substring(sub.length()); if (msg.length() > 0 && msg.charAt(0) == '\n') { msg = msg.substring(1); } } commitName.setText(revision); commitName.setPreviewText(revision); idText.setText("Change-Id: " + change.change_id()); idText.setPreviewText(change.change_id()); formatLink(commit.author(), authorNameEmail, authorDate, change.status()); formatLink(commit.committer(), committerNameEmail, committerDate, change.status()); text.setHTML(commentLinkProcessor.apply( new SafeHtmlBuilder().append(msg).linkify())); GitwebLink gw = Gerrit.getGitwebLink(); if (gw != null && gw.canLink(revInfo)) { browserLink.setInnerText(gw.getLinkName()); browserLink.setHref(gw.toRevision(change.project(), revision)); } else { UIObject.setVisible(browserLink, false); } }
Source:
public void testGitHubBug207() throws Exception { String c = IOUtils.toString(this.getClass().getResourceAsStream("GitHubBug207.java"), StandardCharsets.UTF_8); parseJava18(c); }

Target:
public void testGitHubBug207() { String c = readAsString("GitHubBug207.java"); parseJava18(c); }
Source:
private ISYBindingConfig parseConfig(final Item item, final String bindingConfig) throws BindingConfigParseException { ISYNodeType type; String controller = null; String address = null; ISYControl command = null; if (item instanceof GroupItem) { type = ISYNodeType.GROUP; } else if (item instanceof ContactItem) { type = ISYNodeType.CONTACT; } else if (item instanceof NumberItem) { type = ISYNodeType.NUMBER; } else if (item instanceof StringItem) { type = ISYNodeType.STRING; } else if (item instanceof DimmerItem) { type = ISYNodeType.DIMMER; } else if (item instanceof DateTimeItem) { type = ISYNodeType.HEARTBEAT; } else { type = ISYNodeType.SWITCH; } String[] arr = bindingConfig.split(","); for (String str : arr) { String[] pair = str.split("="); String key = pair[0]; String value = pair[1]; switch (key) { case "ctrl": controller = value.replace('.', ' '); break; case "addr": address = value.replace('.', ' '); break; case "type": if ("thermostat".equalsIgnoreCase(value)) { type = ISYNodeType.THERMOSTAT; } if ("lock".equalsIgnoreCase(value)) { type = ISYNodeType.LOCK; } if ("heartbeat".equalsIgnoreCase(value)) { type = ISYNodeType.HEARTBEAT; } break; case "cmd": try { command = ISYControl.valueOf(value.toUpperCase()); } catch (IllegalArgumentException ie) { throw new BindingConfigParseException("Unsupported cmd " + value.toString()); } break; } } if (address == null) { address = controller; } return new ISYBindingConfig(item, type, controller, address, command); }

Target:
private ISYBindingConfig parseConfig(final Item item, final String bindingConfig) throws BindingConfigParseException { ISYNodeType type; String controller = null; String address = null; ISYControl command = null; if (item instanceof GroupItem) { type = ISYNodeType.GROUP; } else if (item instanceof ContactItem) { type = ISYNodeType.CONTACT; } else if (item instanceof NumberItem) { type = ISYNodeType.NUMBER; } else if (item instanceof StringItem) { type = ISYNodeType.STRING; } else if (item instanceof DimmerItem) { type = ISYNodeType.DIMMER; } else if (item instanceof DateTimeItem) { type = ISYNodeType.HEARTBEAT; } else { type = ISYNodeType.SWITCH; } String[] arr = bindingConfig.split(","); for (String str : arr) { String[] pair = str.split("="); String key = pair[0]; String value = pair[1]; switch (key) { case "ctrl": controller = value.replace('.', ' '); break; case "addr": address = value.replace('.', ' '); break; case "type": if ("thermostat".equalsIgnoreCase(value)) { type = ISYNodeType.THERMOSTAT; } else if ("lock".equalsIgnoreCase(value)) { type = ISYNodeType.LOCK; } else if ("heartbeat".equalsIgnoreCase(value)) { type = ISYNodeType.HEARTBEAT; } break; case "cmd": try { command = ISYControl.valueOf(value.toUpperCase()); } catch (IllegalArgumentException ie) { throw new BindingConfigParseException("Unsupported cmd " + value.toString()); } break; } } if (address == null) { address = controller; } return new ISYBindingConfig(item, type, controller, address, command); }
Source:
public String getAppEngineVersion() { return APP_ENGINE_RUNTIME_VERSION; }

Target:
public String getAppEngineVersion() { return appEngineRuntimeVersion; }
Source:
public List<TestFitnessFunction> getCoverageGoals() { String className = Properties.TARGET_CLASS; Class<?> targetClass = Properties.getInitializedTargetClass(); BranchPool bpinstance = BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()); List<TestFitnessFunction> goals = new ArrayList<TestFitnessFunction>(); if (targetClass != null) { for (String methodName : bpinstance.getBranchlessMethods(className)) { goals.add(createRootBranchTestFitness(className, methodName)); } for (String methodName : bpinstance.knownMethods(className)) { for (Branch b : bpinstance.retrieveBranchesInMethod(className, methodName)) { if (!(b.getInstruction().isForcedBranch())) { goals.add(createBranchCoverageTestFitness(b, true)); goals.add(createBranchCoverageTestFitness(b, false)); } } } } goals.add(new UnreachableBranchCoverageTestFitness()); return goals; }

Target:
public List<TestFitnessFunction> getCoverageGoals() { String className = Properties.TARGET_CLASS; Class<?> targetClass = Properties.getInitializedTargetClass(); BranchPool bpinstance = BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()); List<TestFitnessFunction> goals = new ArrayList<TestFitnessFunction>(); if (targetClass != null) { for (String methodName : bpinstance.getBranchlessMethods(className)) { goals.add(createRootBranchTestFitness(className, methodName)); } for (String methodName : bpinstance.knownMethods(className)) { for (Branch b : bpinstance.retrieveBranchesInMethod(className, methodName)) { if (!b.isInstrumented()) { goals.add(createBranchCoverageTestFitness(b, true)); goals.add(createBranchCoverageTestFitness(b, false)); } } } } goals.add(new UnreachableBranchCoverageTestFitness()); return goals; }
Source:
TableMetaStore createTableMetaStore() throws Exception; interface TableMetaStore extends Closeable { Path getLocationPath(); Optional<Path> getPartition(LinkedHashMap<String, String> partitionSpec) throws Exception; void createPartition(LinkedHashMap<String, String> partitionSpec, Path partitionPath) throws Exception; default void alterPartition(LinkedHashMap<String, String> partitionSpec, Path partitionPath) throws Exception { } }

Target:
TableMetaStore createTableMetaStore() throws Exception; interface TableMetaStore extends Closeable { Path getLocationPath(); Optional<Path> getPartition(LinkedHashMap<String, String> partitionSpec) throws Exception; void createOrAlterPartition(LinkedHashMap<String, String> partitionSpec, Path partitionPath) throws Exception; }
Source:
public void setLabel(String label) { if (!label.isEmpty()) { this.label = label; } }

Target:
public void setLabel(String label) { if (label != null && !label.isEmpty()) { this.label = label; } }
Source:
public void writeGuestbookAndStartDownload(GuestbookResponse guestbookResponse) { boolean valid = validateGuestbookResponse(guestbookResponse); if (!valid) { JH.addMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("dataset.message.validationError")); } else { PrimeFaces.current().executeScript("PF('downloadPopup').hide()"); guestbookResponse.setDownloadtype("Download"); if (guestbookResponse.getSelectedFileIds() != null) { fileDownloadService.writeGuestbookAndStartBatchDownload(guestbookResponse); } else if (guestbookResponse.getDataFile() != null) { fileDownloadService.writeGuestbookAndStartFileDownload(guestbookResponse); } } }

Target:
public void writeGuestbookAndStartDownload(GuestbookResponse guestbookResponse) { PrimeFaces.current().executeScript("PF('downloadPopup').hide()"); guestbookResponse.setDownloadtype("Download"); if (guestbookResponse.getSelectedFileIds() != null) { fileDownloadService.writeGuestbookAndStartBatchDownload(guestbookResponse); } else if (guestbookResponse.getDataFile() != null) { fileDownloadService.writeGuestbookAndStartFileDownload(guestbookResponse); } }
Source:
public void setBandwidth(long bandwidth) { this.bandwidthLimit = bandwidth; LOG.info("Bandwidth limit is set to: " + bandwidth + " bytes/sec"); }

Target:
public void setBandwidth(long bandwidth) { this.bandwidthLimit = bandwidth; LOG.debug("Bandwidth limit is set to: " + bandwidth + " bytes/sec"); }
Source:
public boolean isAppLauncherEmpty() { return view.isAppLauncherEmpty(); }

Target:
public boolean isAppLauncherEmpty() { return appLauncherAddEvents.isEmpty(); }
Source:
public void testSavesIterations() throws Exception { Bundle b = new Bundle(); b.putString("include-ui-xml", "true"); mListener = initListener(b); mListener.testRunStarted(mRunDesc); verify(mListener).createAndEmptyDirectory(ScreenshotOnFailureCollector.DEFAULT_DIR); for (int i = 1; i <= NUM_TEST_CASE; i++) { mListener.testStarted(mTestDesc); mListener.testFailure(new Failure(mTestDesc, new RuntimeException("I failed"))); mListener.testFinished(mTestDesc); } mListener.testRunFinished(new Result()); InOrder screenshotSaveVerifier = inOrder(mListener); for (int i = 0; i < NUM_TEST_CASE; i++) { screenshotSaveVerifier .verify(mListener) .takeScreenshot(endsWith(String.format("%d.png", i + 1))); } InOrder xmlSaveVerifier = inOrder(mListener); for (int i = 0; i < NUM_TEST_CASE; i++) { xmlSaveVerifier.verify(mListener).collectUiXml(endsWith(String.valueOf(i + 1))); } }

Target:
public void testSavesIterations() throws Exception { Bundle b = new Bundle(); b.putString("include-ui-xml", "true"); mListener = initListener(b); mListener.testRunStarted(mRunDesc); verify(mListener).createAndEmptyDirectory(ScreenshotOnFailureCollector.DEFAULT_DIR); for (int i = 1; i <= NUM_TEST_CASE; i++) { mListener.testStarted(mTestDesc); mListener.testFailure(new Failure(mTestDesc, new RuntimeException("I failed"))); mListener.testFinished(mTestDesc); } mListener.testRunFinished(new Result()); InOrder screenshotSaveVerifier = inOrder(mListener); screenshotSaveVerifier.verify(mListener).takeScreenshot(matches("^.*[^1].png$")); for (int i = 1; i < NUM_TEST_CASE; i++) { screenshotSaveVerifier .verify(mListener) .takeScreenshot(endsWith(String.format("%d.png", i + 1))); } InOrder xmlSaveVerifier = inOrder(mListener); xmlSaveVerifier.verify(mListener).takeScreenshot(matches("^.*[^1]$")); for (int i = 1; i < NUM_TEST_CASE; i++) { xmlSaveVerifier.verify(mListener).collectUiXml(endsWith(String.valueOf(i + 1))); } }
Source:
private void saveSubModulePOMs() throws IOException, XmlPullParserException { if (content.isMultiModule() && content.getModules() != null) { for (final String module : content.getModules()) { final org.uberfire.java.nio.file.Path childPath = Paths.convert(path).getParent().resolve(module).resolve("pom.xml"); if (ioService.exists(childPath)) { final POM child = load(Paths.convert(childPath)); if (child != null) { child.setParent(content.getGav()); child.getGav().setGroupId(content.getGav().getGroupId()); child.getGav().setVersion(content.getGav().getVersion()); savePOM(Paths.convert(childPath), child, null); } } } } }

Target:
private void saveSubModulePOMs() throws IOException, XmlPullParserException { if (pom.isMultiModule() && pom.getModules() != null) { for (final String childModuleName : pom.getModules()) { saveGAVChange(pom.getGav(), childModuleName); } } }
Source:
public void createOrUpdateCounter(String classSimpleName, String key, String metricName, long value) { validateArguments(classSimpleName, metricName); Counter counter = (Counter) checkCache(classSimpleName, key, metricName).orElseGet(() -> _metricRegistry.counter(MetricRegistry.name(classSimpleName, key, metricName))); counter.inc(value); updateCache(classSimpleName, key, metricName, counter); }

Target:
public void createOrUpdateCounter(String classSimpleName, String key, String metricName, long value) { validateArguments(classSimpleName, metricName); Counter counter = (Counter) checkCache(classSimpleName, key, metricName).orElseGet(() -> { Counter newCounter = _metricRegistry.counter(MetricRegistry.name(classSimpleName, key, metricName)); updateCache(classSimpleName, key, metricName, newCounter); return newCounter; }); counter.inc(value); }
Source:
public User addUserCreatedOnBuddyRequest(UserDTO buddyUser, String tempPassword) { UUID savedUserID = CryptoSession.execute(Optional.of(tempPassword), null, () -> tempEncryptionContextExecutor.addUserCreatedOnBuddyRequest(buddyUser).getID()); User userEntity = getEntityByID(savedUserID); sendMobileNumberConfirmationMessage(userEntity); return userEntity; }

Target:
public User addUserCreatedOnBuddyRequest(UserDTO buddyUser, String tempPassword) { UUID savedUserID = CryptoSession.execute(Optional.of(tempPassword), null, () -> tempEncryptionContextExecutor.addUserCreatedOnBuddyRequest(buddyUser).getID()); User userEntity = getEntityByID(savedUserID); sendMobileNumberConfirmationMessage(userEntity, SmsService.TemplateName_InviteBuddyNumberConfirmation); return userEntity; }
Source:
public Expression getFullExpr() { Pair<Expression, Set<Block>> pair = this.getLocalExpr(); LetExpression fullExpr = new LetExpression(pair.a, false); Set<Block> surroundingBlocks = pair.b; block.container.ifPresent(container -> extendExprGraph(fullExpr, container, surroundingBlocks)); extendExprGraph(fullExpr, null, surroundingBlocks); surroundingBlocks.forEach(block -> block.extendExprGraph(fullExpr, null, new HashSet<>())); return fullExpr; }

Target:
public Expression getFullExpr() { Pair<Expression, Set<Block>> pair = this.getLocalExpr(); LetExpression fullExpr = new LetExpression(pair.a, false); Set<Block> surroundingBlocks = pair.b; block.container.ifPresent(c -> extendExprGraph(fullExpr, block.container, surroundingBlocks)); extendExprGraph(fullExpr, Optional.empty(), surroundingBlocks); surroundingBlocks.forEach(block -> block.extendExprGraph(fullExpr, Optional.empty(), new HashSet<>())); return fullExpr; }
Source:
public String paymentOverview(Model model, RedirectAttributes redirect, @PathVariable String key) { try { Order order = this.getOrderAndCheck(key); model.addAttribute(MODEL_ATTR_ORDER, order); model.addAttribute(MODEL_ATTR_CUSTOMER, authenticationService.getCurrentCustomer()); model.addAttribute("containsOnlyReservable", orderService.containsOnlyReservable(order)); if (order.getAmount() == 0.d) { order.setPaymentMethod(PaymentMethod.OTHER); orderService.updateOrderStatus(order, OrderStatus.PAID); return "redirect:/return/" + order.getPublicReference(); } if (order.getOwner().getRfidToken() == null || order.getOwner().getRfidToken().equals("")) { model.addAttribute( MODEL_ATTR_MESSAGE, "No card linked to your account! Link a card to your account, for an easier and faster check-in at the event(s)." ); } return "webshop/payment/index"; } catch (EventsException e) { redirect.addFlashAttribute(MODEL_ATTR_ERROR, e.getMessage()); return REDIRECT_EVENTS_HOME; } }

Target:
public String paymentOverview(Model model, RedirectAttributes redirect, @PathVariable String key) { try { Order order = this.getOrderAndCheck(key); model.addAttribute(MODEL_ATTR_ORDER, order); model.addAttribute(MODEL_ATTR_CUSTOMER, authenticationService.getCurrentCustomer()); model.addAttribute(MODEL_ATTR_RESERVABLE, orderService.containsOnlyReservable(order)); if (order.getAmount() == 0.d) { order.setPaymentMethod(PaymentMethod.OTHER); orderService.updateOrderStatus(order, OrderStatus.PAID); return "redirect:/return/" + order.getPublicReference(); } if (order.getOwner().getRfidToken() == null || order.getOwner().getRfidToken().equals("")) { model.addAttribute( MODEL_ATTR_MESSAGE, "No card linked to your account! Link a card to your account, for an easier and faster check-in at the event(s)." ); } return "webshop/payment/index"; } catch (EventsException e) { redirect.addFlashAttribute(MODEL_ATTR_ERROR, e.getMessage()); return REDIRECT_EVENTS_HOME; } }
Source:
public double convertAltitude(double value) { if (this == DEFAULT_UNIT_SYSTEM) { return value; } return value * 3.2808399; }

Target:
public double convertAltitude(double value) { if (this == DEFAULT_UNIT_SYSTEM) { return value; } return value * METERS_TO_FEET; }
Source:
public void dateFormatFunctionExtension11() throws InterruptedException { log.info("DateFormatFunctionExtensionTestCaseInvalidParameterTypeFirstArgumentLenghtTwo"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol string," + "dateValue int,sourceFormat string,timestampInMilliseconds long,targetFormat string);"; String query = ("@info(name = 'query1') from inputStream select symbol , " + "time:dateFormat(dateValue,targetFormat) as formattedDate," + "time:dateFormat(timestampInMilliseconds," + "targetFormat) as formattedUnixDate insert into outputStream;"); ExecutionPlanRuntime executionPlanRuntime = siddhiManager .createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }

Target:
public void dateFormatFunctionExtension11() throws InterruptedException { log.info("DateFormatFunctionExtensionTestCaseInvalidParameterTypeFirstArgumentLenghtTwo"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol string," + "dateValue int,sourceFormat string,timestampInMilliseconds long,targetFormat string);"; String query = ("@info(name = 'query1') from inputStream select symbol , " + "time:dateFormat(dateValue,targetFormat) as formattedDate," + "time:dateFormat(timestampInMilliseconds," + "targetFormat) as formattedUnixDate insert into outputStream;"); siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); }
Source:
public void testApplyWayTags() { Graph graph = initExampleGraph(); EdgeIteratorState edge0 = GHUtility.getEdge(graph, 0, 1); ReaderWay way0 = new ReaderWay(1); wheelchairEncoder.applyWayTags(way0, edge0); IntsRef flags0 = edge0.getFlags(); assertEquals(2, wheelchairEncoder.getSpeed(false, flags0), 1e-1); assertEquals(5, wheelchairEncoder.getSpeed(true, flags0), 1e-1); EdgeIteratorState edge1 = GHUtility.getEdge(graph, 2, 3); ReaderWay way1 = new ReaderWay(2); wheelchairEncoder.applyWayTags(way1, edge1); IntsRef flags1 = edge1.getFlags(); assertEquals(0, wheelchairEncoder.getSpeed(false, flags1), 1e-1); assertEquals(0, wheelchairEncoder.getSpeed(true, flags1), 1e-1); }

Target:
public void testApplyWayTags() { Graph graph = initExampleGraph(); EdgeIteratorState edge0 = GHUtility.getEdge(graph, 0, 1); ReaderWay way0 = new ReaderWay(1); wheelchairEncoder.applyWayTags(way0, edge0); assertTrue(edge0.get(wheelchairAccessEnc)); assertTrue(edge0.getReverse(wheelchairAccessEnc)); assertEquals(2, edge0.get(wheelchairEncoder.getAverageSpeedEnc()), 0); assertEquals(5, edge0.getReverse(wheelchairEncoder.getAverageSpeedEnc()), 0); EdgeIteratorState edge1 = GHUtility.getEdge(graph, 2, 3); ReaderWay way1 = new ReaderWay(2); wheelchairEncoder.applyWayTags(way1, edge1); assertFalse(edge1.get(wheelchairAccessEnc)); assertFalse(edge1.getReverse(wheelchairAccessEnc)); }
Source:
protected TmfXYChartViewer createChartViewer(Composite parent) { PatternScatterGraphViewer viewer = new PatternScatterGraphViewer(NonNullUtils.checkNotNull(parent), "Duration vs Time", "Time", "Duration"); fViewer = viewer; loadNewLatencyView(); return viewer; }

Target:
protected TmfXYChartViewer createChartViewer(Composite parent) { PatternScatterGraphViewer viewer = new PatternScatterGraphViewer(checkNotNull(parent), checkNotNull(Messages.PatternLatencyViews_ScatterGraphTitle), checkNotNull(Messages.PatternLatencyViews_ScatterGraphXLabel), checkNotNull(Messages.PatternLatencyViews_ScatterGraphYLabel)); fViewer = viewer; loadLatencyView(); return viewer; }
Source:
private void setUpFavTriggers() { Context context = this.getActivity(); SQLStore<Trigger> store = openStore(context); store.openSync(); Collection<Trigger> array = store.readAll(); triggers = new ArrayList<>(array); sortTriggers(this.triggers); list.setAdapter(new TriggersAdapter(getActivity(), this, triggers)); hideRefreshing(); if(triggers.isEmpty()){ showMessage(); } else{ showList(); } store.close(); }

Target:
private void setUpFavTriggers() { Context context = this.getActivity(); SQLStore<Trigger> store = openStore(context); store.openSync(); Collection<Trigger> array = store.readAll(); triggers = new ArrayList<>(array); sortTriggers(this.triggers); list.setAdapter(new TriggersAdapter(getActivity(), this, triggers)); hideRefreshing(); if(triggers.isEmpty()){ showMessage(); } else{ showList(); } }
Source:
private static String getPattern (String regex, String hgvs) { Pattern p = Pattern.compile(regex); Matcher m = p.matcher(hgvs); if (m.find()) return hgvs.substring(m.start(), m.end()); return null; }

Target:
private static String getPattern(String regex, String hgvs) { Pattern p = Pattern.compile(regex); Matcher m = p.matcher(hgvs); if (m.find()) { return hgvs.substring(m.start(), m.end()); } return null; }
Source:
private void setupChildren() { int tileSize = getResources().getDimensionPixelSize(R.dimen.mcv_default_tile_size); root = new LinearLayout(getContext()); root.setOrientation(LinearLayout.VERTICAL); root.setWeightSum(8); root.setClipChildren(false); root.setClipToPadding(false); LayoutParams p = new LayoutParams(tileSize * 7, tileSize * 8); p.gravity = Gravity.CENTER; addView(root, p); LinearLayout topbar = new LinearLayout(getContext()); topbar.setOrientation(LinearLayout.HORIZONTAL); topbar.setWeightSum(7); topbar.setClipChildren(false); topbar.setClipToPadding(false); root.addView(topbar, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0, 1)); buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonPast.setImageResource(R.drawable.mcv_action_previous); topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); title.setGravity(Gravity.CENTER); topbar.addView(title, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 5)); buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonFuture.setImageResource(R.drawable.mcv_action_next); topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); pager.setId(R.id.mcv_pager); pager.setOffscreenPageLimit(1); root.addView(pager, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0, 7)); }

Target:
private void setupChildren() { int tileSize = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, getResources().getInteger(R.integer.mcv_default_tile_size), getResources().getDisplayMetrics() ); root = new LinearLayout(getContext()); root.setOrientation(LinearLayout.VERTICAL); root.setClipChildren(false); root.setClipToPadding(false); LayoutParams p = new LayoutParams( tileSize * MonthView.DEFAULT_DAYS_IN_WEEK, tileSize * (MonthView.DEFAULT_MONTH_TILE_HEIGHT + 1) ); p.gravity = Gravity.CENTER; addView(root, p); LinearLayout topbar = new LinearLayout(getContext()); topbar.setOrientation(LinearLayout.HORIZONTAL); topbar.setClipChildren(false); topbar.setClipToPadding(false); root.addView(topbar, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0, 1)); buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonPast.setImageResource(R.drawable.mcv_action_previous); topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); title.setGravity(Gravity.CENTER); topbar.addView(title, new LinearLayout.LayoutParams( 0, LayoutParams.MATCH_PARENT, MonthView.DEFAULT_DAYS_IN_WEEK - 2 )); buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonFuture.setImageResource(R.drawable.mcv_action_next); topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); pager.setId(R.id.mcv_pager); pager.setOffscreenPageLimit(1); root.addView(pager, new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, 0, MonthView.DEFAULT_MONTH_TILE_HEIGHT )); }
Source:
public OutputStream write(URI uri) throws IOException { if (!fileExist(uri)) { boolean newFileCreated = new File(mapUriToKitodoDataDirectoryUri(uri)).createNewFile(); if (!newFileCreated) { logger.info("File was not created!"); } } return new FileOutputStream(new File(mapUriToKitodoDataDirectoryUri(uri))); }

Target:
public OutputStream write(URI uri) throws IOException { if (!fileExist(uri)) { boolean newFileCreated = new File(mapUriToKitodoDataDirectoryUri(uri)).createNewFile(); if (!newFileCreated) { logger.error("File was not created!"); throw new IOException( "File: " + new File(mapUriToKitodoDataDirectoryUri(uri)).getPath() + " couldn't be created!"); } } return new FileOutputStream(new File(mapUriToKitodoDataDirectoryUri(uri))); }
Source:
private void postDatabaseChanged() { synchronized (lock) { if (c4DBObserver == null || c4db == null || getC4Database().isInTransaction()) return; boolean external = false; int nChanges; List<String> docIDs = new ArrayList<>(); do { C4DatabaseChange[] c4DBChanges = c4DBObserver.getChanges(MAX_CHANGES); nChanges = c4DBChanges.length; boolean newExternal = nChanges > 0 ? c4DBChanges[0].isExternal() : false; if (c4DBChanges == null || c4DBChanges.length == 0 || external != newExternal || docIDs.size() > 1000) { if (docIDs.size() > 0) { DatabaseChange change = new DatabaseChange(this, docIDs); synchronized (dbListenerTokens) { for (DatabaseChangeListenerToken token : dbListenerTokens) token.notify(change); } docIDs = new ArrayList<>(); } } external = newExternal; for (int i = 0; i < nChanges; i++) docIDs.add(c4DBChanges[i].getDocID()); } while (nChanges > 0); } }

Target:
private void postDatabaseChanged() { synchronized (lock) { if (c4DBObserver == null || c4db == null || getC4Database().isInTransaction()) return; boolean external = false; int nChanges; List<String> docIDs = new ArrayList<>(); do { C4DatabaseChange[] c4DBChanges = c4DBObserver.getChanges(MAX_CHANGES); nChanges = c4DBChanges.length; boolean newExternal = nChanges > 0 ? c4DBChanges[0].isExternal() : false; if (c4DBChanges == null || c4DBChanges.length == 0 || external != newExternal || docIDs.size() > 1000) { if (docIDs.size() > 0) { DatabaseChange change = new DatabaseChange(this, docIDs); for (DatabaseChangeListenerToken token : dbListenerTokens) token.notify(change); docIDs = new ArrayList<>(); } } external = newExternal; for (int i = 0; i < nChanges; i++) docIDs.add(c4DBChanges[i].getDocID()); } while (nChanges > 0); } }
Source:
void parse(VoltXMLElement stmtNode) { assert(stmtNode.children.isEmpty()); assert(m_tableList.isEmpty()); String theName = stmtNode.attributes.get("thetable"); assert(theName != null); Table theTable = getTableFromDB(theName); if (theTable == null) { throw new PlanningErrorException("TABLE object not found: " + theName); } m_tableList.add(theTable); String otherName = stmtNode.attributes.get("othertable"); assert(otherName != null); Table otherTable = getTableFromDB(otherName); if (otherTable == null) { throw new PlanningErrorException("TABLE object not found: " + otherName); } m_tableList.add(otherTable); }

Target:
void parse(VoltXMLElement stmtNode) { assert(stmtNode.children.isEmpty()); assert(m_tableList.isEmpty()); addTabletoList(stmtNode, "thetable"); addTabletoList(stmtNode, "othertable"); }
Source:
public static String convertStreamToString(java.io.InputStream is) { java.util.Scanner scanner = null; String result=""; try { scanner = new java.util.Scanner(is).useDelimiter("\\A"); result = scanner.hasNext() ? scanner.next() : ""; scanner.close(); } finally { if(scanner!=null) scanner.close(); } return result; }

Target:
private static String convertStreamToString(java.io.InputStream is) { java.util.Scanner scanner = null; String result=""; try { scanner = new java.util.Scanner(is).useDelimiter("\\A"); result = scanner.hasNext() ? scanner.next() : ""; scanner.close(); } finally { if(scanner!=null) { scanner.close(); } } return result; }
Source:
private void editCatalog(String catalogName, String catalogFile, String description, boolean verify) { selectCatalog(catalogName); new PushButton(EDIT_CATALOG).click(); new DefaultCombo().setText(catalogFile); new LabeledText(CATALOG_DESCRIPTION).setText(description); if (verify) { new PushButton(VERIFY_BUTTON).click(); } new OkButton().click(); }

Target:
private String editCatalog(String catalogName, String catalogFile, String description, boolean verify) { String verificationResult = ""; selectCatalog(catalogName); new PushButton(EDIT_CATALOG).click(); new DefaultCombo().setText(catalogFile); new LabeledText(CATALOG_DESCRIPTION).setText(description); if (verify) { verificationResult = verifyURL(); } log.info(verificationResult); new OkButton().click(); return verificationResult; }
Source:
public List<LogicalNode> getLogicalNodes() { return logicalNodes; }

Target:
public List<LogicalNode> getLogicalNodes() { return this.logicalNodes; }
Source:
private void scheduleManagerUpdate(IContributionManager mgr) { if (this.mgrsToUpdate.isEmpty()) { Display display = context.get(Display.class); if (display == null || display.isDisposed()) { return; } display.asyncExec(new Runnable() { @Override public void run() { Collection<IContributionManager> toUpdate = new HashSet<>(mgrsToUpdate); mgrsToUpdate.clear(); for (IContributionManager mgr : toUpdate) { mgr.update(false); } } }); } this.mgrsToUpdate.add(mgr); }

Target:
private void scheduleManagerUpdate(IContributionManager mgr) { synchronized (mgrToUpdate) { if (this.mgrToUpdate.isEmpty()) { Display display = context.get(Display.class); if (display != null && !display.isDisposed()) { display.timerExec(100, new Runnable() { @Override public void run() { Collection<IContributionManager> toUpdate = new LinkedHashSet<>(); synchronized (mgrToUpdate) { toUpdate.addAll(mgrToUpdate); mgrToUpdate.clear(); } for (IContributionManager mgr : toUpdate) { mgr.update(false); } } }); } this.mgrToUpdate.add(mgr); } } }
Source:
private String equalFilterBuilder(String property, String value) { return "(" + property + "=" + value + ")"; }

Target:
private String equalFilterBuilder(String property, String value) { StringBuilder filter = new StringBuilder(); filter.append(OPEN_PARENTHESIS).append(property).append(EQUALS_SIGN).append(value).append(CLOSE_PARENTHESIS); return filter.toString(); }
Source:
public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Boolean>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of("healthy", healthCheck.getValue().isHealthy()))); boolean allHealthy = results.values().stream().allMatch(HealthCheck.Result::isHealthy); return (allHealthy ? Response.ok() : Response.status(503)).entity(response).build(); }

Target:
public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Boolean>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of("healthy", healthCheck.getValue().isHealthy()))); boolean allHealthy = results.values().stream().allMatch(HealthCheck.Result::isHealthy); Response.ResponseBuilder res = allHealthy ? Response.ok() : Response.status(503); return res.entity(response).build(); }
Source:
public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext, Query query, ExecutionBlockId finalExecBlockId, Path finalOutputDir) throws Exception { Stage lastStage = query.getStage(finalExecBlockId); TableMeta meta = lastStage.getTableMeta(); String nullChar = queryContext.get(SessionVars.NULL_CHAR); meta.putProperty(StorageConstants.TEXT_NULL, nullChar); TableStats stats = lastStage.getResultStats(); TableDesc resultTableDesc = new TableDesc( query.getId().toString(), lastStage.getOutSchema(), meta, finalOutputDir.toUri()); resultTableDesc.setExternal(true); if (query.hasUnionPlan()) { TableStats aggregated = query.aggregateTableStatsOfTerminalBlock(); stats.setNumRows(aggregated.getNumRows()); stats.setNumBytes(aggregated.getNumBytes()); } else { stats.setNumBytes(getTableVolume(query.systemConf, finalOutputDir)); } resultTableDesc.setStats(stats); query.setResultDesc(resultTableDesc); }

Target:
public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext, Query query, ExecutionBlockId finalExecBlockId, Path finalOutputDir) throws Exception { Stage lastStage = query.getStage(finalExecBlockId); TableMeta meta = lastStage.getTableMeta(); String nullChar = queryContext.get(SessionVars.NULL_CHAR); meta.putProperty(StorageConstants.TEXT_NULL, nullChar); TableStats stats = lastStage.getResultStats(); TableDesc resultTableDesc = new TableDesc( query.getId().toString(), lastStage.getOutSchema(), meta, finalOutputDir.toUri()); resultTableDesc.setExternal(true); if (query.hasUnionPlan()) { TableStats aggregated = query.aggregateTableStatsOfTerminalBlock(); resultTableDesc.setStats(aggregated); } else { stats.setNumBytes(getTableVolume(query.systemConf, finalOutputDir)); resultTableDesc.setStats(stats); } query.setResultDesc(resultTableDesc); }
Source:
default Map<Integer, Filter> getFilters() { return ImmutableMap.of(); }

Target:
default Map<Integer, Filter> getFilters() { throw new UnsupportedOperationException(); }
Source:
public void setup() { validator = spy(new NetworkValidator(network)); doReturn(dbFacade).when(validator).getDbFacade(); when(dbFacade.getStoragePoolDao()).thenReturn(dataCenterDao); when(dbFacade.getNetworkDao()).thenReturn(networkDao); when(dataCenterDao.get(any(Guid.class))).thenReturn(dataCenter); when(networkDao.getAllForDataCenter(any(Guid.class))).thenReturn(networks); Version version = mock(Version.class); when(version.getValue()).thenReturn(null); when(dataCenter.getcompatibility_version()).thenReturn(version); }

Target:
public void setup() { validator = spy(new NetworkValidator(network)); doReturn(dbFacade).when(validator).getDbFacade(); when(dbFacade.getStoragePoolDao()).thenReturn(dataCenterDao); when(dbFacade.getNetworkDao()).thenReturn(networkDao); when(dataCenterDao.get(any(Guid.class))).thenReturn(dataCenter); when(networkDao.getAllForDataCenter(any(Guid.class))).thenReturn(networks); Version version = mock(Version.class); when(dataCenter.getcompatibility_version()).thenReturn(version); }
Source:
public OneCoreTickCounters(Integer[] c) { fUser = c[0]; fNice = c[1]; fSystem = c[2]; fIdle = c[3]; fIowait = c[4]; fIrq = c[5]; fSoftirq = c[6]; }

Target:
public OneCoreTickCounters(Integer[] c) { assert (c != null && c.length >= 7); fUser = c[0]; fNice = c[1]; fSystem = c[2]; fIdle = c[3]; fIowait = c[4]; fIrq = c[5]; fSoftirq = c[6]; }
Source:
public ExpressionEvaluatingMessageHandler(Expression expression) { Assert.notNull(expression, "Expression must not be null"); this.processor = new ExpressionEvaluatingMessageProcessor<Void>(expression, Void.class); setPrimaryExpression(expression); }

Target:
public ExpressionEvaluatingMessageHandler(Expression expression) { Assert.notNull(expression, "'expression' must not be null"); this.processor = new ExpressionEvaluatingMessageProcessor<Void>(expression, Void.class); setPrimaryExpression(expression); }
Source:
protected void operations(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { monitor.beginTask("Task ID Update", IProgressMonitor.UNKNOWN); Map<ITask, ITask> map = new HashMap<>(); TaskActivityManager activityManager = TasksUiPlugin.getTaskActivityManager(); AbstractTaskContextStore contextStore = TasksUiPlugin.getContextStore(); TaskDataManager taskDataManager = TasksUiPlugin.getTaskDataManager(); for (ITask task : newTaskIdMap.keySet()) { ITask newTask = getTaskList().refactorTaskId(task, newTaskIdMap.get(task)); map.put(task, newTask); activityManager.setScheduledFor((AbstractTask) newTask, ((AbstractTask) task).getScheduledForDate()); activityManager.setDueDate(newTask, task.getDueDate()); if (task.isActive()) { activityManager.activateTask(newTask); } taskDataManager.refactorTaskId(task, newTask); } contextStore.refactorContext(map); } finally { monitor.done(); } }

Target:
protected void operations(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { monitor.beginTask("Task ID Update", newTaskIdMap.size() * 2); Map<ITask, ITask> map = new HashMap<>(); TaskActivityManager activityManager = TasksUiPlugin.getTaskActivityManager(); AbstractTaskContextStore contextStore = TasksUiPlugin.getContextStore(); TaskDataManager taskDataManager = TasksUiPlugin.getTaskDataManager(); for (ITask task : newTaskIdMap.keySet()) { AbstractTask newTask = getTaskList().refactorTaskId(task, newTaskIdMap.get(task)); map.put(task, newTask); activityManager.setDueDate(newTask, task.getDueDate()); if (task.isActive()) { activityManager.activateTask(newTask); } if (task instanceof AbstractTask) { activityManager.setScheduledFor(newTask, ((AbstractTask) task).getScheduledForDate()); taskDataManager.refactorTaskId((AbstractTask) task, newTask); } monitor.worked(1); } contextStore.refactorContext(map); monitor.worked(newTaskIdMap.size()); } finally { monitor.done(); } }