auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final List<String> getPaths(final ResourceResolver resourceResolver, final String path, final String[] nodeTypes) throws RepositoryException { final List<String> collectionPaths = new ArrayList<String>(); final Resource resource = resourceResolver.getResource(path); if (resource == null) { log.warn("Requesting paths for a non-existent Resource [ ]; returning empty results.", path); return Collections.emptyList(); } if (!isWorkflowPackage(resourceResolver, path)) { log.debug("Requesting paths for a non-Resource Collection [ ]; returning provided path.", path); return Arrays.asList(new String[] { path }); } final PageManager pageManager = resourceResolver.adaptTo(PageManager.class); final Page page = pageManager.getContainingPage(path); final Resource contentResource = page == null ? null : page.getContentResource(); if (contentResource != null) { final Node node = contentResource.adaptTo(Node.class); final ResourceCollection resourceCollection = getResourceCollection(node); if (resourceCollection != null) { final List<Node> members = resourceCollection.list(nodeTypes); for (final Node member : members) { collectionPaths.add(member.getPath()); } return collectionPaths; } } return Arrays.asList(new String[]{ path }); }

Target:
public final List<String> getPaths(final ResourceResolver resourceResolver, final String path, final String[] nodeTypes) throws RepositoryException { final List<String> collectionPaths = new ArrayList<String>(); final Resource resource = resourceResolver.getResource(path); if (resource == null) { log.warn("Requesting paths for a non-existent Resource [ ]; returning empty results.", path); return Collections.emptyList(); } else if (!isWorkflowPackage(resourceResolver, path)) { log.debug("Requesting paths for a non-Resource Collection [ ]; returning provided path.", path); return Arrays.asList(new String[]{ path }); } else { final PageManager pageManager = resourceResolver.adaptTo(PageManager.class); final Page page = pageManager.getContainingPage(path); if (page != null && page.getContentResource() != null) { final Node node = page.getContentResource().adaptTo(Node.class); final ResourceCollection resourceCollection = getResourceCollection(node); if (resourceCollection != null) { final List<Node> members = resourceCollection.list(nodeTypes); for (final Node member : members) { collectionPaths.add(member.getPath()); } return collectionPaths; } } return Arrays.asList(new String[]{ path }); } }
Source:
public void unsupportedDatabaseTypeIdentified() { IllegalArgumentException thrown = Assertions.assertThrows(IllegalArgumentException.class, () -> new DatabaseInitializer("a2", ds, environmentCreateOnStartup("true"))); assertThat(thrown.getMessage(), CoreMatchers.containsString("No ddl script found")); }

Target:
public void unsupportedDatabaseTypeIdentified() { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> new DatabaseInitializer("a2", ds, environmentCreateOnStartup("true"))); assertThat(thrown.getMessage(), containsString("No ddl script found")); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { return Collections.singletonList(new PermissionSubject(getParameters().getProfile().getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup())); }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { return Collections.singletonList(new PermissionSubject(getParameters().getProfile() != null ? getParameters().getProfile() .getStorageDomainId() : null, VdcObjectType.Storage, getActionType().getActionGroup())); }
Source:
public void dispose() { logger.debug("Disposing MeteoBlue handler."); shuttingDown = true; if (refreshJob != null && !refreshJob.isCancelled()) { refreshJob.cancel(true); refreshJob = null; } }

Target:
public void dispose() { logger.debug("Disposing meteoblue handler."); if (refreshJob != null && !refreshJob.isCancelled()) { refreshJob.cancel(true); refreshJob = null; } }
Source:
public synchronized void skipNextPacket() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; pcapPacketHeader = parseBlockOrPacketHeader(); if (pcapPacketHeader != null) { pcapPacketHeader.position(PcapFileValues.INCLUDED_LENGTH_POSITION); long includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); TreeMap<Long, Long> fileIndex = getFileIndex(); fileIndex.put(getCurrentRank(), getFileChannel().position()); setCurrentRank(getCurrentRank() + 1); } }

Target:
public synchronized void skipNextPacket() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; long includedPacketLength; SeekableByteChannel fileChannel = getFileChannel(); if (fileChannel.size() - fileChannel.position() == 0) { return; } if (fileChannel.size() - fileChannel.position() < PcapFileValues.PCAPNG_PACKET_HEADER_SIZE) { return; } pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketHeader.clear(); pcapPacketHeader.order(getByteOrder()); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); int blockType = pcapPacketHeader.getInt(); if (blockType == PcapFileValues.PCAPNG_IDB) { pcapPacketHeader.getInt(); pcapPacketHeader.position(PcapFileValues.INTERFACE_DESCRIPTION_SIZE); long dataLinkType = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getShort()); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapPacketHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); fInterfaceID++; } switch (blockType) { case PcapFileValues.PCAPNG_PB: case PcapFileValues.PCAPNG_EPB: pcapPacketHeader.position(PcapFileValues.PCAPNG_PACKET_CAPTURE_LENGTH_POS); includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); TreeMap<Long, Long> fileIndex = getFileIndex(); fileIndex.put(getCurrentRank(), getFileChannel().position()); setCurrentRank(getCurrentRank() + 1); break; default: break; } }
Source:
protected void setClusterCriterias(final String clusterCriterias) { if (StringUtils.isEmpty(clusterCriterias)) { this.clusterCriterias = EMPTY_JSON_ARRAY; } else { this.clusterCriterias = clusterCriterias; } }

Target:
protected void setClusterCriterias(final String clusterCriterias) { this.clusterCriterias = StringUtils.isBlank(clusterCriterias) ? EMPTY_JSON_ARRAY : clusterCriterias; }
Source:
private void shutdownVpnRunner() { mActiveNetwork = null; mIsRunning = false; resetIkeState(); final ConnectivityManager cm = ConnectivityManager.from(mContext); cm.unregisterNetworkCallback(mNetworkCallback); }

Target:
private void shutdownVpnRunner() { mActiveNetwork = null; mIsRunning = false; resetIkeState(); final ConnectivityManager cm = ConnectivityManager.from(mContext); cm.unregisterNetworkCallback(mNetworkCallback); mExecutor.shutdown(); }
Source:
public URI getUri() { StringBuffer url = request.getRequestURL(); if (request.getQueryString() != null && !request.getQueryString().isEmpty()) { url.append('?').append(request.getQueryString()); } try { return URI.create(URLEncoder.encode(url.toString(), Charset.defaultCharset().name())); } catch (UnsupportedEncodingException uee){ LOGGER.log(Level.WARNING, "Exception encoding string to URL", uee); return URI.create(url.toString()); } }

Target:
public URI getUri() { StringBuffer url = request.getRequestURL(); if (request.getQueryString() != null && !request.getQueryString().isEmpty()) { url.append("?").append(request.getQueryString()); } try { return URI.create(url.toString()); } catch (IllegalArgumentException iae) { return URI.create(UriEscaperUtil.escape(url.toString())); } }
Source:
public void testModifyJdbcCall() throws SQLException { assertEquals("select * from pack_getValue(?,?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue(?) }", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from pack_getValue(?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue()}", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from pack_getValue(?,?,?,?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue(?,?,?) }", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from lower(?,?) as result", Parser.modifyJdbcCall("{ ? = call lower(?)}", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); }

Target:
public void testModifyJdbcCall() throws SQLException { assertEquals("select * from pack_getValue(?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue}", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from pack_getValue(?,?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue(?) }", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from pack_getValue(?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue()}", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from pack_getValue(?,?,?,?) as result", Parser.modifyJdbcCall("{ ? = call pack_getValue(?,?,?) }", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); assertEquals("select * from lower(?,?) as result", Parser.modifyJdbcCall("{ ? = call lower(?)}", true, ServerVersion.v9_6.getVersionNum(), 3).getSql()); }
Source:
public void deleteFileInMediaScan(String path) { String mimetypeString = FileStorageUtils.getMimeTypeFromName(path); if (mimetypeString.startsWith("image/")) { getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("audio/")) { getContentResolver().delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, MediaStore.Audio.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("video/")) { getContentResolver().delete(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, MediaStore.Video.Media.DATA + "=?", new String[]{path}); } }

Target:
public void deleteFileInMediaScan(String path) { String mimetypeString = FileStorageUtils.getMimeTypeFromName(path); ContentResolver contentResolver = getContentResolver(); if (contentResolver != null) { if (mimetypeString.startsWith("image/")) { contentResolver.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("audio/")) { contentResolver.delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, MediaStore.Audio.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("video/")) { contentResolver.delete(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, MediaStore.Video.Media.DATA + "=?", new String[]{path}); } } else { ContentProviderClient contentProviderClient = getContentProviderClient(); try { if (mimetypeString.startsWith("image/")) { contentProviderClient.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("audio/")) { contentProviderClient.delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, MediaStore.Audio.Media.DATA + "=?", new String[]{path}); } else if (mimetypeString.startsWith("video/")) { contentProviderClient.delete(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, MediaStore.Video.Media.DATA + "=?", new String[]{path}); } } catch (RemoteException e) { Log_OC.e(TAG, "Exception deleting media file in MediaStore " + e.getMessage()); } } }
Source:
public TmfEventTableDataProvider(ITmfTrace trace, Iterable<ITmfEventAspect<?>> aspects) { super(trace); fAspects = new LinkedHashMap<>(); for (ITmfEventAspect<?> aspect : aspects) { fAspects.put(aspect.getName(), aspect); } }

Target:
public TmfEventTableDataProvider(ITmfTrace trace, Iterable<ITmfEventAspect<?>> aspects) { super(trace); fAspects = Objects.requireNonNull(LinkedHashMultimap.create()); for (ITmfEventAspect<?> aspect : aspects) { fAspects.put(aspect.getName(), aspect); } }
Source:
private void processProbe() { verify(probe != null); PagesSpatialIndex pagesSpatialIndex = getDone(pagesSpatialIndexFuture); for (int position = probePosition; position < probe.getPositionCount(); position++) { if (this.joinAddresses == null) { joinAddresses = pagesSpatialIndex.findJoinAddresses(position, probe, probeGeometryChannel, spatialRelationshipTest); joinAddressIndex = -1; } for (int joinAddressIndex = this.joinAddressIndex + 1; joinAddressIndex < joinAddresses.size(); joinAddressIndex++) { if (pageBuilder.isFull()) { probePosition = position; this.joinAddressIndex = joinAddressIndex; return; } long joinAddress = joinAddresses.get(joinAddressIndex); pageBuilder.declarePosition(); int outputChannelOffset = 0; for (int outputIndex : probeOutputChannels) { Type type = probeTypes.get(outputIndex); Block block = probe.getBlock(outputIndex); type.appendTo(block, position, pageBuilder.getBlockBuilder(outputChannelOffset)); outputChannelOffset++; } pagesSpatialIndex.appendTo(joinAddress, pageBuilder, outputChannelOffset); } this.joinAddresses = null; } this.probe = null; this.probePosition = 0; }

Target:
private void processProbe() { verify(probe != null); PagesSpatialIndex pagesSpatialIndex = getDone(pagesSpatialIndexFuture); DriverYieldSignal yieldSignal = operatorContext.getDriverContext().getYieldSignal(); while (probePosition < probe.getPositionCount()) { if (joinAddresses == null) { joinAddresses = pagesSpatialIndex.findJoinAddresses(probePosition, probe, probeGeometryChannel); localUserMemoryContext.setBytes(sizeOf(joinAddresses)); nextJoinAddressIndex = 0; if (yieldSignal.isSet()) { return; } } while (nextJoinAddressIndex < joinAddresses.length) { if (pageBuilder.isFull()) { return; } long joinAddress = joinAddresses[nextJoinAddressIndex]; if (pagesSpatialIndex.isJoinAddressEligible(joinAddress, probePosition, probe)) { pageBuilder.declarePosition(); int outputChannelOffset = 0; for (int outputIndex : probeOutputChannels) { Type type = probeTypes.get(outputIndex); Block block = probe.getBlock(outputIndex); type.appendTo(block, probePosition, pageBuilder.getBlockBuilder(outputChannelOffset)); outputChannelOffset++; } pagesSpatialIndex.appendTo(joinAddress, pageBuilder, outputChannelOffset); } nextJoinAddressIndex++; if (yieldSignal.isSet()) { return; } } joinAddresses = null; localUserMemoryContext.setBytes(0); probePosition++; } this.probe = null; this.probePosition = 0; }
Source:
public JwtAuthenticationToken build() { if (!jwt.hasHeader()) { jwt.header(DEFAULT_HEADER_NAME, DEFAULT_HEADER_VALUE); } final Jwt token = jwt.build(); final Collection<GrantedAuthority> tokenAuthorities = authoritiesConverter.convert(token); final Collection<GrantedAuthority> authorities = addedAuthorities.isEmpty() ? tokenAuthorities : Stream.concat(tokenAuthorities.stream(), addedAuthorities.stream()).collect(Collectors.toSet()); return new JwtAuthenticationToken(token, authorities); }

Target:
public JwtAuthenticationToken build() { final Jwt token = getToken(); return new JwtAuthenticationToken(token, getAuthorities(token)); }
Source:
public void execute(CommandLine options) throws Exception { boolean mergeBlocks = options.hasOption('b'); int maxBlockSize = options.hasOption('l')? Integer.parseInt(options.getOptionValue('l')) : 128; CompressionCodecName compressionCodec = options.hasOption('c') ? CompressionCodecName.valueOf(options.getOptionValue('c')) : CompressionCodecName.SNAPPY; List<String> args = options.getArgList(); List<Path> inputFiles = getInputFiles(args.subList(0, args.size() - 1)); Path outputFile = new Path(args.get(args.size() - 1)); if (mergeBlocks) { CodecFactory.BytesCompressor compressor = new CodecFactory(conf, DEFAULT_PAGE_SIZE).getCompressor(compressionCodec); mergeBlocks(maxBlockSize * 1024 * 1024, compressor, inputFiles, outputFile); } else { mergeFiles(inputFiles, outputFile); } }

Target:
public void execute(CommandLine options) throws Exception { boolean mergeBlocks = options.hasOption('b'); int maxBlockSize = options.hasOption('l')? Integer.parseInt(options.getOptionValue('l')) * 1024 * 1024 : DEFAULT_BLOCK_SIZE; CompressionCodecName compressionCodec = options.hasOption('c') ? CompressionCodecName.valueOf(options.getOptionValue('c')) : CompressionCodecName.SNAPPY; List<String> args = options.getArgList(); List<Path> inputFiles = getInputFiles(args.subList(0, args.size() - 1)); Path outputFile = new Path(args.get(args.size() - 1)); if (mergeBlocks) { CodecFactory.BytesCompressor compressor = new CodecFactory(conf, DEFAULT_PAGE_SIZE).getCompressor(compressionCodec); mergeBlocks(maxBlockSize, compressor, inputFiles, outputFile); } else { mergeFiles(inputFiles, outputFile); } }
Source:
public GarrukSavageHerald(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{G}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); this.addAbility(new LoyaltyAbility(new GarrukSavageHeraldEffect(), 1)); Ability minusAbility = new LoyaltyAbility(new DamageWithPowerFromOneToAnotherTargetEffect(), -2); minusAbility.addTarget(new TargetControlledCreaturePermanent()); minusAbility.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); this.addAbility(minusAbility); ContinuousEffect ultimateEffect = new GainAbilityControlledEffect(DamageAsThoughNotBlockedAbility.getInstance(), Duration.EndOfTurn); ultimateEffect.setText("Until end of turn, creatures you control gain \"You may have this creature assign its combat damage as though it weren't blocked.\""); ultimateEffect.setDependedToType(DependencyType.AddingAbility); this.addAbility(new LoyaltyAbility(ultimateEffect, -7)); }

Target:
public GarrukSavageHerald(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{G}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); this.addAbility(new LoyaltyAbility(new GarrukSavageHeraldEffect(), 1)); DamageWithPowerFromOneToAnotherTargetEffect effect = new DamageWithPowerFromOneToAnotherTargetEffect(); effect.setText("Target creature you control deals damage equal to its power to another target creature"); Ability minusAbility = new LoyaltyAbility(effect, -2); TargetControlledCreaturePermanent controlledCreature = new TargetControlledCreaturePermanent(); controlledCreature.setTargetTag(1); minusAbility.addTarget(controlledCreature); FilterCreaturePermanent filter = new FilterCreaturePermanent("Another creature: damage dealt to"); filter.add(new AnotherTargetPredicate(2)); TargetCreaturePermanent anotherTargetCreature = new TargetCreaturePermanent(filter); minusAbility.addTarget(anotherTargetCreature); this.addAbility(minusAbility); ContinuousEffect ultimateEffect = new GainAbilityControlledEffect(DamageAsThoughNotBlockedAbility.getInstance(), Duration.EndOfTurn); ultimateEffect.setText("Until end of turn, creatures you control gain \"You may have this creature assign its combat damage as though it weren't blocked.\""); this.addAbility(new LoyaltyAbility(ultimateEffect, -7)); }
Source:
public Variable createVariable(IBinding element, IType enclosingType, int positionScore) throws CModelException { IType elementType = getType(element); String elementName = element.getName(); if (elementType != null && (elementType.toString().equals(enclosingType.toString()) || elementType.isSameType(enclosingType) || isParent(elementType, enclosingType) || isAutomaticCasting(enclosingType, elementType) || isReferenceTo(enclosingType, elementType) || isReferenceTo(elementType, enclosingType))) { int variableType = Variable.GLOBAL; if (element instanceof ICPPField) { variableType = Variable.FIELD; } else if (element instanceof IVariable) { try { if (element instanceof ICPPBinding && ((ICPPBinding) element).isGloballyQualified()) { variableType = Variable.GLOBAL; } else { variableType = Variable.LOCAL; } } catch (DOMException e) { } } if (isReferenceTo(enclosingType, elementType)) elementName = "&" + elementName; else if (isReferenceTo(elementType, enclosingType)) elementName = "*" + elementName; return new Variable(elementType, elementName, variableType, positionScore, NO_TRIGGERS, getImageDescriptor(element)); } return null; }

Target:
private Variable createVariable(IBinding element, IType enclosingType, int positionScore) throws CModelException { IType elementType = getType(element); String elementName = element.getName(); if (elementType != null && (elementType.toString().equals(enclosingType.toString()) || elementType.isSameType(enclosingType) || isParent(elementType, enclosingType) || isAutomaticCasting(enclosingType, elementType) || isReferenceTo(enclosingType, elementType) || isReferenceTo(elementType, enclosingType))) { VariableType variableType = VariableType.GLOBAL; if (element instanceof ICPPField) { variableType = VariableType.FIELD; } else if (element instanceof IVariable) { try { if (element instanceof ICPPBinding && ((ICPPBinding) element).isGloballyQualified()) { variableType = VariableType.GLOBAL; } else { variableType = VariableType.LOCAL; } } catch (DOMException e) { } } if (isReferenceTo(enclosingType, elementType)) elementName = "&" + elementName; else if (isReferenceTo(elementType, enclosingType)) elementName = "*" + elementName; return new Variable(elementName, variableType, positionScore, NO_TRIGGERS, getImageDescriptor(element)); } return null; }
Source:
public Subscription createSubscription(final SubscriptionBase subscriptionBase) throws TooManyPartitionsException, RepositoryProblemException, DuplicatedSubscriptionException, NoSuchEventTypeException, InconsistentStateException, WrongInitialCursorsException, DbWriteOperationsBlockedException, UnableProcessException, AuthorizationSectionException, ServiceTemporarilyUnavailableException { checkFeatureToggles(subscriptionBase); subscriptionValidationService.validateSubscription(subscriptionBase); final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); authorizationValidator.authorizeSubscriptionView(subscription); nakadiKpiPublisher.publish(subLogEventType, () -> new JSONObject() .put("subscription_id", subscription.getId()) .put("status", "created")); nakadiAuditLogPublisher.publish(Optional.empty(), Optional.of(subscription), NakadiAuditLogPublisher.ResourceType.SUBSCRIPTION, NakadiAuditLogPublisher.ActionType.CREATED, subscription.getId()); return subscription; }

Target:
public Subscription createSubscription(final SubscriptionBase subscriptionBase) throws TooManyPartitionsException, RepositoryProblemException, DuplicatedSubscriptionException, NoSuchEventTypeException, InconsistentStateException, WrongInitialCursorsException, DbWriteOperationsBlockedException, UnableProcessException, AuthorizationNotPresentException, ServiceTemporarilyUnavailableException { checkFeatureTogglesForCreationAndUpdate(subscriptionBase); subscriptionValidationService.validateSubscription(subscriptionBase); final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); authorizationValidator.authorizeSubscriptionView(subscription); nakadiKpiPublisher.publish(subLogEventType, () -> new JSONObject() .put("subscription_id", subscription.getId()) .put("status", "created")); nakadiAuditLogPublisher.publish(Optional.empty(), Optional.of(subscription), NakadiAuditLogPublisher.ResourceType.SUBSCRIPTION, NakadiAuditLogPublisher.ActionType.CREATED, subscription.getId()); return subscription; }
Source:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); setSucceeded(vdsReturnaValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); return; } else { VDSReturnValue vdsRettunValueStatus = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) vdsRettunValueStatus.getReturnValue(); List<Step> stepsList = getDbFacade().getStepDao() .getStepsByExternalId(getGlusterVolumeDao().getById(getParameters().getVolumeId()) .getAsyncTask() .getStepId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } getReturnValue().setActionReturnValue(entity); } endStepJob(); releaseVolumeLock(); }

Target:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); setSucceeded(vdsReturnaValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); return; } else { VDSReturnValue vdsRettunValueStatus = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); if(vdsRettunValueStatus.getSucceeded()) { GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) vdsRettunValueStatus.getReturnValue(); List<Step> stepsList = getDbFacade().getStepDao() .getStepsByExternalId(getGlusterVolume().getAsyncTask().getTaskId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } getReturnValue().setActionReturnValue(entity); } } endStepJob(); releaseVolumeLock(); }
Source:
private <T> void executeOperation(final DataOperation<T> operation) { final List<LongRange> dataKeyRanges = operation.getDataKeyRanges(); final Pair<List<LongRange>, Map<String, List<LongRange>>> routingResult = router.route(dataKeyRanges); final List<LongRange> localKeyRanges = routingResult.getFirst(); final Map<String, List<LongRange>> remoteKeyRangesMap = routingResult.getSecond(); if (operation.isFromLocalClient()) { resultAggregator.registerOperation(operation, remoteKeyRangesMap.size() + 1); } if (operation.isFromLocalClient() && !remoteKeyRangesMap.isEmpty()) { sendOperationsToRemoteStores(operation, remoteKeyRangesMap); } final Map<Long, T> localOutputData; if (!localKeyRanges.isEmpty()) { localOutputData = executeLocalOperation(operation, localKeyRanges); } else { localOutputData = Collections.EMPTY_MAP; } if (operation.isFromLocalClient()) { resultAggregator.submitResultAndWaitRemoteOps(operation, localOutputData); } else { final Collection<List<LongRange>> failedRanges = remoteKeyRangesMap.values(); sendResultToOriginStore(operation, localOutputData, failedRanges); } }

Target:
private <T> void executeOperation(final DataOperation<T> operation) { final List<LongRange> dataKeyRanges = operation.getDataKeyRanges(); final Pair<List<LongRange>, Map<String, List<LongRange>>> routingResult = router.route(dataKeyRanges); final List<LongRange> localKeyRanges = routingResult.getFirst(); final Map<String, List<LongRange>> remoteKeyRangesMap = routingResult.getSecond(); if (operation.isFromLocalClient()) { final int numSubOps = remoteKeyRangesMap.size() + 1; resultAggregator.registerOperation(operation, numSubOps); } if (operation.isFromLocalClient() && !remoteKeyRangesMap.isEmpty()) { sendOperationsToRemoteStores(operation, remoteKeyRangesMap); } final Map<Long, T> localOutputData; if (!localKeyRanges.isEmpty()) { localOutputData = executeLocalOperation(operation, localKeyRanges); } else { localOutputData = Collections.EMPTY_MAP; } if (operation.isFromLocalClient()) { resultAggregator.submitLocalResult(operation, localOutputData); } else { final Collection<List<LongRange>> failedRanges = remoteKeyRangesMap.values(); sendResultToOrigin(operation, localOutputData, failedRanges); } }
Source:
public <T extends IRemoteConnection.Service> T getService(IRemoteConnection connection, Class<T> service) { if (IRemoteCommandShellService.class.equals(service)) { return (T) new JSchCommandShellService(connection); } else { return null; } }

Target:
public <T extends IRemoteConnection.Service> T getService(IRemoteConnection connection, Class<T> service) { if (IRemoteCommandShellService.class.equals(service)) { return (T) new JSchCommandShellService(connection); } return null; }
Source:
public void testTransientVariableDeletion() { runtimeService.startProcessInstanceByKey("transientVarsTest"); }

Target:
public void testTransientVariableDeletion() { String processInstanceId = runtimeService.startProcessInstanceByKey("transientVarsTest").getId(); long count = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName("response").count(); assertEquals(0, count); count = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName("status").count(); assertEquals(0, count); }
Source:
public static Collection<EClass> getSubClasses(EClass superClass) { final Collection<EClass> classes = new HashSet<EClass>(); for (final EPackage ePackage : getAllRegisteredEPackages()) { for (final EClassifier eClassifier : ePackage.getEClassifiers()) { if (eClassifier instanceof EClass) { final EClass eClass = (EClass) eClassifier; if (superClass.isSuperTypeOf(eClass) && !eClass.isAbstract() && !eClass.isInterface() || EcorePackage.eINSTANCE.getEObject() == superClass) { classes.add(eClass); } } } } return classes; }

Target:
public static Collection<EClass> getSubClasses(EClass superClass) { final Collection<EClass> classes = new HashSet<EClass>(); for (final EPackage ePackage : getAllRegisteredEPackages()) { for (final EClassifier eClassifier : ePackage.getEClassifiers()) { if (eClassifier instanceof EClass) { final EClass eClass = (EClass) eClassifier; if (!eClass.isAbstract() && !eClass.isInterface() && (EcorePackage.eINSTANCE.getEObject() == superClass || superClass.isSuperTypeOf(eClass))) { classes.add(eClass); } } } } return classes; }
Source:
private WaitForDownloadService.ThenPerform.Action<Void> executeUpdateNotification(DownloadBatchStatus downloadBatchStatus) { return () -> { NotificationInformation notificationInformation = notificationCreator.createNotification(downloadBatchStatus); if (downloadBatchStatus.status() == DELETION) { downloadService.dismissNotification(notificationInformation); return null; } if (downloadBatchStatus.status() == DOWNLOADED) { downloadService.stackNotification(notificationInformation); return null; } downloadService.updateNotification(notificationInformation); return null; }; }

Target:
private WaitForDownloadService.ThenPerform.Action<Void> executeUpdateNotification(DownloadBatchStatus downloadBatchStatus) { return () -> { NotificationInformation notificationInformation = notificationCreator.createNotification(downloadBatchStatus); if (downloadBatchStatus.status() == DOWNLOADED || downloadBatchStatus.status() == DELETION) { downloadService.stackNotification(notificationInformation); } else { downloadService.updateNotification(notificationInformation); } return null; }; }
Source:
protected void copyProperties(MetaDataMap metaDataMap, ResourceResolver resourceResolver, String payload) { final Resource resource = workflowHelper.getPageOrAssetResource(resourceResolver, payload); if (resource == null) { log.debug("Could not process payload [ ] as it could be resolved to a Page or Asset", payload); return; } final Boolean skipEmptyValue = metaDataMap.get(PN_SKIP_EMPTY_SOURCE_PROPERTY, Boolean.TRUE); final String[] propertyMaps = metaDataMap.get(PN_PROPERTY_MAP, new String[]{}); for (String propertyMap : propertyMaps) { propertyMap = StringUtils.replace(propertyMap, ALTERNATE_SEPARATOR, SEPARATOR); Map.Entry<String, String> entry = ParameterUtil.toMapEntry(propertyMap, SEPARATOR); try { PropertyResource source = new PropertyResource(StringUtils.trim(entry.getKey()), resource.getPath(), resourceResolver); PropertyResource destination = new PropertyResource(StringUtils.trim(entry.getValue()), resource.getPath(), resourceResolver); destination.setValue(source.getValue(), skipEmptyValue); } catch (WorkflowException e) { log.error("Could not copy properties", e); } } }

Target:
protected void copyProperties(MetaDataMap metaDataMap, ResourceResolver resourceResolver, String payload) { final Resource resource = workflowHelper.getPageOrAssetResource(resourceResolver, payload); if (resource == null) { log.warn("Could not process payload [ ] as it could be resolved to a Page or Asset", payload); return; } final Boolean skipEmptyValue = metaDataMap.get(PN_SKIP_EMPTY_SOURCE_PROPERTY, Boolean.TRUE); final String[] propertyMaps = metaDataMap.get(PN_PROPERTY_MAP, new String[]{}); for (String propertyMap : propertyMaps) { propertyMap = StringUtils.replace(propertyMap, ALTERNATE_SEPARATOR, SEPARATOR); Map.Entry<String, String> entry = ParameterUtil.toMapEntry(propertyMap, SEPARATOR); try { PropertyResource source = new PropertyResource(StringUtils.trim(entry.getKey()), resource.getPath(), resourceResolver); PropertyResource destination = new PropertyResource(StringUtils.trim(entry.getValue()), resource.getPath(), resourceResolver); destination.setValue(source.getValue(), skipEmptyValue); } catch (WorkflowException e) { log.error("Could not copy properties [ -> ] for payload [ ]", new String[]{entry.getKey(), entry.getValue(), resource.getPath()} , e); } } }
Source:
public IgniteInternalFuture<Void> schedule(int grpId) throws IgniteCheckedException { CacheGroupContext grp = ctx.cache().cacheGroup(grpId); if (grp == null) { if (log.isDebugEnabled()) log.debug("Skip reencryption, cache group was destroyed [grp=" + grpId + "]"); return new GridFinishedFuture<>(); } lock.lock(); try { if (stopped) throw new NodeStoppingException("Operation has been cancelled (node is stopping)."); if (grps.isEmpty()) ((GridCacheDatabaseSharedManager)ctx.cache().context().database()).addCheckpointListener(this); GroupScanTask prevState = grps.get(grpId); if (prevState != null && !prevState.isDone()) { if (log.isDebugEnabled()) log.debug("Reencryption already scheduled [grpId=" + grpId + "]"); return prevState; } Set<Integer> parts = new HashSet<>(); forEachPageStore(grp, new IgniteInClosureX<Integer>() { @Override public void applyx(Integer partId) { if (ctx.encryption().getEncryptionState(grpId, partId) == 0) { if (log.isDebugEnabled()) log.debug("Skipping partition reencryption [grp=" + grpId + ", p=" + partId + "]"); return; } parts.add(partId); } }); GroupScanTask grpScan = new GroupScanTask(grp, parts); ctx.getSystemExecutorService().submit(grpScan); if (log.isInfoEnabled()) log.info("Scheduled reencryption [grpId=" + grpId + "]"); grps.put(grpId, grpScan); return grpScan; } finally { lock.unlock(); } }

Target:
public IgniteInternalFuture<Void> schedule(int grpId) throws IgniteCheckedException { CacheGroupContext grp = ctx.cache().cacheGroup(grpId); if (grp == null || !grp.affinityNode()) { if (log.isInfoEnabled()) log.info("Skip reencryption, cache group doesn't exist on the local node [grp=" + grpId + "]"); return new GridFinishedFuture<>(); } lock.lock(); try { if (stopped) throw new NodeStoppingException("Operation has been cancelled (node is stopping)."); if (grps.isEmpty()) ((GridCacheDatabaseSharedManager)ctx.cache().context().database()).addCheckpointListener(this); GroupScanTask prevState = grps.get(grpId); if (prevState != null && !prevState.isDone()) { if (log.isDebugEnabled()) log.debug("Reencryption already scheduled [grpId=" + grpId + "]"); return prevState; } Set<Integer> parts = new HashSet<>(); forEachPageStore(grp, new IgniteInClosureX<Integer>() { @Override public void applyx(Integer partId) { if (ctx.encryption().getEncryptionState(grpId, partId) == 0) { if (log.isDebugEnabled()) log.debug("Skipping partition reencryption [grp=" + grpId + ", p=" + partId + "]"); return; } parts.add(partId); } }); GroupScanTask grpScan = new GroupScanTask(grp, parts); singleExecSvc.submit(grpScan); if (log.isInfoEnabled()) log.info("Scheduled reencryption [grpId=" + grpId + "]"); grps.put(grpId, grpScan); return grpScan; } finally { lock.unlock(); } }
Source:
public void tccReceived(RTCPTCCPacket tccPacket) { MediaStream videoStream = null; for (MediaStream stream : mediaStreams) { if (stream instanceof VideoMediaStream) { videoStream = stream; break; } } RTCPTCCPacket.PacketMap packetMap = tccPacket.getPackets(); long previousArrivalTimeMs = -1; for (Map.Entry<Integer, Long> entry : packetMap.entrySet()) { long arrivalTimeUs = entry.getValue(); if (arrivalTimeUs == -1) { continue; } PacketDetail packetDetail = null; synchronized (sentPacketsSyncRoot) { packetDetail = sentPacketDetails.remove(entry.getKey()); } if (packetDetail != null && videoStream != null) { long arrivalTimeMs = arrivalTimeUs / 4; if (logger.isDebugEnabled()) { if (previousArrivalTimeMs != -1) { logger.debug("seq=" + entry.getKey() + ", arrival_time_ms=" + arrivalTimeMs + ", diff_ms=" + (arrivalTimeMs - previousArrivalTimeMs)); } else { logger.debug("seq=" + entry.getKey() + ", arrival_time_ms=" + arrivalTimeMs); } } previousArrivalTimeMs = arrivalTimeMs; long sendTime24bits = RemoteBitrateEstimatorAbsSendTime .convertMsTo24Bits(packetDetail.packetSendTimeMs); bitrateEstimatorAbsSendTime.incomingPacketInfo( arrivalTimeMs, sendTime24bits, packetDetail.packetLength, tccPacket.getSourceSSRC()); } } }

Target:
public void tccReceived(RTCPTCCPacket tccPacket) { RTCPTCCPacket.PacketMap packetMap = tccPacket.getPackets(); long previousArrivalTimeMs = -1; for (Map.Entry<Integer, Long> entry : packetMap.entrySet()) { long arrivalTime250Us = entry.getValue(); if (arrivalTime250Us == -1) { continue; } if (remoteReferenceTimeMs == -1) { remoteReferenceTimeMs = RTCPTCCPacket.getReferenceTime( new ByteArrayBufferImpl( tccPacket.fci, 0, tccPacket.fci.length)) / 4; localReferenceTimeMs = System.currentTimeMillis(); } PacketDetail packetDetail; synchronized (sentPacketsSyncRoot) { packetDetail = sentPacketDetails.remove(entry.getKey()); } if (packetDetail == null) { continue; } long arrivalTimeMs = arrivalTime250Us / 4 - remoteReferenceTimeMs + localReferenceTimeMs; if (logger.isDebugEnabled()) { if (previousArrivalTimeMs != -1) { long diff_ms = arrivalTimeMs - previousArrivalTimeMs; logger.debug("seq=" + entry.getKey() + ", arrival_time_ms=" + arrivalTimeMs + ", diff_ms=" + diff_ms); } else { logger.debug("seq=" + entry.getKey() + ", arrival_time_ms=" + arrivalTimeMs); } } previousArrivalTimeMs = arrivalTimeMs; long sendTime24bits = RemoteBitrateEstimatorAbsSendTime .convertMsTo24Bits(packetDetail.packetSendTimeMs); bitrateEstimatorAbsSendTime.incomingPacketInfo( arrivalTimeMs, sendTime24bits, packetDetail.packetLength, tccPacket.getSourceSSRC()); } }
Source:
public void updatesSameStandConcurrently() throws Exception { final Stand stand = this.stand(); final Coordinates pulse = this.pulse(); this.post(stand, pulse, new AtomicLong(1)); final Document dom = DocumentBuilderFactory.newInstance() .newDocumentBuilder().newDocument(); dom.appendChild(dom.createElement("a0")); final String xembly = stand.pulses().tail(pulse) .iterator().next().xembly(); new Snapshot(xembly).xml(); MatcherAssert.assertThat(xembly, Matchers.startsWith("XPATH \" MatcherAssert.assertThat( XhtmlMatchers.xhtml(dom), XhtmlMatchers.hasXPath("/a0/a1/a2/a3/a4") ); }

Target:
public void updatesSameStandConcurrently() throws Exception { final Stand stand = this.stand(); final Coordinates pulse = this.pulse(); this.post(stand, pulse, new AtomicLong(1)); final Document dom = DocumentBuilderFactory.newInstance() .newDocumentBuilder().newDocument(); dom.appendChild(dom.createElement("a0")); final String xembly = stand.pulses().tail(pulse) .iterator().next().xembly(); MatcherAssert.assertThat(xembly, Matchers.startsWith("XPATH \" MatcherAssert.assertThat( XhtmlMatchers.xhtml(new Snapshot(xembly).xml()), XhtmlMatchers.hasXPath("/a0/a1/a2/a3/a4") ); }
Source:
public static boolean isRealmModel(TypeMirror type) { for (TypeMirror typeMirror : typeUtils.directSupertypes(type)) { String supertype = typeMirror.toString(); if (supertype.equals("io.realm.RealmObject") || supertype.equals("io.realm.RealmModel")) { return true; } } return false; }

Target:
public static boolean isRealmModel(TypeMirror type) { return typeUtils.isAssignable(type, realmModel); }
Source:
public void reduceTest() { List<Tuple2<Integer, Integer>> inData = new ArrayList<Tuple2<Integer, Integer>>(); List<Tuple2<Integer, Integer>> outData = new ArrayList<Tuple2<Integer, Integer>>(); for(int i=1; i<6; i++) { for(int j=0; j<i; j++) { inData.add(new Tuple2<Integer, Integer>(i,1)); } } TupleTypeInfo<Tuple2<Integer, Integer>> typeInfo = new TupleTypeInfo<Tuple2<Integer, Integer>>( BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO); TypeSerializer<Tuple2<Integer, Integer>> serializer = typeInfo.createSerializer(); TypeComparator<Tuple2<Integer, Integer>> comparator = typeInfo.createComparator(new int[]{0}, new boolean[]{true}); MutableObjectIterator<Tuple2<Integer, Integer>> moi = new MutableObjectIteratorWrapper<Tuple2<Integer, Integer>>(inData.iterator(), serializer); KeyGroupedIterator<Tuple2<Integer, Integer>> kgi = new KeyGroupedIterator<Tuple2<Integer, Integer>>(moi, serializer, comparator); ReduceFunction<Tuple2<Integer, Integer>> testFunc = new ReduceTestFunction(); testFunc.setTypeSerializer(serializer); Collector<Tuple2<Integer, Integer>> out = new ListOutputCollector<Tuple2<Integer, Integer>>(outData, serializer); try { while (kgi.nextKey()) { testFunc.reduce(kgi.getValues(), out); } } catch(IOException ioe) { Assert.fail(); } catch(Exception e) { e.printStackTrace(); Assert.fail(); } for(int i=0; i<outData.size(); i++) { Assert.assertTrue( ((Integer)outData.get(i).getField(0)).intValue() == ((Integer)outData.get(i).getField(1)).intValue()); } }

Target:
public void reduceTest() throws Exception { List<Tuple2<Integer, Integer>> inData = new ArrayList<Tuple2<Integer, Integer>>(); List<Tuple2<Integer, Integer>> outData = new ArrayList<Tuple2<Integer, Integer>>(); for(int i=1; i<6; i++) { for(int j=0; j<i; j++) { inData.add(new Tuple2<Integer, Integer>(i,1)); } } TupleTypeInfo<Tuple2<Integer, Integer>> typeInfo = new TupleTypeInfo<Tuple2<Integer, Integer>>( BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO); TypeSerializer<Tuple2<Integer, Integer>> serializer = typeInfo.createSerializer(); TypeComparator<Tuple2<Integer, Integer>> comparator = typeInfo.createComparator(new int[]{0}, new boolean[]{true}); MutableObjectIterator<Tuple2<Integer, Integer>> moi = new MutableObjectIteratorWrapper<Tuple2<Integer, Integer>>(inData.iterator(), serializer); KeyGroupedIterator<Tuple2<Integer, Integer>> kgi = new KeyGroupedIterator<Tuple2<Integer, Integer>>(moi, serializer, comparator); ReduceFunction<Tuple2<Integer, Integer>> testFunc = new ReduceTestFunction(); testFunc.setTypeSerializer(serializer); Collector<Tuple2<Integer, Integer>> out = new CollectionOutputCollector<Tuple2<Integer, Integer>>(outData, serializer); while (kgi.nextKey()) { testFunc.reduce(kgi.getValues(), out); } for(int i=0; i<outData.size(); i++) { Assert.assertTrue( ((Integer)outData.get(i).getField(0)).intValue() == ((Integer)outData.get(i).getField(1)).intValue()); } }
Source:
public Stack saveStack(final String applicationId, final String applicationVersion) { VersionEntity version = versionRepository.findByName(applicationId); if (version == null) { version = versionRepository.save(new VersionEntity(applicationVersion)); } ApplicationEntity application = applicationRepository.findByName(applicationId); if (application == null) { application = new ApplicationEntity(applicationId); } if (!application.getVersionEntities().contains(version)) { application.getVersionEntities().add(version); } application = applicationRepository.save(application); return new Stack(application, version); }

Target:
public Stack saveStack(final String applicationId, final String applicationVersion) { if (applicationId == null && applicationVersion == null) { return new Stack( null, null ); } ApplicationEntity application = null; VersionEntity version = null; if (applicationVersion != null) { version = versionRepository.findByName(applicationVersion); if (version == null) { version = versionRepository.save(new VersionEntity(applicationVersion)); } } if (applicationId != null) { application = applicationRepository.findByName(applicationId); if (application == null) { application = new ApplicationEntity(applicationId); } if (version != null) { if (!application.getVersionEntities().contains(version)) { application.getVersionEntities().add(version); } } application = applicationRepository.save(application); } return new Stack(application, version); }
Source:
public <T> Mono<CosmosItemResponse<T>> upsertItem(T item, PartitionKey partitionKey, CosmosItemRequestOptions options) { final CosmosItemRequestOptions requestOptions = options == null ? new CosmosItemRequestOptions() : options; ModelBridgeInternal.setPartitionKey(options, partitionKey); return withContext(context -> upsertItemInternal(item, requestOptions, context)); }

Target:
public <T> Mono<CosmosItemResponse<T>> upsertItem(T item, PartitionKey partitionKey, CosmosItemRequestOptions options) { final CosmosItemRequestOptions requestOptions = options == null ? new CosmosItemRequestOptions() : options; ModelBridgeInternal.setPartitionKey(requestOptions, partitionKey); return withContext(context -> upsertItemInternal(item, requestOptions, context)); }
Source:
public void shouldCreateMultipleToolsAndAggregationResultWithWarningsAggregateFalseAndSameTool() { FreeStyleProject project = createJobWithWorkspaceFile("checkstyle2.xml", "checkstyle3.xml"); enableWarningsAggregation(project, false, "**/checkstyle2-issues.txt", new CheckStyle(), "**/checkstyle3-issues.txt", new CheckStyle()); List<AnalysisResult> results = scheduleBuildAndAssertStatusForBothTools(project, Result.FAILURE); for (AnalysisResult elements : results) { assertThat(elements).hasErrorMessages(); } }

Target:
public void shouldCreateMultipleToolsAndAggregationResultWithWarningsAggregateFalseAndSameTool() { FreeStyleProject project = createJobWithWorkspaceFile("checkstyle2.xml", "checkstyle3.xml"); enableWarningsAggregation(project, false, "**/checkstyle2-issues.txt", new CheckStyle(), "**/checkstyle3-issues.txt", new CheckStyle()); FreeStyleBuild build = scheduleBuildAndAssertLog(project, Result.FAILURE,"ID checkstyle is already used by another action: io.jenkins.plugins.analysis.core.views.ResultAction for CheckStyle"); List<AnalysisResult> results = getAssertStatusForBothTools(build); assertThat(results).hasSize(1); for (AnalysisResult element : results) { assertThat(element).hasId("checkstyle"); } }
Source:
public void lastSweptGoesDownIfNewInformationBecomesAvailable() { metrics.updateProgressForShard(CONS_ZERO, 999); waitForProgressToRecompute(); assertLastSweptTimestampConservativeEquals(999); puncherStore.put(999, 999); assertMillisSinceLastSweptConservativeEquals(999); metrics.updateProgressForShard(CONS_ONE, 200); waitForProgressToRecompute(); assertLastSweptTimestampConservativeEquals(200); puncherStore.put(200, 200); assertMillisSinceLastSweptConservativeEquals(200); }

Target:
public void lastSweptGoesDownIfNewInformationBecomesAvailable() { metrics.updateProgressForShard(CONS_ZERO, 999); waitForProgressToRecompute(); assertLastSweptTimestampConservativeEquals(999); puncherStore.put(999, 999); assertMillisSinceLastSweptConservativeEqualsClockTimeMinus(999); metrics.updateProgressForShard(CONS_ONE, 200); waitForProgressToRecompute(); assertLastSweptTimestampConservativeEquals(200); puncherStore.put(200, 200); assertMillisSinceLastSweptConservativeEqualsClockTimeMinus(200); }
Source:
private void sendMetrics(final WorkerMetrics workerMetrics) { LOG.log(Level.INFO, "Sending metricsMessage {0}", new Object[]{workerMetrics}); metricsMsgSender.send(workerMetrics); }

Target:
private void sendMetrics(final WorkerMetrics workerMetrics) { LOG.log(Level.FINE, "Sending WorkerMetrics {0}", new Object[]{workerMetrics}); metricsMsgSender.send(workerMetrics); }