auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Boolean noSearchesOverlap(ArrayList<RegexSearch> performedSearches, HashMap<Integer,ArrayList<Rectangle>> nonOverlappingSections, ArrayList<Rectangle> totalSubsections, Integer pageNum, BufferedWriter loggingBufferedWriter){ ArrayList<RegexSearch> verifiedSearches = new ArrayList<RegexSearch>(); for (RegexSearch performedSearch: performedSearches){ try { loggingBufferedWriter.write("START REGEX: " + performedSearch.getRegexBeforeTable() + "\t\t"); loggingBufferedWriter.write("END REGEX: " + performedSearch.getRegexAfterTable()); loggingBufferedWriter.newLine(); } catch (IOException e) { e.printStackTrace(); } List<Rectangle> potSubsections = performedSearch.getSubSectionsForPage(pageNum, loggingBufferedWriter); technology.tabula.Pair<Boolean,String> overlapDetectionStatus = subSectionOverlapDetected(potSubsections,nonOverlappingSections.get(pageNum),verifiedSearches,pageNum); if(overlapDetectionStatus.getLeft()){ System.out.println("For Search: (" + performedSearch.getRegexBeforeTable() + "," + performedSearch.getRegexAfterTable() + ")"); System.out.println(overlapDetectionStatus.getRight()); try { loggingBufferedWriter.write(overlapDetectionStatus.getRight()); } catch (IOException e) { e.printStackTrace(); } return false; } else{ verifiedSearches.add(performedSearch); nonOverlappingSections.get(pageNum).addAll(potSubsections); totalSubsections.addAll(potSubsections); } } return true; }

Target:
private Boolean noSearchesOverlap(ArrayList<RegexSearch> performedSearches, HashMap<Integer,ArrayList<Rectangle>> nonOverlappingSections, ArrayList<Rectangle> totalSubsections, Integer pageNum, BufferedWriter loggingBufferedWriter){ ArrayList<RegexSearch> verifiedSearches = new ArrayList<RegexSearch>(); for (RegexSearch performedSearch: performedSearches){ try { loggingBufferedWriter.write("START REGEX: " + performedSearch.getRegexBeforeTable() + "\t\t"); loggingBufferedWriter.write("END REGEX: " + performedSearch.getRegexAfterTable()); loggingBufferedWriter.newLine(); } catch (IOException e) { e.printStackTrace(); } List<Rectangle> potSubsections = performedSearch.getSubSectionsForPage(pageNum, loggingBufferedWriter); technology.tabula.Pair<Boolean,String> overlapDetectionStatus = subSectionOverlapDetected(potSubsections,nonOverlappingSections.get(pageNum),verifiedSearches,pageNum); if(overlapDetectionStatus.getLeft()){ try { loggingBufferedWriter.write(overlapDetectionStatus.getRight()); } catch (IOException e) { e.printStackTrace(); } return false; } else{ verifiedSearches.add(performedSearch); nonOverlappingSections.get(pageNum).addAll(potSubsections); totalSubsections.addAll(potSubsections); } } return true; }
Source:
public CharSequence toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); Iterator<Caps2HashElement> iterator = hashes.iterator(); while (iterator.hasNext()) { xml.append(iterator.next()); } xml.closeElement(ELEMENT); return xml; }

Target:
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); Iterator<Caps2HashElement> iterator = hashes.iterator(); while (iterator.hasNext()) { xml.append(iterator.next()); } xml.closeElement(ELEMENT); return xml; }
Source:
public static String getStatusText(Status status) { switch (status) { case OK: return UIText.RebaseResultDialog_StatusOK; case ABORTED: return UIText.RebaseResultDialog_StatusAborted; case STOPPED: return UIText.RebaseResultDialog_StatusStopped; case FAILED: return UIText.RebaseResultDialog_StatusFailed; case UP_TO_DATE: return UIText.RebaseResultDialog_StatusUpToDate; case FAST_FORWARD: return UIText.RebaseResultDialog_StatusFastForward; case NOTHING_TO_COMMIT: return UIText.RebaseResultDialog_StatusNothingToCommit; default: throw new IllegalStateException(status.name()); } }

Target:
public static String getStatusText(Status status) { switch (status) { case OK: return UIText.RebaseResultDialog_StatusOK; case ABORTED: return UIText.RebaseResultDialog_StatusAborted; case STOPPED: return UIText.RebaseResultDialog_StatusStopped; case FAILED: return UIText.RebaseResultDialog_StatusFailed; case CONFLICTS: return UIText.RebaseResultDialog_StatusConflicts; case UP_TO_DATE: return UIText.RebaseResultDialog_StatusUpToDate; case FAST_FORWARD: return UIText.RebaseResultDialog_StatusFastForward; case NOTHING_TO_COMMIT: return UIText.RebaseResultDialog_StatusNothingToCommit; } return status.toString(); }
Source:
public Set<AutoscaleStackV4Response> getAllForAutoscale() { try { return transactionService.required(() -> { Set<AutoscaleStack> aliveOnes = stackRepository.findAliveOnesWithAmbari(); Set<AutoscaleStack> aliveNotUnderDeletion = Optional.ofNullable(aliveOnes).orElse(Set.of()).stream() .filter(stack -> !DELETE_IN_PROGRESS.equals(stack.getStackStatus())) .collect(Collectors.toSet()); return converterUtil.convertAllAsSet(aliveNotUnderDeletion, AutoscaleStackV4Response.class); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } }

Target:
public Set<AutoscaleStackV4Response> getAllForAutoscale() { try { return transactionService.required(() -> { Set<AutoscaleStack> aliveOnes = stackRepository.findAliveOnesWithClusterManager(); Set<AutoscaleStack> aliveNotUnderDeletion = Optional.ofNullable(aliveOnes).orElse(Set.of()).stream() .filter(stack -> !DELETE_IN_PROGRESS.equals(stack.getStackStatus())) .collect(Collectors.toSet()); return converterUtil.convertAllAsSet(aliveNotUnderDeletion, AutoscaleStackV4Response.class); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } }
Source:
private Router getRouter() throws Exception { AccountServiceFactory accountServiceFactory = Utils.getObj("com.github.ambry.account.HelixAccountServiceFactory", verifiableProperties, registry); accountService = accountServiceFactory.getAccountService(); notifier = ((HelixAccountService) accountService).getNotifier(); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, "", ""); clusterMap = clusterAgentsFactory.getClusterMap(); SSLFactory sslFactory = getSSLFactoryIfRequired(); RouterFactory routerFactory = Utils.getObj("com.github.ambry.router.NonBlockingRouterFactory", verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory, accountService); router = routerFactory.getRouter(); return router; }

Target:
private Router getRouter() throws Exception { AccountServiceFactory accountServiceFactory = Utils.getObj("com.github.ambry.account.HelixAccountServiceFactory", verifiableProperties, registry); accountService = (HelixAccountService) accountServiceFactory.getAccountService(); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, hardwareLayout, partitionLayout); clusterMap = clusterAgentsFactory.getClusterMap(); SSLFactory sslFactory = getSSLFactoryIfRequired(); RouterFactory routerFactory = Utils.getObj("com.github.ambry.router.NonBlockingRouterFactory", verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory, accountService); router = routerFactory.getRouter(); return router; }
Source:
private boolean isValidPosition(Vector3i position) { if (position == null) { return false; } Block targetBlock = worldProvider.getBlock(position); position.y += -1; Block belowBlock = worldProvider.getBlock(position); position.y += 1; return (targetBlock == airBlock && !belowBlock.isPenetrable()); }

Target:
private boolean isValidPosition(Vector3i position) { if (position == null) { return false; } Block targetBlock = worldProvider.getBlock(position); position.y -= 1; Block belowBlock = worldProvider.getBlock(position); position.y += 1; return (targetBlock == airBlock && !belowBlock.isPenetrable()); }
Source:
private static String rightPadWithSpaces(String s, int length) { int pad = length - s.length(); if (pad <= 0) { return s; } char[] res = new char[length]; for (int i = 0; i < s.length(); i++) { res[i] = s.charAt(i); } Arrays.fill(res, s.length(), length, ' '); return new String(res); }

Target:
private static String rightPadWithSpaces(String s, int length) { int pad = length - s.length(); if (pad <= 0) { return s; } char[] res = new char[length]; s.getChars(0, s.length(), res, 0); Arrays.fill(res, s.length(), length, ' '); return new String(res); }
Source:
private static boolean isIkvmDotNet0() { String vmName = SystemPropertyUtil.get("java.vm.name", "").toUpperCase(); return vmName.equals("IKVM.NET"); }

Target:
private static boolean isIkvmDotNet0() { String vmName = SystemPropertyUtil.get("java.vm.name", "").toUpperCase(Locale.US); return vmName.equals("IKVM.NET"); }
Source:
private static VideoRAMSettings selectVideoRAMSettings(VmBase vmBase) { Version clusterVersion = ClusterUtils.getCompatibilityVersion(vmBase); if(clusterVersion == null) { clusterVersion = Version.getLast(); } if (clusterVersion.greaterOrEquals(new Version(3, 6))) { return new VgamemVideoRAMSettings(); } else { return new LegacyVideoRAMSettings(); } }

Target:
private static VideoRAMSettings selectVideoRAMSettings(VmBase vmBase) { if (ClusterUtils.getCompatibilityVersion(vmBase).greaterOrEquals(new Version(3, 6))) { return new VgamemVideoRAMSettings(); } else { return new LegacyVideoRAMSettings(); } }
Source:
public Builder withQuestionDescription(Text questionDescription) { feedbackQuestionAttributes.setQuestionDescription(questionDescription); return this; }

Target:
public Builder withQuestionDescription(Text questionDescription) { if (questionDescription != null) { feedbackQuestionAttributes.setQuestionDescription(questionDescription); } return this; }
Source:
public void rollingUpdate(final DeploymentGroup deploymentGroup, final JobId jobId, final RolloutOptions options) throws DeploymentGroupDoesNotExistException, JobDoesNotExistException { checkNotNull(deploymentGroup, "deploymentGroup"); log.info("starting rolling-update on deployment-group: name={}, job={}", deploymentGroup.getName(), jobId); final DeploymentGroup updated = deploymentGroup.toBuilder() .setJobId(jobId) .setRolloutOptions(options) .build(); if (getJob(jobId) == null) { throw new JobDoesNotExistException(jobId); } final List<ZooKeeperOperation> operations = Lists.newArrayList(); final ZooKeeperClient client = provider.get("rollingUpdate"); operations.add(set(Paths.configDeploymentGroup(updated.getName()), updated)); try { final RollingUpdateOp op = getInitRollingUpdateOps(updated, MANUAL, client); operations.addAll(op.operations()); log.info("starting zookeeper transaction for rolling-update on " + "deployment-group name={} job={}. List of operations: {}", deploymentGroup.getName(), jobId, operations); client.transaction(operations); emitEvents(DEPLOYMENT_GROUP_EVENTS_KAFKA_TOPIC, op.events()); log.info("finished rolling-update on deployment-group: name={}, job={}", deploymentGroup.getName(), jobId); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(deploymentGroup.getName()); } catch (final KeeperException e) { throw new HeliosRuntimeException( "rolling-update on deployment-group " + deploymentGroup.getName() + " failed", e); } }

Target:
public void rollingUpdate(final DeploymentGroup deploymentGroup, final JobId jobId, final RolloutOptions options) throws DeploymentGroupDoesNotExistException, JobDoesNotExistException { checkNotNull(deploymentGroup, "deploymentGroup"); log.info("preparing to initiate rolling-update on deployment-group: name={}, jobId={}", deploymentGroup.getName(), jobId); final DeploymentGroup updated = deploymentGroup.toBuilder() .setJobId(jobId) .setRolloutOptions(options) .build(); if (getJob(jobId) == null) { throw new JobDoesNotExistException(jobId); } final List<ZooKeeperOperation> operations = Lists.newArrayList(); final ZooKeeperClient client = provider.get("rollingUpdate"); operations.add(set(Paths.configDeploymentGroup(updated.getName()), updated)); try { final RollingUpdateOp op = getInitRollingUpdateOps(updated, MANUAL, client); operations.addAll(op.operations()); log.info("starting zookeeper transaction for rolling-update on " + "deployment-group name={} jobId={}. List of operations: {}", deploymentGroup.getName(), jobId, operations); client.transaction(operations); emitEvents(DEPLOYMENT_GROUP_EVENTS_KAFKA_TOPIC, op.events()); log.info("initiated rolling-update on deployment-group: name={}, jobId={}", deploymentGroup.getName(), jobId); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(deploymentGroup.getName()); } catch (final KeeperException e) { throw new HeliosRuntimeException( "rolling-update on deployment-group " + deploymentGroup.getName() + " failed", e); } }
Source:
private FreeStyleBuild configureTestBuild(String projectName) throws Exception { FreeStyleProject p = projectName == null ? j.createFreeStyleProject() : j.createFreeStyleProject(projectName); p.getBuildersList().add(new TestBuilder() { @Override @SuppressWarnings("null") public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child("junit.xml").copyFrom( getClass().getResource("/hudson/tasks/junit/junit-report-20090516.xml")); return true; } }); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); return j.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); }

Target:
private FreeStyleBuild configureTestBuild(String projectName) throws Exception { FreeStyleProject p = j.createFreeStyleProject(projectName); p.getBuildersList().add(new TestBuilder() { @Override @SuppressWarnings("null") public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child("junit.xml").copyFrom( getClass().getResource("/hudson/tasks/junit/junit-report-20090516.xml")); return true; } }); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); return j.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); }
Source:
public String toString() { return "DruidDataSource{" + "properties=" + properties + ", partitions=" + getSegments().toString() + '}'; }

Target:
public String toString() { return "DruidDataSource{" + "properties=" + properties + ", partitions=" + idToSegmentMap.values() + '}'; }
Source:
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { for (Permanent nonland: game.getBattlefield().getAllActivePermanents(new FilterNonlandPermanent(), player.getId(), game)) { nonland.untap(game); } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { for (Permanent nonland: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_NON_LAND, player.getId(), game)) { nonland.untap(game); } return true; } return false; }
Source:
public void setCustomButtons(Menu menu) { for(int itemId : mCustomButtons.keySet()) { if (mCustomButtons.get(itemId) != MENU_DISABLED) { MenuItem item = menu.findItem(itemId); item.setShowAsAction(mCustomButtons.get(itemId)); Drawable icon = item.getIcon(); if (mReviewerUi.isControlBlocked()) { item.setEnabled(false); } else { item.setEnabled(true); } if (icon != null) { if (mReviewerUi.getControlBlocked() == ReviewerUi.ControlBlock.SLOW) { icon.setAlpha(Themes.ALPHA_ICON_DISABLED_LIGHT); } else { icon.setAlpha(Themes.ALPHA_ICON_ENABLED_LIGHT); } } } else { menu.findItem(itemId).setVisible(false); } } }

Target:
public void setCustomButtons(Menu menu) { for(int itemId : mCustomButtons.keySet()) { if (mCustomButtons.get(itemId) != MENU_DISABLED) { MenuItem item = menu.findItem(itemId); item.setShowAsAction(mCustomButtons.get(itemId)); Drawable icon = item.getIcon(); item.setEnabled(!mReviewerUi.isControlBlocked()); if (icon != null) { if (mReviewerUi.getControlBlocked() == ReviewerUi.ControlBlock.SLOW) { icon.setAlpha(Themes.ALPHA_ICON_DISABLED_LIGHT); } else { icon.setAlpha(Themes.ALPHA_ICON_ENABLED_LIGHT); } } } else { menu.findItem(itemId).setVisible(false); } } }
Source:
private void skip(String msg) { logger.info("Repair skipped: {}", parentSession, msg); fireProgressEvent(new ProgressEvent(ProgressEventType.NOTIFICATION, 100, 100, "Repair " + parentSession + " skipped: " + msg)); success(msg); }

Target:
private void skip(String msg) { notification("Repair " + parentSession + " skipped: " + msg); success(msg); }
Source:
protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getspm_status() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { ((ConnectAllHostsToLunCommandReturnValue)getReturnValue()).setFailedVds(spmVds); ((ConnectAllHostsToLunCommandReturnValue) getReturnValue()).setFailedLun(getDbFacade().getLunDao() .get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getstorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (String lunId : processed.keySet()) { for (Guid vdsId : processed.get(lunId)) { LUNs lun = lunsMap.get(lunId); StorageHelperDirector.getInstance().getItem(getStoragePool().getstorage_pool_type()) .DisconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }

Target:
protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getspm_status() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { final ConnectAllHostsToLunCommandReturnValue result = getResult(); result.setFailedVds(spmVds); result.setFailedLun(getDbFacade().getLunDao() .get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getstorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (String lunId : processed.keySet()) { for (Guid vdsId : processed.get(lunId)) { LUNs lun = lunsMap.get(lunId); StorageHelperDirector.getInstance().getItem(getStoragePool().getstorage_pool_type()) .DisconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }
Source:
private void resetScope() { MortarScope root = Mortar.createRootScope(false, ObjectGraph.create(new ModuleAndBlueprint("root"))); activityScope = Mortar.requireActivityScope(root, new ModuleAndBlueprint("activity")); }

Target:
private void resetScope() { MortarScope root = createRootScope(false, ObjectGraph.create(new ModuleAndBlueprint("root"))); activityScope = requireActivityScope(root, new ModuleAndBlueprint("activity")); }
Source:
public void saveOrder_shouldFailDrugOrderWithoutADrugNonCodedWhenDrugOrderIsNonCoded() throws Exception { Patient patient = Context.getPatientService().getPatient(7); CareSetting careSetting = Context.getOrderService().getCareSetting(2); OrderType orderType = Context.getOrderService().getOrderTypeByName("Drug order"); assertNull(Context.getAdministrationService().getGlobalPropertyObject( OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG)); DrugOrder order = new DrugOrder(); Encounter encounter = Context.getEncounterService().getEncounter(3); order.setEncounter(encounter); order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); order.setPatient(patient); order.setCareSetting(careSetting); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDateActivated(encounter.getEncounterDatetime()); order.setOrderType(orderType); order.setDosingType(FreeTextDosingInstructions.class); order.setInstructions("None"); order.setDosingInstructions("Test Instruction"); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertTrue(errors.hasFieldErrors()); assertEquals("DrugOrder.error.cannotSetBothDrugAndNonCodedDrug", errors.getFieldError("concept").getCode()); }

Target:
public void saveOrder_shouldFailDrugOrderWithoutADrugNonCodedWhenDrugOrderIsNonCoded() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-nonCodedDrugs.xml"); Patient patient = Context.getPatientService().getPatient(7); CareSetting careSetting = Context.getOrderService().getCareSetting(2); OrderType orderType = Context.getOrderService().getOrderTypeByName("Drug order"); GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, "true"); Context.getAdministrationService().saveGlobalProperty(gp); DrugOrder order = new DrugOrder(); Encounter encounter = Context.getEncounterService().getEncounter(3); order.setEncounter(encounter); order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); order.setPatient(patient); order.setCareSetting(careSetting); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDateActivated(encounter.getEncounterDatetime()); order.setOrderType(orderType); order.setDosingType(FreeTextDosingInstructions.class); order.setInstructions("None"); order.setDosingInstructions("Test Instruction"); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertTrue(errors.hasFieldErrors()); assertEquals("DrugOrder.error.drugNonCodedIsRequired", errors.getFieldError("drugNonCoded").getCode()); }
Source:
private void closeResource(@Nullable final SymbolicValue target) { ObjectConstraint openConstraint = null; if (target != null) { openConstraint = programState.getConstraintWithStatus(target, Status.OPENED); if (openConstraint != null) { programState = programState.addConstraint(target.wrappedValue(), openConstraint.withStatus(Status.CLOSED)); } } if (openConstraint == null) { Optional<SymbolicValue> closeableParameter = closeableParameters.stream().filter(sv -> sv == target).findAny(); if (!closeableParameter.isPresent()) { return; } Constraint constraint = programState.getConstraint(target); if (constraint == null) { programState = programState.addConstraint(target, new ObjectConstraint(false, false, null, Status.CLOSED)); } else if (constraint instanceof ObjectConstraint) { programState = programState.addConstraint(target, ((ObjectConstraint) constraint).withStatus(Status.CLOSED)); } } }

Target:
private void closeResource(@Nullable final SymbolicValue target) { ObjectConstraint openConstraint = null; if (target != null) { openConstraint = programState.getConstraintWithStatus(target, Status.OPENED); if (openConstraint != null) { programState = programState.addConstraint(target.wrappedValue(), openConstraint.withStatus(Status.CLOSED)); } } if (openConstraint == null) { Optional<SymbolicValue> closeableParameter = closeableParameters.stream().filter(sv -> sv == target).findAny(); if (!closeableParameter.isPresent()) { return; } Constraint constraint = programState.getConstraint(target); if (constraint instanceof ObjectConstraint) { programState = programState.addConstraint(target, ((ObjectConstraint) constraint).withStatus(Status.CLOSED)); } else if (constraint == null) { ProgramState nullProgramState = programState.addConstraint(target, ObjectConstraint.nullConstraint()); context.addTransition(nullProgramState); programState = programState.addConstraint(target, new ObjectConstraint(false, false, null, Status.CLOSED)); } } }
Source:
public void visitLiteral(LiteralTree tree) { if (tree.is(Tree.Kind.REGULAR_STRING_LITERAL)) { String literalValue = trimQuotes(tree.value()); IP.reset(literalValue); if (IP.matches()) { String ip = IP.group("ip"); if (Arrays.stream(ip.split(".")).mapToInt(Integer::parseInt).allMatch(i -> i < 255) && !isLocalhost(literalValue)) { context().newIssue(this, tree, MESSAGE); } } } super.visitLiteral(tree); }

Target:
public void visitLiteral(LiteralTree tree) { if (tree.is(Tree.Kind.REGULAR_STRING_LITERAL)) { String literalValue = trimQuotes(tree.value()); Matcher matcher = IP.matcher(literalValue); if (matcher.matches()) { String ip = matcher.group("ip"); if (Arrays.stream(ip.split("\\.")).mapToInt(Integer::parseInt).allMatch(i -> i < 255) && !isLocalhost(ip)) { context().newIssue(this, tree, MESSAGE); } } } super.visitLiteral(tree); }
Source:
public LinkPreviewFunnel(WikipediaApp app, PageTitle title) { super(app, SCHEMA_NAME, REV_ID); previewSessionToken = UUID.randomUUID().toString(); appInstallID = app.getAppInstallID(); this.title = title; version = app.getAppInstallIDInt() % linkPreviewToggleWeight > 1 ? 0 : app.getAppInstallIDInt() % linkPreviewToggleWeight + 1; }

Target:
public LinkPreviewFunnel(WikipediaApp app, PageTitle title) { super(app, SCHEMA_NAME, REV_ID); previewSessionToken = UUID.randomUUID().toString(); appInstallID = app.getAppInstallID(); this.title = title; version = ( ( app.getAppInstallIDInt() % LINK_PREVIEW_TOGGLE_WEIGHT ) == 3 ) ? 0 : ( app.getAppInstallIDInt() % LINK_PREVIEW_TOGGLE_WEIGHT ); }
Source:
public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); ApplicationSettings.INSTANCE.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ApplicationSettings.AUTOCOMPLETE_DELAY) && autoCompletion != null) { autoCompletion.setAutoActivationDelay((Integer) evt.getNewValue()); } else if (evt.getPropertyName().equals(ApplicationSettings.LINEWRAP_STATUS) && rSyntaxTextArea != null) { rSyntaxTextArea.setLineWrap((Boolean) evt.getNewValue()); } } }); displayCloudStatus(); }

Target:
public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); displayCloudStatus(); }
Source:
private PaxosTimestampCreator getPaxosTimestampCreator(MetricRegistry metrics) { Map<ClientAwarePaxosAcceptor, ExecutorService> paxosAcceptors = createClientAwarePaxosAcceptors(); Map<ClientAwarePaxosLearner, ExecutorService> paxosLearners = createClientAwarePaxosLearners(); return new PaxosTimestampCreator( metrics, paxosResource, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get), client -> KeyedStream.stream(paxosAcceptors) .<PaxosAcceptor>mapKeys(acceptor -> new ClientAwarePaxosAcceptorAdapter(client, acceptor)) .collectToMap(), client -> KeyedStream.stream(paxosLearners) .<PaxosLearner>mapKeys(learner -> new ClientAwarePaxosLearnerAdapter(client, learner)) .collectToMap(), sharedExecutor); }

Target:
private PaxosTimestampCreator getPaxosTimestampCreator(MetricRegistry metrics) { List<ClientAwarePaxosAcceptor> paxosAcceptors = createProxies(ClientAwarePaxosAcceptor.class, "timestamp-bound-store.acceptor"); List<ClientAwarePaxosLearner> paxosLearners = createProxies(ClientAwarePaxosLearner.class, "timestamp-bound-store.learner"); return new PaxosTimestampCreator( metrics, paxosResource, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get), ClientAwarePaxosAcceptorAdapter.wrap(paxosAcceptors), ClientAwarePaxosLearnerAdapter.wrap(paxosLearners), sharedExecutor); }
Source:
public List<String> getSeedNodes() { return newArrayList(from(clusterState.nodes()) .filter(new Predicate<CassandraNode>() { @Override public boolean apply(CassandraNode v) { return v.getSeed(); } }) .transform(CassandraFrameworkProtosUtils.cassandraNodeToIp())); }

Target:
public List<String> getSeedNodes() { return CassandraFrameworkProtosUtils.getSeedNodeIps(clusterState.nodes()); }
Source:
public BooleanSupplier parse(JsonContext context, JsonObject json) { String value = JsonUtils.getString(json, "feature"); String name = configToEnum.convert(value); Features feature; try { feature = Features.valueOf(name); } catch (IllegalArgumentException e) { throw new JsonSyntaxException("Unknown feature: " + value); } return feature::enabled; }

Target:
public BooleanSupplier parse(JsonContext context, JsonObject json) { String value = JsonUtils.getString(json, "feature"); String name = configToEnum.convert(value); Features feature; try { feature = Features.valueOf(name); } catch (IllegalArgumentException e) { throw new JsonParseException("Unknown feature: " + value); } return feature::enabled; }
Source:
public ExecutorLifecycle( ExecutorLifecycleConfig taskExecutorConfig, TaskConfig taskConfig, TaskActionClientFactory taskActionClientFactory, TaskRunner taskRunner, ObjectMapper jsonMapper ) { this.taskExecutorConfig = taskExecutorConfig; this.taskConfig = taskConfig; this.taskActionClientFactory = taskActionClientFactory; this.taskRunner = taskRunner; this.jsonMapper = new DefaultObjectMapper((DefaultObjectMapper) jsonMapper).addMixIn(PasswordProvider.class, PasswordProviderRedactionMixIn.class); }

Target:
public ExecutorLifecycle( ExecutorLifecycleConfig taskExecutorConfig, TaskConfig taskConfig, TaskActionClientFactory taskActionClientFactory, TaskRunner taskRunner, ObjectMapper jsonMapper ) { this.taskExecutorConfig = taskExecutorConfig; this.taskConfig = taskConfig; this.taskActionClientFactory = taskActionClientFactory; this.taskRunner = taskRunner; this.jsonMapper = jsonMapper.copy().addMixIn(PasswordProvider.class, PasswordProviderRedactionMixIn.class); }
Source:
public TaskAnnouncementTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); final File baseDir = new File("lol"); baseDir.mkdir(); baseDir.deleteOnExit(); }

Target:
public TaskAnnouncementTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); }
Source:
public LibraryInfo( OrganizationalUnit defaultOrganizationUnit, OrganizationalUnit selectedOrganizationUnit, Set<Project> projects, Collection<OrganizationalUnit> organizationUnits, String ouAlias) { this.defaultOrganizationUnit = defaultOrganizationUnit; this.selectedOrganizationUnit = selectedOrganizationUnit; this.projects = projects; this.organizationUnits = organizationUnits; this.ouAlias = ouAlias; }

Target:
public LibraryInfo( OrganizationalUnit defaultOrganizationUnit, OrganizationalUnit selectedOrganizationUnit, Set<Project> projects, Collection<OrganizationalUnit> organizationUnits, String ouAlias) { checkNotNull( "defaultOrganizationUnit", defaultOrganizationUnit ); checkNotNull( "selectedOrganizationUnit", selectedOrganizationUnit ); checkNotNull( "projects", projects ); checkNotNull( "organizationUnits", organizationUnits ); checkNotNull( "ouAlias", ouAlias ); this.defaultOrganizationUnit = defaultOrganizationUnit; this.selectedOrganizationUnit = selectedOrganizationUnit; this.projects = projects; this.organizationUnits = organizationUnits; this.ouAlias = ouAlias; }
Source:
public boolean isUserHasAccessToStudyOrSiteForStudy(List<StudyUserRoleBean> userRoles, String studyOid){ Study study = studyDao.findPublicStudy(studyOid); Study tempPublicStudy = null; for (StudyUserRoleBean userRole : userRoles) { tempPublicStudy = study; if(Role.siteRoleMap.containsKey(userRole.getRole().getId())) tempPublicStudy = studyDao.getPublicStudy(userRole.getStudyId()); if (study.getStudyId() == tempPublicStudy.getStudyId() || (tempPublicStudy.isSite() && study.getStudyId() == tempPublicStudy.getStudy().getStudyId())) { return true; } } return false; }

Target:
public boolean isUserHasAccessToStudyOrSiteForStudy(List<StudyUserRoleBean> userRoles, String studyOid){ Study study = studyDao.findPublicStudy(studyOid); Study tempPublicStudy = null; for (StudyUserRoleBean userRole : userRoles) { tempPublicStudy = null; if(Role.siteRoleMap.containsKey(userRole.getRole().getId())) tempPublicStudy = studyDao.getPublicStudy(userRole.getStudyId()); if (study.getStudyId() == userRole.getStudyId() || (tempPublicStudy != null && tempPublicStudy.isSite() && study.getStudyId() == tempPublicStudy.getStudy().getStudyId())) { return true; } } return false; }
Source:
public String getVendorCommoditiesAsString() { StringBuilder sb = new StringBuilder("["); boolean first = true; for (VendorCommodityCode vcc : this.getVendorCommodities()) { if (!first) { sb.append(", "); } else { first = false; } sb.append(vcc.getCommodityCode().getPurchasingCommodityCode()); } sb.append(']'); return sb.toString(); }

Target:
public String getVendorCommoditiesAsString() { StringBuilder sb = new StringBuilder("["); boolean first = true; for (VendorCommodityCode vcc : this.getVendorCommodities()) { if (!first) { sb.append(", "); } else { first = false; } sb.append(vcc.getCommodityCode().getCommodityDescription()); } sb.append(']'); return sb.toString(); }
Source:
public void removeNotificationListener( ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) { throw new UnsupportedOperationException("removeNotificationListener not supported for Jolokia"); }

Target:
public void removeNotificationListener( ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) { throw new UnsupportedOperationException("removeNotificationListener not supported by Jolokia"); }
Source:
public OutputStream getOutputStream() { try { return channel.getOutputStream(); } catch (IOException e) { e.printStackTrace(); return null; } }

Target:
public OutputStream getOutputStream() { try { return channel.getOutputStream(); } catch (IOException e) { Activator.log(e); return null; } }
Source:
private void addNewColumnsForAggregation() throws StandardException{ aggInfo=new AggregatorInfoList(); List<SubstituteExpressionVisitor> havingRefsToSubstitute=null; VirtualColumnNode vcForGroupingFunction = null; if(groupingList!=null){ List<SubstituteExpressionVisitor> referencesToSubstitute=new ArrayList<SubstituteExpressionVisitor>(); havingRefsToSubstitute=addUnAggColumns(referencesToSubstitute); if (groupingList.isRollup()) { addGroupingIdColumnAndUpdateGroupingFunction(); } for(SubstituteExpressionVisitor refVisistor : referencesToSubstitute) parent.getResultColumns().accept(refVisistor); } addAggregateColumns(); if(havingClause!=null){ if(havingRefsToSubstitute!=null){ for(SubstituteExpressionVisitor refVisitor : havingRefsToSubstitute){ havingClause.accept(refVisitor); } } CollectNodesVisitor collectNodesVisitor=new CollectNodesVisitor(ColumnReference.class,AggregateNode.class); havingClause.accept(collectNodesVisitor); for(Object o : collectNodesVisitor.getList()){ ColumnReference cr=(ColumnReference)o; if(!(cr.getGeneratedToReplaceAggregate() || cr.getGeneratedToReplaceWindowFunctionCall()) && cr.getSourceLevel()==level){ throw StandardException.newException( SQLState.LANG_INVALID_COL_HAVING_CLAUSE, cr.getSQLColumnName()); } } } }

Target:
private void addNewColumnsForAggregation() throws StandardException{ aggInfo=new AggregatorInfoList(); List<SubstituteExpressionVisitor> havingRefsToSubstitute=null; if(groupingList!=null){ List<SubstituteExpressionVisitor> referencesToSubstitute=new ArrayList<SubstituteExpressionVisitor>(); havingRefsToSubstitute=addUnAggColumns(referencesToSubstitute); if (groupingList.isRollup()) { addGroupingIdColumnAndUpdateGroupingFunction(); } for(SubstituteExpressionVisitor refVisistor : referencesToSubstitute) parent.getResultColumns().accept(refVisistor); } addAggregateColumns(); if(havingClause!=null){ if(havingRefsToSubstitute!=null){ for(SubstituteExpressionVisitor refVisitor : havingRefsToSubstitute){ havingClause.accept(refVisitor); } } CollectNodesVisitor collectNodesVisitor=new CollectNodesVisitor(ColumnReference.class,AggregateNode.class); havingClause.accept(collectNodesVisitor); for(Object o : collectNodesVisitor.getList()){ ColumnReference cr=(ColumnReference)o; if(!(cr.getGeneratedToReplaceAggregate() || cr.getGeneratedToReplaceWindowFunctionCall()) && cr.getSourceLevel()==level){ throw StandardException.newException( SQLState.LANG_INVALID_COL_HAVING_CLAUSE, cr.getSQLColumnName()); } } } }
Source:
public AbstractConnectionFactorySpec(C connectionFactory) { this.target = connectionFactory; }

Target:
AbstractConnectionFactorySpec(C connectionFactory) { this.target = connectionFactory; }
Source:
public String toString() { return String.format("Invalid arithmetic operation on %s and %s", type1, type2); }

Target:
public String toString() { return String.format("Invalid arithmetic operation on %s and %s.", type1, type2); }
Source:
public boolean hasTag(String tag) { return tags.stream().map(String::toLowerCase).collect(Collectors.toList()).contains(tag.toLowerCase()); }

Target:
public boolean hasTag(String tag) { return tags.stream().anyMatch(t -> t.equalsIgnoreCase(tag)); }
Source:
public static <T> T instantiateClass(Class<T> clazz) throws BeanInstantiationException { Assert.notNull(clazz, "Class must not be null"); if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, "Specified class is an interface"); } Constructor<T> ctor = findPrimaryConstructor(clazz); if (ctor == null) { throw new BeanInstantiationException(clazz, "No default constructor found"); } return instantiateClass(ctor); }

Target:
public static <T> T instantiateClass(Class<T> clazz) throws BeanInstantiationException { Assert.notNull(clazz, "Class must not be null"); if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, "Specified class is an interface"); } try { Constructor<T> ctor = (kotlinPresent && isKotlinClass(clazz) ? KotlinDelegate.findPrimaryConstructor(clazz) : clazz.getDeclaredConstructor()); if (ctor == null) { throw new BeanInstantiationException(clazz, "No default constructor found"); } return instantiateClass(ctor); } catch (NoSuchMethodException ex) { throw new BeanInstantiationException(clazz, "No default constructor found", ex); } }
Source:
public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException{ Connection conn = connect(); PreparedStatement preparedStatement1 = null; ResultSet resultSet = null; String sql1 = "SELECT * FROM reference_sets WHERE set_name=? AND version=?"; try { preparedStatement1 = conn.prepareStatement(sql1); preparedStatement1.setString(1, referenceSetName); preparedStatement1.setString(2, version); resultSet = preparedStatement1.executeQuery(); return (resultSet.next()); } catch (SQLException ex) { throw new EamDbException("Error getting reference instances by type and value.", ex); } finally { EamDbUtil.closePreparedStatement(preparedStatement1); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } }

Target:
public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException{ Connection conn = connect(); PreparedStatement preparedStatement1 = null; ResultSet resultSet = null; String sql1 = "SELECT * FROM reference_sets WHERE set_name=? AND version=?"; try { preparedStatement1 = conn.prepareStatement(sql1); preparedStatement1.setString(1, referenceSetName); preparedStatement1.setString(2, version); resultSet = preparedStatement1.executeQuery(); return (resultSet.next()); } catch (SQLException ex) { throw new EamDbException("Error testing whether reference set exists (name: " + referenceSetName + " version: " + version, ex); } finally { EamDbUtil.closePreparedStatement(preparedStatement1); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } }
Source:
public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(!isFinished(), "Operator is already finished"); Block sourceBlock = page.getBlock(setChannel); Page sourcePage = hashChannel.isPresent() ? new Page(sourceBlock, page.getBlock(hashChannel.get())) : new Page(sourceBlock); unfinishedWork = channelSetBuilder.addPage(sourcePage); processUnfinishedWork(); channelSetBuilder.updateMemoryReservation(); }

Target:
public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(!isFinished(), "Operator is already finished"); Block sourceBlock = page.getBlock(setChannel); Page sourcePage = hashChannel.isPresent() ? new Page(sourceBlock, page.getBlock(hashChannel.get())) : new Page(sourceBlock); unfinishedWork = channelSetBuilder.addPage(sourcePage); processUnfinishedWork(); }
Source:
public void commitJob(JobContext jobContext) throws IOException { View<E> targetView = load(jobContext); if(targetView instanceof ReadiableView) { ((ReadiableView)targetView).signalReady(); } }

Target:
public void commitJob(JobContext jobContext) throws IOException { View<E> targetView = load(jobContext); if (targetView instanceof Signalable) { ((Signalable)targetView).signalReady(); } }
Source:
public void visitClass(ClassTree tree) { boolean generatesEquals = usesAnnotation(tree, GENERATES_EQUALS); markIssues(tree, UnusedPrivateFieldCheck.class, IssueState.shouldBeRefused(generatesEquals || usesAnnotation(tree, GENERATE_UNUESED_FIELD_RELATED_METHODS))); markIssues(tree, EqualsNotOverriddenInSubclassCheck.class, IssueState.shouldBeRefused(generatesEquals)); markIssues(tree, EqualsNotOverriddenInSubclassCheck.class, IssueState.shouldBeRefused(generatesEquals)); markIssues(tree, UtilityClassWithPublicConstructorCheck.class, IssueState.shouldBeRefused(usesAnnotation(tree, GENERATE_PRIVATE_CONSTRUCTOR))); super.visitClass(tree); }

Target:
public void visitClass(ClassTree tree) { boolean generatesEquals = usesAnnotation(tree, GENERATE_EQUALS); if (generatesEquals || usesAnnotation(tree, GENERATE_UNUSED_FIELD_RELATED_METHODS)) { excludeLines(tree, UnusedPrivateFieldCheck.class); } else { acceptLines(tree, UnusedPrivateFieldCheck.class); } if (generatesEquals) { excludeLines(tree, EqualsNotOverriddenInSubclassCheck.class); excludeLines(tree, EqualsNotOverridenWithCompareToCheck.class); } else { acceptLines(tree, EqualsNotOverriddenInSubclassCheck.class); acceptLines(tree, EqualsNotOverridenWithCompareToCheck.class); } if (usesAnnotation(tree, GENERATE_PRIVATE_CONSTRUCTOR)) { excludeLines(tree, UtilityClassWithPublicConstructorCheck.class); } else { acceptLines(tree, UtilityClassWithPublicConstructorCheck.class); } super.visitClass(tree); }
Source:
public void handleData(ITmfEvent data) { super.handleData(data); long index = getIndex() + getNbRead() - 1; if (data == null) { for (ITmfEventRequest request : fRequests) { request.handleData(null); } return; } Iterable<ITmfEventRequest> requests = fRequestingATrace.get(data.getTrace()); for (ITmfEventRequest request : requests) { long start = request.getIndex(); if (!request.isCompleted() && index >= start && request.getNbRead() < request.getNbRequested()) { ITmfTimestamp ts = data.getTimestamp(); if (request.getRange().contains(ts)) { if (request.getDataType().isInstance(data)) { request.handleData(data); } } } } }

Target:
public void handleData(ITmfEvent data) { super.handleData(data); long index = getIndex() + getNbRead() - 1; if (data == null) { for (ITmfEventRequest request : fRequests) { request.handleData(null); } return; } ITmfTrace trace = data.getTrace(); if (!fRequestingATrace.containsKey(trace)) { fRequestingATrace.put(trace, new HashSet<ITmfEventRequest>()); ITmfEventProvider eventProvider = getEventProvider(); if (eventProvider != null) { Set<ITmfEventRequest> populatedList = populateTraceList(((TmfCompositeComponent) eventProvider).getAncestors()); fRequestingATrace.get(trace).addAll(populatedList); } } Iterable<ITmfEventRequest> requests = fRequestingATrace.get(trace); for (ITmfEventRequest request : requests) { long start = request.getIndex(); if (!request.isCompleted() && index >= start && request.getNbRead() < request.getNbRequested()) { ITmfTimestamp ts = data.getTimestamp(); if (request.getRange().contains(ts)) { if (request.getDataType().isInstance(data)) { request.handleData(data); } } } } }
Source:
protected void openConnection() { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket == null) { try { socket = new Socket(receiverNode.getAddressString(), receiverNode.getPort()); } catch (IOException e) { logger.warn("Could not connect to in {}: {}", receiverNode, this.thing.getUID(), e); return; } } if (socket.isConnected()) { receiverNodes.put(receiverNode, socket); } else { receiverNodes.put(receiverNode, null); return; } } isConnected = true; }

Target:
protected void openConnection() { if (!this.thing.getStatus().equals(ThingStatus.ONLINE)) { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket == null) { try { socket = new Socket(receiverNode.getAddressString(), receiverNode.getPort()); } catch (IOException e) { logger.debug("Could not connect to in {}: {}", receiverNode, this.thing.getUID(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "could not connect to " + receiverNode.toString()); return; } } if (socket.isConnected()) { receiverNodes.put(receiverNode, socket); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); receiverNodes.put(receiverNode, null); return; } } updateStatus(ThingStatus.ONLINE); } }
Source:
public void onReceive(Context context, Intent intent) { FilterableNotification filterableNotification = intent.getParcelableExtra("notification"); if (intent.getParcelableExtra("notification") == null || SwrveHelper.isNullOrEmpty(filterableNotification.getData())) { Log.e(LOG_TAG, "LocationCampaignEngageReceiver. Payload data is null or empty or missing."); } else { String locationMessageId = filterableNotification.getData(); SwrveSDKBase.event("Swrve.Location.Location-" + locationMessageId + ".engaged"); } launchApp(context, intent.getExtras()); }

Target:
public void onReceive(Context context, Intent intent) { FilterableNotification filterableNotification = intent.getParcelableExtra("notification"); if (filterableNotification == null || SwrveHelper.isNullOrEmpty(filterableNotification.getData())) { Log.e(LOG_TAG, "LocationCampaignEngageReceiver. Payload data is null or empty or missing."); } else { String locationMessageId = filterableNotification.getData(); SwrveSDKBase.event("Swrve.Location.Location-" + locationMessageId + ".engaged"); } launchApp(context, intent.getExtras()); }
Source:
public void failQuery(QueryId queryId, Throwable cause) { requireNonNull(queryId, "queryId is null"); requireNonNull(cause, "cause is null"); log.warn(cause, "Fail query %s", queryId); QueryExecution query = queries.get(queryId); if (query != null) { query.fail(cause); } }

Target:
public void failQuery(QueryId queryId, Throwable cause) { requireNonNull(queryId, "queryId is null"); requireNonNull(cause, "cause is null"); QueryExecution query = queries.get(queryId); if (query != null) { query.fail(cause); } }