auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public EcjProblem(@Nonnull CategorizedProblem problem) { this.problem = problem; if (problem.getOriginatingFileName() == null) { sourceInfo = SourceInfo.UNKNOWN; } else { int lineProblem = problem.getSourceLineNumber(); SourceInfoFactory sourceInfoFactory = Jack.getSession().getSourceInfoFactory(); if (problem instanceof DefaultProblem) { int columnProblem = ((DefaultProblem) problem).getSourceColumnNumber(); sourceInfo = sourceInfoFactory.create(columnProblem, columnProblem, lineProblem, lineProblem, String.valueOf(problem.getOriginatingFileName())); } else { sourceInfo = sourceInfoFactory.create(lineProblem, lineProblem, String.valueOf(problem.getOriginatingFileName())); } } }

Target:
public EcjProblem(@Nonnull CategorizedProblem problem) { this.problem = problem; if (problem.getOriginatingFileName() == null) { sourceInfo = SourceInfo.UNKNOWN; } else { int lineProblem = problem.getSourceLineNumber(); SourceInfoFactory sourceInfoFactory = Jack.getSession().getSourceInfoFactory(); if (problem instanceof DefaultProblem) { int columnProblem = ((DefaultProblem) problem).getSourceColumnNumber(); sourceInfo = sourceInfoFactory.create(columnProblem, SourceInfo.UNKNOWN_COLUMN_NUMBER, lineProblem, SourceInfo.UNKNOWN_LINE_NUMBER, String.valueOf(problem.getOriginatingFileName())); } else { sourceInfo = sourceInfoFactory.create(lineProblem, SourceInfo.UNKNOWN_LINE_NUMBER, String.valueOf(problem.getOriginatingFileName())); } } }
Source:
private String validateNewNamespaceArgument(ByteBuffer namespaceArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String namespace = namespaceArg == null ? null : ByteBufferUtil.toString(namespaceArg); if ((namespace != null) && (namespace.length() > MAX_NAMESPACE_LEN)) { throw new ThriftTableOperationException(null, namespace, op, TableOperationExceptionType.OTHER, "Namespaces must be less than or equal to " + MAX_NAMESPACE_LEN + " characters. " + "'" + namespace + "' is " + namespace.length() + " characters long."); } return _validateArgument(namespace, op, Namespaces.VALID_NAME.and(userValidator)); }

Target:
private String validateNewNamespaceArgument(ByteBuffer namespaceArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String namespace = namespaceArg == null ? null : ByteBufferUtil.toString(namespaceArg); if ((namespace != null) && (namespace.length() > MAX_NAMESPACE_LEN)) { throw new ThriftTableOperationException(null, namespace, op, TableOperationExceptionType.INVALID_NAME, "Namespaces must be less than or equal to " + MAX_NAMESPACE_LEN + " characters. " + "'" + namespace + "' is " + namespace.length() + " characters long."); } return _validateArgument(namespace, op, Namespaces.VALID_NAME.and(userValidator)); }
Source:
public void getParts() { Iterator<DoubleSegment> edges = RECTANGLE.getParts().iterator(); assertEquals(TOP_EDGE, edges.next()); assertEquals(LEFT_EDGE, edges.next()); assertEquals(RIGHT_EDGE, edges.next()); assertEquals(BOTTOM_EDGE, edges.next()); assertFalse(edges.hasNext()); }

Target:
public void getParts() { assertEquals( asList(TOP_EDGE, LEFT_EDGE, RIGHT_EDGE, BOTTOM_EDGE), RECTANGLE.getParts() ); }
Source:
public ResponseEntity<ResourceSupport> createTemplateItem(HttpServletRequest request, @PathVariable UUID uuid, @RequestBody(required = false) JsonNode itemBody) throws SQLException, AuthorizeException { if (itemBody == null) { throw new BadRequestException("The new item should be included as json in te body of this request"); } Context context = ContextUtil.obtainContext(request); Collection collection = getCollection(context, uuid); ItemRest inputItemRest; try { ObjectMapper mapper = new ObjectMapper(); inputItemRest = mapper.readValue(itemBody.toString(), ItemRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body", e1); } ItemRest templateItem = collectionRestRepository.createTemplateItem(context, collection, inputItemRest); context.commit(); return ControllerUtils.toResponseEntity(HttpStatus.CREATED, null, new ItemResource(templateItem, utils)); }

Target:
public ResponseEntity<ResourceSupport> createTemplateItem(HttpServletRequest request, @PathVariable UUID uuid, @RequestBody(required = false) JsonNode itemBody) throws SQLException, AuthorizeException { if (itemBody == null) { throw new BadRequestException("The new item should be included as json in the body of this request"); } Context context = ContextUtil.obtainContext(request); Collection collection = getCollection(context, uuid); ItemRest inputItemRest; try { ObjectMapper mapper = new ObjectMapper(); inputItemRest = mapper.readValue(itemBody.toString(), ItemRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body", e1); } ItemRest templateItem = collectionRestRepository.createTemplateItem(context, collection, inputItemRest); context.commit(); return ControllerUtils.toResponseEntity(HttpStatus.CREATED, null, new ItemResource(templateItem, utils)); }
Source:
public void canGetJobRequest() throws GenieException { final JobRequest job1Request = this.service.getJobRequest(JOB_1_ID); Assert.assertThat( job1Request.getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f query.q") ); Assert.assertThat( job1Request.getClusterCriterias().size(), Matchers.is(2) ); final Set<String> clusterCriterion0Tags = job1Request.getClusterCriterias().get(0).getTags(); Assert.assertThat( clusterCriterion0Tags.size(), Matchers.is(4) ); Assert.assertThat( clusterCriterion0Tags, Matchers.is(Sets.newHashSet("genie.id:cluster1", "genie.name:h2query", "sla", "yarn")) ); Assert.assertThat( this.service.getJobRequest(JOB_2_ID).getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f spark.jar") ); Assert.assertThat( this.service.getJobRequest(JOB_3_ID).getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f spark.jar") ); try { this.service.getJobRequest(UUID.randomUUID().toString()); Assert.fail(); } catch (final GenieException ge) { Assert.assertTrue(ge instanceof GenieNotFoundException); } }

Target:
public void canGetJobRequest() throws GenieException { final JobRequest job1Request = this.service.getJobRequest(JOB_1_ID); Assert.assertThat( job1Request.getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f query.q") ); Assert.assertThat( job1Request.getClusterCriterias().size(), Matchers.is(2) ); final Set<String> clusterCriterion0Tags = job1Request.getClusterCriterias().get(0).getTags(); Assert.assertThat( clusterCriterion0Tags.size(), Matchers.is(4) ); Assert.assertThat( clusterCriterion0Tags, Matchers.is(Sets.newHashSet("genie.id:cluster1", "genie.name:h2query", "sla", "yarn")) ); final Set<String> clusterCriterion1Tags = job1Request.getClusterCriterias().get(1).getTags(); Assert.assertThat( clusterCriterion1Tags.size(), Matchers.is(2) ); Assert.assertThat( clusterCriterion1Tags, Matchers.is(Sets.newHashSet("sla", "adhoc")) ); final Set<String> commandCriterionTags = job1Request.getCommandCriteria(); Assert.assertThat( commandCriterionTags, Matchers.is(Sets.newHashSet("type:spark", "ver:1.6.0", "genie.name:spark")) ); Assert.assertThat( this.service.getJobRequest(JOB_2_ID).getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f spark.jar") ); Assert.assertThat( this.service.getJobRequest(JOB_3_ID).getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is("-f spark.jar") ); try { this.service.getJobRequest(UUID.randomUUID().toString()); Assert.fail(); } catch (final GenieException ge) { Assert.assertTrue(ge instanceof GenieNotFoundException); } }
Source:
private void setLambdaVariableNames(IJavaValue value, ObjectReference underlyingThisObject) { try { IType type = JavaDebugUtils.resolveType(value.getJavaType()); ASTParser parser = ASTParser.newParser(AST.JLS8); parser.setResolveBindings(true); parser.setSource(type.getTypeRoot()); CompilationUnit cu = (CompilationUnit) parser.createAST(null); cu.accept(new ASTVisitor(false) { @Override public boolean visit(LambdaExpression lambdaExpression) { IMethodBinding binding = lambdaExpression.resolveMethodBinding(); IVariableBinding[] synVars = binding.getSyntheticOuterLocals(); if (synVars == null || synVars.length == 0) { return true; } List<Field> allFields = underlyingThisObject.referenceType().fields(); ListIterator<Field> listIterator = allFields.listIterator(); int i = 0; if (getUnderlyingMethod().isStatic()) { if (synVars.length == allFields.size()) { while (listIterator.hasNext()) { FieldImpl field = (FieldImpl) listIterator.next(); String newName = synVars[i].getName(); FieldImpl newField = new FieldImpl((VirtualMachineImpl) field.virtualMachine(), (ReferenceTypeImpl) field.declaringType(), field.getFieldID(), newName, field.signature(), field.genericSignature(), field.modifiers()); listIterator.set(newField); } } } else { if (synVars.length + 1 == allFields.size()) { while (listIterator.hasNext()) { FieldImpl field = (FieldImpl) listIterator.next(); String newName = field.name(); if (i > 0) { newName = synVars[i - 1].getName(); } else { newName = "this"; } FieldImpl newField = new FieldImpl((VirtualMachineImpl) field.virtualMachine(), (ReferenceTypeImpl) field.declaringType(), field.getFieldID(), newName, field.signature(), field.genericSignature(), field.modifiers()); listIterator.set(newField); i++; } } } return true; } }); } catch (CoreException e) { logError(e); } }

Target:
private void setLambdaVariableNames(IJavaValue value, ObjectReference underlyingThisObject) { try { IType type = JavaDebugUtils.resolveType(value.getJavaType()); ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setResolveBindings(true); parser.setSource(type.getTypeRoot()); CompilationUnit cu = (CompilationUnit) parser.createAST(null); cu.accept(new LambdaASTVisitor(false, underlyingThisObject, getUnderlyingMethod())); } catch (CoreException e) { logError(e); } }
Source:
public void testBracketsInGroup() throws Exception { createFiles("[", "]", "[]", "][", "[[]", "[]]", "[[]]"); writeTrashFile(".gitattributes", "[[]] bar1\n"); writeTrashFile(".gitattributes", "[\\[]] bar2\n"); writeTrashFile(".gitattributes", "[[\\]] bar3\n"); writeTrashFile(".gitattributes", "[\\[\\]] bar4\n"); assertSameAsCGit(); }

Target:
public void testBracketsInGroup() throws Exception { createFiles("[", "]", "[]", "][", "[[]", "[]]", "[[]]"); writeTrashFile(".gitattributes", "[[]] bar1\n" + "[\\[]] bar2\n" + "[[\\]] bar3\n" + "[\\[\\]] bar4\n"); assertSameAsCGit(); }
Source:
public String toString() { if (isEmpty()) { return Objects.toStringHelper(this) .addValue("NONE") .toString(); } else { return Objects.toStringHelper(this) .omitNullValues() .add("bold", this.bold.orNull()) .add("italic", this.italic.orNull()) .add("underline", this.underline.orNull()) .add("strikethrough", this.strikethrough.orNull()) .add("obfuscated", this.obfuscated.orNull()) .toString(); } }

Target:
public String toString() { return Objects.toStringHelper(TextStyle.class) .omitNullValues() .add("bold", this.bold.orElse(null)) .add("italic", this.italic.orElse(null)) .add("underline", this.underline.orElse(null)) .add("strikethrough", this.strikethrough.orElse(null)) .add("obfuscated", this.obfuscated.orElse(null)) .toString(); }
Source:
private static boolean checkLocus(final VCFFileReader vcfFileReader, final SamLocusIterator.LocusInfo locusInfo) { boolean overlaps = false; if (locusInfo != null) { try (final CloseableIterator<VariantContext> vcfIterator = vcfFileReader.query(locusInfo)) { overlaps = true; boolean allFiltered = true; while (vcfIterator.hasNext()) { final VariantContext vcf = vcfIterator.next(); if (vcf.isFiltered()) { continue; } allFiltered = false; } if (allFiltered) { overlaps = false; } } } return overlaps; }

Target:
private static boolean checkLocus(final VCFFileReader vcfFileReader, final SamLocusIterator.LocusInfo locusInfo) { boolean overlaps = false; if (locusInfo != null) { try (final CloseableIterator<VariantContext> vcfIterator = vcfFileReader.query(locusInfo)) { while (vcfIterator.hasNext()) { if (vcfIterator.next().isFiltered()) { continue; } overlaps = true; break; } } } return overlaps; }
Source:
public InstructorFeedbackResultsSessionPanel(FeedbackSessionAttributes session, String editLink, FeedbackSessionPublishButton feedbackSessionPublishButton, String selectedSection, boolean isMissingResponsesShown, boolean isStatsShown) { this.courseId = SanitizationHelper.sanitizeForHtml(session.getCourseId()); this.feedbackSessionName = SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()); this.editLink = editLink; this.startTime = TimeHelper.formatDateTimeForHomePage(session.getStartTime(), session.getTimeZone()); this.endTime = TimeHelper.formatDateTimeForHomePage(session.getEndTime(), session.getTimeZone()); this.resultsVisibleFrom = getResultsVisibleFromText(session); this.feedbackSessionPublishButton = feedbackSessionPublishButton; this.selectedSection = selectedSection; this.isStatsShown = isStatsShown; this.isMissingResponsesShown = isMissingResponsesShown; }

Target:
public InstructorFeedbackResultsSessionPanel(FeedbackSessionAttributes session, String editLink, FeedbackSessionPublishButton feedbackSessionPublishButton, String selectedSection, boolean isMissingResponsesShown, boolean isStatsShown) { this.courseId = SanitizationHelper.sanitizeForHtml(session.getCourseId()); this.feedbackSessionName = SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()); this.editLink = editLink; this.startTime = TimeHelper.formatDateTimeForDisplay(session.getStartTime(), session.getTimeZone()); this.endTime = TimeHelper.formatDateTimeForDisplay(session.getEndTime(), session.getTimeZone()); this.resultsVisibleFrom = getResultsVisibleFromText(session); this.feedbackSessionPublishButton = feedbackSessionPublishButton; this.selectedSection = selectedSection; this.isStatsShown = isStatsShown; this.isMissingResponsesShown = isMissingResponsesShown; }
Source:
private void updateSecurityContextAuthorities(SecurityContext securityContext, Collection<? extends GrantedAuthority> newAuthorities) { Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); List<GrantedAuthority> updatedAuthorities = new ArrayList<>(authorities); updatedAuthorities.addAll(newAuthorities); Authentication authentication = securityContext.getAuthentication(); UsernamePasswordAuthenticationToken newToken = new UsernamePasswordAuthenticationToken( authentication.getPrincipal(), authentication.getCredentials(), updatedAuthorities); securityContext.setAuthentication(newToken); }

Target:
private void updateSecurityContextAuthorities(SecurityContext securityContext, Collection<? extends GrantedAuthority> newAuthorities) { Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); List<GrantedAuthority> updatedAuthorities = new ArrayList<>(authorities); updatedAuthorities.addAll(newAuthorities); Authentication updatedAuthentication = authenticationAuthoritiesUpdater.updateAuthentication( securityContext.getAuthentication(), updatedAuthorities); securityContext.setAuthentication(updatedAuthentication); }
Source:
private String getEffectiveEmulatedMachine() { if (getVm().getCustomEmulatedMachine() != null) { return getVm().getCustomEmulatedMachine(); } String recentDefault = getCluster().getEmulatedMachine(); if (removeThisDebugSwitch && getVm().getCustomCompatibilityVersion() != null) { List<String> oldSupported = Config.<List<String>>getValue(ConfigValues.ClusterEmulatedMachines, getVm().getCustomCompatibilityVersion().getValue()); Optional<String> best = oldSupported.stream().max( (s1, s2) -> StringUtils.indexOfDifference(recentDefault, s1) - StringUtils.indexOfDifference(recentDefault, s2)); log.info("Emulated machine '{}' selected since Custom Compatibility Version is set for the '{}' VM", best.orElse(recentDefault), getVm().getName()); return best.orElse(recentDefault); } return recentDefault; }

Target:
protected String getEffectiveEmulatedMachine() { if (getVm().getCustomEmulatedMachine() != null) { return getVm().getCustomEmulatedMachine(); } String recentClusterDefault = getCluster().getEmulatedMachine(); if (getVm().getCustomCompatibilityVersion() == null) { return recentClusterDefault; } List<String> oldSupported = Config.getValue(ConfigValues.ClusterEmulatedMachines, getVm().getCustomCompatibilityVersion().getValue()); Optional<String> best = oldSupported.stream().max( (s1, s2) -> StringUtils.indexOfDifference(recentClusterDefault, s1) - StringUtils.indexOfDifference(recentClusterDefault, s2)); log.info("Emulated machine '{}' selected since Custom Compatibility Version is set for the '{}' VM", best.orElse(recentClusterDefault), getVm().toString()); return best.orElse(recentClusterDefault); }
Source:
public int getPartition(BytesWritable bytesWritable, Writable value, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); if (local) { return shardNum % numPartitions; } else { if (shardNum >= numPartitions) { throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions); } return shardNum; } }

Target:
public int getPartition(BytesWritable bytesWritable, Writable value, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); if (config.get("mapred.job.tracker").equals("local")) { return shardNum % numPartitions; } else { if (shardNum >= numPartitions) { throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions); } return shardNum; } }
Source:
private void initProperties() { List<ConfigurationNode> nodes = getRootNode().getChildren(); if (nodes == null || nodes.isEmpty()) { return; } for (ConfigurationNode p : nodes) { String name = (String) p.getChildren("name").get(0).getValue(); String value = (String) p.getChildren("value").get(0).getValue(); if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(value)) { properties.put(name, value); } } }

Target:
private void initProperties() { List<ConfigurationNode> nodes = getRootNode().getChildren(); if (nodes == null || nodes.isEmpty()) { return; } for (ConfigurationNode p : nodes) { String name = (String) p.getChildren("name").get(0).getValue(); String value = (String) p.getChildren("value").get(0).getValue(); if (!StringUtils.isEmpty(name)) { properties.put(name, value); } } }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if(bindingConfig.indexOf('.') < 0 && !bindingConfig.equalsIgnoreCase("lightscmd")){ logger.warn("Item has an invalid configuration {}", item.getName(), bindingConfig); return; } AutelisBindingConfig config = new AutelisBindingConfig(bindingConfig); addBindingConfig(item, config); Set<Item> items = contextMap.get(context); if (items == null) { items = new HashSet<Item>(); contextMap.put(context, items); } items.add(item); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if(bindingConfig.indexOf('.') < 0 && !bindingConfig.equalsIgnoreCase("lightscmd")){ logger.warn("Item {}'s configuration ({}) is not valid, please use the pattern 'parentType.childType' or lightscmd ", item.getName(), bindingConfig); return; } AutelisBindingConfig config = new AutelisBindingConfig(bindingConfig); addBindingConfig(item, config); Set<Item> items = contextMap.get(context); if (items == null) { items = new HashSet<Item>(); contextMap.put(context, items); } items.add(item); }
Source:
private boolean stopGlusterServices(VDS vds) { boolean succeeded = true; if (vds.getVdsGroupSupportsGlusterService()) { succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = DbFacade.getInstance().getGlusterBrickDao().getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } DbFacade.getInstance().getGlusterBrickDao().updateBrickStatuses(bricks); } } } return succeeded; }

Target:
private void stopGlusterServices(VDS vds) { boolean succeeded = false; if (vds.getVdsGroupSupportsGlusterService()) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = glusterBrickDao.getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } glusterBrickDao.updateBrickStatuses(bricks); } } if(!succeeded){ log.info("Failed to stop gluster services while moving the host '{}' to maintenance", vds.getName()); } } }
Source:
public void testExistingMultipleTagsIteratorGHFileNotFoundExceptionOnHasNext() throws IOException { SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); Error expectedError = new Error("Bad Tag Request", new GHFileNotFoundException()); Error expectedError2 = new Error("Bad Tag Request IOError", new IOException()); Mockito.when(mockSCMHeadObserver.getIncludes()).thenReturn( new HashSet<>(Arrays.asList( new GitHubTagSCMHead("existent-multiple-tags1", System.currentTimeMillis()), new GitHubTagSCMHead("existent-multiple-tags2", System.currentTimeMillis())))); GitHubSCMSourceContext context = new GitHubSCMSourceContext(null, mockSCMHeadObserver); context.wantTags(true); GitHubSCMSourceRequest request = context.newRequest(revisions()[0], null); GHRepository repoSpy = Mockito.spy(repo); PagedIterable<GHRef> iterableSpy = Mockito.spy(repoSpy.listRefs("tags")); Mockito.when(repoSpy.listRefs("tags")).thenReturn(iterableSpy); PagedIterator<GHRef> iteratorSpy = Mockito.spy(iterableSpy.iterator()); Mockito.when(iterableSpy.iterator()).thenReturn(iteratorSpy); Mockito.when(iteratorSpy.hasNext()).thenThrow(expectedError); Iterator<GHRef> tags = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); assertFalse(tags.hasNext()); }

Target:
public void testExistingMultipleTagsIteratorGHFileNotFoundExceptionOnHasNext() throws IOException { SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); Error expectedError = new Error("Bad Tag Request", new GHFileNotFoundException()); Error expectedError2 = new Error("Bad Tag Request IOError", new IOException()); Mockito.when(mockSCMHeadObserver.getIncludes()).thenReturn( new HashSet<>(Arrays.asList( new GitHubTagSCMHead("existent-multiple-tags1", System.currentTimeMillis()), new GitHubTagSCMHead("existent-multiple-tags2", System.currentTimeMillis())))); GitHubSCMSourceContext context = new GitHubSCMSourceContext(null, mockSCMHeadObserver); context.wantTags(true); GitHubSCMSourceRequest request = context.newRequest(new GitHubSCMSource("cloudbeers", "yolo", null, false), null); GHRepository repoSpy = Mockito.spy(repo); PagedIterable<GHRef> iterableSpy = Mockito.spy(repoSpy.listRefs("tags")); Mockito.when(repoSpy.listRefs("tags")).thenReturn(iterableSpy); PagedIterator<GHRef> iteratorSpy = Mockito.spy(iterableSpy.iterator()); Mockito.when(iterableSpy.iterator()).thenReturn(iteratorSpy); Mockito.when(iteratorSpy.hasNext()).thenThrow(expectedError).thenThrow(expectedError2); Iterator<GHRef> tags = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); Iterator<GHRef> tags2 = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); assertFalse(tags.hasNext()); try{ tags.hasNext(); fail("This should throw an exception"); } catch(Error e){ assertEquals("Bad Tag Request IOError", e.getMessage()); } }
Source:
private void shedQueuedOpportunisticContainers() { int numAllowed = this.queuingLimit.getMaxQueueLength(); Iterator<Container> containerIter = queuedOpportunisticContainers.values().iterator(); while (containerIter.hasNext()) { Container container = containerIter.next(); if (numAllowed <= 0) { container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Container Killed to make room for Guaranteed Container."); containerIter.remove(); LOG.info( "Opportunistic container will be killed to meet NM queuing" + " limits.", container.getContainerId()); } numAllowed--; } }

Target:
private void shedQueuedOpportunisticContainers() { int numAllowed = this.queuingLimit.getMaxQueueLength(); Iterator<Container> containerIter = queuedOpportunisticContainers.values().iterator(); while (containerIter.hasNext()) { Container container = containerIter.next(); if (numAllowed <= 0) { container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Container De-queued to meet NM queuing limits."); containerIter.remove(); LOG.info( "Opportunistic container will be killed to meet NM queuing" + " limits.", container.getContainerId()); } numAllowed--; } }
Source:
public void path_trie_dot_in_id() { pt.add("ScoreBoard.Rulesets.Rule(Period.Duration)"); pt.add("ScoreBoard.Rulesets.Rule(Jam.*)"); pt.add("ScoreBoard.Rulesets.Rule(Intermission*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Duration)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo.Bar)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); }

Target:
public void path_trie_dot_in_id() { pt.add("ScoreBoard.Rulesets.Rule(Period.Duration)"); pt.add("ScoreBoard.Rulesets.Rule(Jam.*)"); pt.add("ScoreBoard.Rulesets.Rule(Intermission*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Duration)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo.Bar)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); pt.add("ScoreBoard.Rulesets.Rule(*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); }
Source:
public Map<String, Criterion> getTeamKillMappings() { return teamKillMappings; }

Target:
public Map<String, Criterion> getTeamKillMappings() { return this.teamKillMappings; }
Source:
public void compactOnLaunch_multipleThread() throws IOException { final String REALM_NAME = "test.realm"; final CountDownLatch bgThreadDoneLatch = new CountDownLatch(1); final AtomicInteger compactOnLaunchCount = new AtomicInteger(0); final RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .name(REALM_NAME) .compactOnLaunch(new CompactOnLaunchCallback() { @Override public boolean shouldCompact(long totalBytes, long usedBytes) { compactOnLaunchCount.incrementAndGet(); return false; } }) .build(); Realm realm = Realm.getInstance(realmConfig); new Thread(new Runnable() { @Override public void run() { Realm bgRealm = Realm.getInstance(realmConfig); bgRealm.close(); bgThreadDoneLatch.countDown(); } }).run(); awaitOrFail(bgThreadDoneLatch); realm.close(); assertEquals(2, compactOnLaunchCount.get()); }

Target:
public void compactOnLaunch_multipleThread() throws IOException { final String REALM_NAME = "test.realm"; final AtomicInteger compactOnLaunchCount = new AtomicInteger(0); final RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .name(REALM_NAME) .compactOnLaunch(new CompactOnLaunchCallback() { @Override public boolean shouldCompact(long totalBytes, long usedBytes) { compactOnLaunchCount.incrementAndGet(); return true; } }) .build(); Realm realm = Realm.getInstance(realmConfig); Thread thread = new Thread(new Runnable() { @Override public void run() { Realm bgRealm = Realm.getInstance(realmConfig); bgRealm.close(); } }); thread.start(); try { thread.join(); } catch (InterruptedException e) { fail(); } realm.close(); assertNotEquals(1, compactOnLaunchCount.get()); assertEquals(3, compactOnLaunchCount.get()); }
Source:
private void makeComponents() { components = new ArrayList<InputStream>(); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(bodyBytes)); for (Attachment a : attachments) { try { components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(a.getInputStream()); } catch (IOException ioe) { throw new RuntimeException("aargh", ioe); } } components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(trailingBoundary)); }

Target:
private void makeComponents() { components = new ArrayList<InputStream>(); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(bodyBytes)); for (Attachment a : attachments) { try { components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(a.getInputStream()); } catch (IOException ioe) { deferrredException = ioe; } } components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(trailingBoundary)); }
Source:
private void createMappingTable() { ResultSet resultset = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name='openshift_metrics' AND table_name='metrics_mappings';"); if (resultset.all().isEmpty()) { session.execute("CREATE TABLE openshift_metrics.metrics_mappings (project_id text PRIMARY KEY, project_name text);"); } }

Target:
private void createMappingTable() { session.execute("CREATE TABLE IF NOT EXISTS openshift_metrics.metrics_mappings (project_id text PRIMARY KEY, project_name text) WITH compaction = { 'class' : 'LeveledCompactionStrategy' };"); }
Source:
public void testComplexPropertyChangedNegative() { final ComplexPropertyCollection<ComplexProperty> collection = createFakeComplexPropertyCollection(); collection.complexPropertyChanged(null); Assert.fail(); }

Target:
public void testComplexPropertyChangedNegative() { final ComplexPropertyCollection<ComplexProperty> collection = createFakeComplexPropertyCollection(); collection.complexPropertyChanged(null); }
Source:
protected void getDowntime() { if (getVm() != null && getVm().getStatus() == VMStatus.Up) { try { VDSReturnValue retVal = runVdsCommand(VDSCommandType.MigrateStatus, new MigrateStatusVDSCommandParameters(getDestinationVdsId(), getVmId())); if (retVal != null) { actualDowntime = (Integer) retVal.getReturnValue(); } } catch (VdcBLLException e) { migrationErrorCode = e.getErrorCode(); } } }

Target:
protected void getDowntime() { try { VDSReturnValue retVal = runVdsCommand(VDSCommandType.MigrateStatus, new MigrateStatusVDSCommandParameters(getDestinationVdsId(), getVmId())); if (retVal != null) { actualDowntime = (Integer) retVal.getReturnValue(); } } catch (VdcBLLException e) { migrationErrorCode = e.getErrorCode(); } }
Source:
protected List<Blob> handleNewRendition(String key, DocumentModel doc, RenditionDefinition definition, String sourceDocumentModificationDate) { Work work = getRenditionWork(key, doc, definition); if (log.isDebugEnabled()) { log.debug(String.format( "No entry found for key %s in the %s transient store, scheduling rendition work with id %s and storing an empty blob for now.", key, CACHE_NAME, work.getId())); } if (sourceDocumentModificationDate != null) { getTransientStore().putParameter(key, SOURCE_DOCUMENT_MODIFICATION_DATE_KEY, sourceDocumentModificationDate); } List<Blob> blobs = new ArrayList<>(); StringBlob emptyBlob = new StringBlob(""); emptyBlob.setFilename(LazyRendition.IN_PROGRESS_MARKER); emptyBlob.setMimeType("text/plain;" + LazyRendition.EMPTY_MARKER); blobs.add(emptyBlob); getTransientStore().putBlobs(key, blobs); Framework.getService(WorkManager.class).schedule(work, Scheduling.IF_NOT_SCHEDULED); return getTransientStore().getBlobs(key); }

Target:
protected List<Blob> handleNewRendition(String key, DocumentModel doc, RenditionDefinition definition, String sourceDocumentModificationDate) { Work work = getRenditionWork(key, doc, definition); if (log.isDebugEnabled()) { log.debug(String.format( "No entry found for key %s in the %s transient store, scheduling rendition work with id %s and storing an empty blob for now.", key, CACHE_NAME, work.getId())); } if (sourceDocumentModificationDate != null) { getTransientStore().putParameter(key, SOURCE_DOCUMENT_MODIFICATION_DATE_KEY, sourceDocumentModificationDate); } StringBlob emptyBlob = new StringBlob(""); emptyBlob.setFilename(LazyRendition.IN_PROGRESS_MARKER); emptyBlob.setMimeType("text/plain;" + LazyRendition.EMPTY_MARKER); getTransientStore().putBlobs(key, Collections.singletonList(emptyBlob)); Framework.getService(WorkManager.class).schedule(work, Scheduling.IF_NOT_SCHEDULED); return Collections.singletonList(emptyBlob); }
Source:
public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { return PomUtils.hasSnapshot(mavenProject.getVersion()) ? Lists.<ConnectorIssue>newArrayList() : Lists.newArrayList(new ConnectorIssue(KEY, String.format("Project artifact (%s) MUST have a SNAPSHOT. Current version is (%s) but it should be (%s-SNAPSHOT).", mavenProject.getArtifactId(), mavenProject.getVersion(), mavenProject.getVersion()))); }

Target:
public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { return PomUtils.hasSnapshot(mavenProject.getVersion()) ? Collections.<ConnectorIssue>emptyList() : Lists.newArrayList(new ConnectorIssue(KEY, String.format("Project artifact (%s) MUST have a SNAPSHOT. Current version is (%s) but it should be (%s-SNAPSHOT).", mavenProject.getArtifactId(), mavenProject.getVersion(), mavenProject.getVersion()))); }
Source:
public void clickPublishButtonDropdown() { scrollAndClick(cssPublishButtonDropdown); PageObjectLogging.log("clickCssPublishButton", "click on publish button dropdown", true); waitForElementByElement(cssPublishButtonDropdown); }

Target:
public void clickPublishButtonDropdown() { scrollAndClick(cssPublishButtonDropdown); PageObjectLogging.log("clickCssPublishButton", "click on publish button dropdown", true); }
Source:
public static AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(StringBuffer actual) { return new CharSequenceAssert(actual); }

Target:
public static AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(StringBuffer actual) { return AssertionsForClassTypes.assertThat(actual); }
Source:
protected void testForbiddenImpersonation(String admin, String adminRealm) { Keycloak client = createAdminClient(adminRealm, establishClientId(adminRealm), admin); try { client.realms().realm("test").users().get(impersonatedUserId).impersonate(); Assert.fail("Expected ClientErrorException wasn't thrown."); } catch (ClientErrorException e) { Assert.assertTrue(e.getMessage().contains("403 Forbidden")); } finally { client.close(); } }

Target:
protected void testForbiddenImpersonation(String admin, String adminRealm) { try (Keycloak client = createAdminClient(adminRealm, establishClientId(adminRealm), admin)) { client.realms().realm("test").users().get(impersonatedUserId).impersonate(); Assert.fail("Expected ClientErrorException wasn't thrown."); } catch (ClientErrorException e) { Assert.assertThat(e.getMessage(), containsString("403 Forbidden")); } }
Source:
public void run() { if (entrancePi == null) throw new IllegalStateException("You need to set entrance PI before run the topology."); while(entrancePi.injectNextEvent()) { if (this.getSourceDelay() > 0) { try { Thread.sleep(this.getSourceDelay()); } catch (InterruptedException e) { logger.error("Topology was interrupted while sleeping."); } } } }

Target:
public void run() { ThreadsEntranceProcessingItem entrancePi = (ThreadsEntranceProcessingItem) this.getEntranceProcessingItem(); if (entrancePi == null) throw new IllegalStateException("You need to set entrance PI before running the topology."); this.setupProcessingItemInstances(); entrancePi.getProcessor().onCreate(0); entrancePi.startSendingEvents(); }
Source:
public boolean readsExistingValues() { return putIfAbsent || flags == null || !flags.contains(Flag.IGNORE_RETURN_VALUES); }

Target:
public boolean readsExistingValues() { return putIfAbsent || !hasFlag(Flag.IGNORE_RETURN_VALUES); }
Source:
public List<SampleList> getAllTopLevelLists(final String programUUID) { try { final Criterion topFolder = Restrictions.like("hierarchy.listName", SampleListDao.ROOT_FOLDER); final Criterion nullFolder = Restrictions.isNull("hierarchy"); final Criteria criteria = this.getSession().createCriteria(SampleList.class); criteria.createAlias("hierarchy", "hierarchy"); criteria.add(Restrictions.or(topFolder, nullFolder)); this.addCriteriaForProgramUUIDInLists(programUUID, criteria); criteria.addOrder(Order.asc("listName")); return criteria.list(); } catch (final HibernateException e) { this.logAndThrowException("Error with getAllTopLevelLists() query from SampleList: " + e.getMessage(), e); } return new ArrayList<>(); }

Target:
public List<SampleList> getAllTopLevelLists(final String programUUID) { final Criteria criteria; try { final Criterion topFolder = Restrictions.like("hierarchy.listName", SampleListDao.ROOT_FOLDER); final Criterion nullFolder = Restrictions.isNull("hierarchy"); criteria = this.getSession().createCriteria(SampleList.class); criteria.createAlias("hierarchy", "hierarchy"); criteria.add(Restrictions.or(topFolder, nullFolder)); this.addCriteriaForProgramUUIDInLists(programUUID, criteria); criteria.addOrder(Order.asc("listName")); } catch (final HibernateException e) { throw new MiddlewareQueryException("Error with getAllTopLevelLists() query from SampleList: " + e.getMessage(), e); } return criteria.list(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_forgot_password_layout); mHandler = ViewModelProviders.of(this).get(RecoverPasswordHandler.class); mHandler.init(getFlowHolder()); mHandler.getPasswordResetListener().observe(this, new Observer<Task<String>>() { @Override public void onChanged(Task<String> task) { if (task.isSuccessful()) { mEmailInputLayout.setError(null); RecoveryEmailSentDialog.show(task.getResult(), getSupportFragmentManager()); } else if (task.getException() instanceof FirebaseAuthInvalidUserException || task.getException() instanceof FirebaseAuthInvalidCredentialsException) { mEmailInputLayout.setError(getString(R.string.fui_error_email_does_not_exist)); } else { mEmailInputLayout.setError(task.getException().getLocalizedMessage()); } } }); getFlowHolder().getProgressListener().observe(this, new Observer<Boolean>() { @Override public void onChanged(Boolean isDone) { if (isDone) { getDialogHolder().dismissDialog(); } else { getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_sending); } } }); mEmailInputLayout = findViewById(R.id.email_layout); mEmailEditText = findViewById(R.id.email); mEmailFieldValidator = new EmailFieldValidator(mEmailInputLayout); String email = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); if (email != null) { mEmailEditText.setText(email); } ImeHelper.setImeOnDoneListener(mEmailEditText, this); findViewById(R.id.button_done).setOnClickListener(this); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_forgot_password_layout); mHandler = ViewModelProviders.of(this).get(RecoverPasswordHandler.class); mHandler.init(getFlowHolder().getArguments()); mHandler.getProgressLiveData().observe(this, new Observer<Resource<String>>() { @Override public void onChanged(Resource<String> resource) { if (resource.getState() == State.LOADING) { getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_sending); return; } getDialogHolder().dismissDialog(); if (resource.getState() == State.SUCCESS) { mEmailInputLayout.setError(null); showEmailSentDialog(resource.getValue()); } else if (resource.getException() instanceof FirebaseAuthInvalidUserException || resource.getException() instanceof FirebaseAuthInvalidCredentialsException) { mEmailInputLayout.setError(getString(R.string.fui_error_email_does_not_exist)); } else { mEmailInputLayout.setError(resource.getException().getLocalizedMessage()); } } }); mEmailInputLayout = findViewById(R.id.email_layout); mEmailEditText = findViewById(R.id.email); mEmailFieldValidator = new EmailFieldValidator(mEmailInputLayout); String email = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); if (email != null) { mEmailEditText.setText(email); } ImeHelper.setImeOnDoneListener(mEmailEditText, this); findViewById(R.id.button_done).setOnClickListener(this); }
Source:
public ArithmeticPostAggregator( @JsonProperty("name") String name, @JsonProperty("fn") String fnName, @JsonProperty("fields") List<PostAggregator> fields, @JsonProperty("ordering") String ordering ) { Preconditions.checkArgument(fnName != null, "fn cannot not be null"); this.name = name; this.fnName = fnName; this.fields = fields; this.binary = BinaryOp.lookup(fnName); this.unary = UnaryOp.lookup(fnName); if (binary != null) { Preconditions.checkArgument( fields != null && fields.size() >= 2, "Illegal number of fields[%s], must be >= 2" ); } else if (unary != null) { Preconditions.checkArgument( fields != null && fields.size() == 1, "Illegal number of fields[%s], must be == 1" ); } else { throw new IAE("Unknown operation[%s], known operations[%s and %s] ", fnName, UnaryOp.getFns(), BinaryOp.getFns()); } this.function = toFunction(); this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); }

Target:
public ArithmeticPostAggregator( @JsonProperty("name") String name, @JsonProperty("fn") String fnName, @JsonProperty("fields") List<PostAggregator> fields, @JsonProperty("ordering") String ordering ) { Preconditions.checkArgument(fnName != null, "fn cannot not be null"); Preconditions.checkArgument(fields != null && fields.size() > 1, "Illegal number of fields[%s], must be > 1"); this.name = name; this.fnName = fnName; this.fields = fields; this.op = Ops.lookup(fnName); if (op == null) { throw new IAE("Unknown operation[%s], known operations[%s]", fnName, Ops.getFns()); } this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); }
Source:
private List<DataValue> generateReportDataValues(Long transfusionSiteId, Date startDate, Date endDate) { List<TransfusionSummaryDTO> dtos = transfusionRepository.findTransfusionSummaryRecordedForUsageSiteForPeriod(transfusionSiteId, startDate, endDate); List<DataValue> dataValues = new ArrayList<>(dtos.size()); for (TransfusionSummaryDTO dto : dtos) { DataValue dataValue = new DataValue(); dataValue.setStartDate(startDate); dataValue.setEndDate(endDate); dataValue.setLocation(locationFactory.createViewModel(dto.getTransfusionSite())); dataValue.setValue(dto.getCount()); Cohort transfusionReactionTypeCohort = new Cohort(); transfusionReactionTypeCohort.setCategory(CohortConstants.TRANSFUSION_REACTION_TYPE_CATEGORY); transfusionReactionTypeCohort.setComparator(Comparator.EQUALS); transfusionReactionTypeCohort.setOption(dto.getTransfusionReactionType().getName()); dataValue.addCohort(transfusionReactionTypeCohort); Cohort transfusionOutcomeCohort = new Cohort(); transfusionOutcomeCohort.setCategory(CohortConstants.TRANSFUSION_OUTCOME_CATEGORY); transfusionOutcomeCohort.setComparator(Comparator.EQUALS); transfusionOutcomeCohort.setOption(dto.getTransfusionOutcome()); dataValue.addCohort(transfusionOutcomeCohort); dataValues.add(dataValue); } return dataValues; }

Target:
private List<DataValue> generateReportDataValues(Long transfusionSiteId, Date startDate, Date endDate) { List<TransfusionSummaryDTO> dtos = transfusionRepository.findTransfusionSummaryRecordedForUsageSiteForPeriod(transfusionSiteId, startDate, endDate); List<DataValue> dataValues = new ArrayList<>(dtos.size()); for (TransfusionSummaryDTO dto : dtos) { DataValue dataValue = new DataValue(); dataValue.setStartDate(startDate); dataValue.setEndDate(endDate); dataValue.setLocation(locationFactory.createViewModel(dto.getTransfusionSite())); dataValue.setValue(dto.getCount()); Cohort transfusionReactionTypeCohort = new Cohort(); transfusionReactionTypeCohort.setCategory(CohortConstants.TRANSFUSION_REACTION_TYPE_CATEGORY); transfusionReactionTypeCohort.setComparator(Comparator.EQUALS); if (dto.getTransfusionReactionType() != null) { transfusionReactionTypeCohort.setOption(dto.getTransfusionReactionType().getName()); } dataValue.addCohort(transfusionReactionTypeCohort); Cohort transfusionOutcomeCohort = new Cohort(); transfusionOutcomeCohort.setCategory(CohortConstants.TRANSFUSION_OUTCOME_CATEGORY); transfusionOutcomeCohort.setComparator(Comparator.EQUALS); transfusionOutcomeCohort.setOption(dto.getTransfusionOutcome()); dataValue.addCohort(transfusionOutcomeCohort); dataValues.add(dataValue); } return dataValues; }
Source:
private void validatePlanExecution(MigrationDefinition definition, Plan plan) throws InvalidMigrationException { if (!kieService.existsProcessDefinition(plan.getSourceContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { throw new ProcessNotFoundException(plan.getSourceContainerId()); } if (!kieService.existsProcessDefinition(plan.getTargetContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { throw new ProcessNotFoundException(plan.getTargetContainerId()); } }

Target:
private void validatePlanExecution(MigrationDefinition definition, Plan plan) throws InvalidMigrationException { if (!kieService.existsProcessDefinition(plan.getSourceContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { throw new ProcessNotFoundException(plan.getSourceContainerId()); } }
Source:
public void compact(OutputStream out) throws IOException { MergedReftable mr = new MergedReftable(new ArrayList<>(tables)); mr.setIncludeDeletes(includeDeletes); writer.setMinUpdateIndex(minUpdateIndex); writer.setMaxUpdateIndex(maxUpdateIndex); writer.begin(out); mergeRefs(mr); mergeLogs(mr); writer.finish(); stats = writer.getStats(); }

Target:
public void compact(OutputStream out) throws IOException { MergedReftable mr = new MergedReftable(new ArrayList<>(tables)); mr.setIncludeDeletes(includeDeletes); minUpdateIndex = Math.max(minUpdateIndex, 0); writer.setMinUpdateIndex(minUpdateIndex); writer.setMaxUpdateIndex(maxUpdateIndex); writer.begin(out); mergeRefs(mr); mergeLogs(mr); writer.finish(); stats = writer.getStats(); }
Source:
default List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull) { throw new PrestoException(NOT_SUPPORTED, "This connector does not support list tables"); }

Target:
default List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull) { return emptyList(); }