auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateMinimap(int editorTopIndex, int editorBottomIndex) { if (editorTopIndex != fEditorTopIndex || editorBottomIndex != fEditorBottomIndex) { fEditorTopIndex = editorTopIndex; fEditorBottomIndex = editorBottomIndex; fMinimapTextWidget.setRedraw(false); int newMinimapTopIndex = editorTopIndex; if (editorTopIndex != 0 && editorBottomIndex != fMinimapTextWidget.getLineAtOffset(fMinimapTextWidget.getCharCount())) { int minimapTopIndex = JFaceTextUtil.getPartialTopIndex(fMinimapTextWidget); int minimapBottomIndex = JFaceTextUtil.getPartialBottomIndex(fMinimapTextWidget); int minimapVisibleLineCount = minimapBottomIndex - minimapTopIndex; int editorVisibleLineCount = editorBottomIndex - editorTopIndex; newMinimapTopIndex = Math.max(0, editorTopIndex + editorVisibleLineCount - minimapVisibleLineCount / 2); } fMinimapTextWidget.setTopIndex(newMinimapTopIndex); fTopIndexY = fMinimapTextWidget.getLinePixel(fEditorTopIndex); fBottomIndexY = fMinimapTextWidget.getLinePixel(fEditorBottomIndex); fMinimapTextWidget.setRedraw(true); } }

Target:
public void updateMinimap(int editorTopIndex, int editorBottomIndex) { if (editorTopIndex != fEditorTopIndex || editorBottomIndex != fEditorBottomIndex) { fEditorTopIndex = editorTopIndex; fEditorBottomIndex = editorBottomIndex; fMinimapTextWidget.setRedraw(false); int newMinimapTopIndex = editorTopIndex; if (editorTopIndex != 0 && editorBottomIndex != fMinimapTextWidget.getLineAtOffset(fMinimapTextWidget.getCharCount())) { int minimapTopIndex = JFaceTextUtil.getPartialTopIndex(fMinimapTextWidget); int minimapBottomIndex = JFaceTextUtil.getPartialBottomIndex(fMinimapTextWidget); int minimapVisibleLineCount = minimapBottomIndex - minimapTopIndex; int editorVisibleLineCount = editorBottomIndex - editorTopIndex; newMinimapTopIndex = Math.max(0, editorTopIndex + editorVisibleLineCount - minimapVisibleLineCount / 2); } fMinimapTextWidget.setTopIndex(newMinimapTopIndex); fTopIndexY = fMinimapTextWidget.getLinePixel(fEditorTopIndex); fBottomIndexY = fMinimapTextWidget.getLinePixel(fEditorBottomIndex + 1); fMinimapTextWidget.setRedraw(true); } }
Source:
private void removeDetachedServers(List<VDS> existingServers, Set<GlusterServerInfo> fetchedServers) { for (VDS server : existingServers) { if (isRemovableStatus(server.getstatus()) && serverDetached(server, fetchedServers)) { RemoveVdsStatisticsFromDb(server); RemoveVdsDynamicFromDb(server); RemoveVdsStaticFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getvds_name()); logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); } } }

Target:
private void removeDetachedServers(List<VDS> existingServers, Set<GlusterServerInfo> fetchedServers) { for (VDS server : existingServers) { if (isRemovableStatus(server.getstatus()) && serverDetached(server, fetchedServers)) { log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getvds_name()); logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try { removeServerFromDb(server); } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getvds_name(), e); continue; } runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } } }
Source:
public static Map<String, List<String>> getQueryParametersFromState(String state) { Map<String, List<String>> params = new HashMap<>(); if (isNullOrEmpty(state)) { return params; } String decodedState; try { decodedState = URLDecoder.decode(state, "UTF-8"); for (String pair : decodedState.split("&")) { if (!pair.isEmpty()) { String name; String value; int eq = pair.indexOf('='); if (eq < 0) { name = pair; value = ""; } else { name = pair.substring(0, eq); value = pair.substring(eq + 1); } List<String> paramValues = params.computeIfAbsent(name, values -> new ArrayList<>()); paramValues.add(value); } } } catch (UnsupportedEncodingException ignored) { } return params; }

Target:
public static Map<String, List<String>> getQueryParametersFromState(String state) { Map<String, List<String>> params = new HashMap<>(); if (isNullOrEmpty(state)) { return params; } try { for (String pair : URLDecoder.decode(state, "UTF-8").split("&")) { if (pair.isEmpty()) { continue; } String name; String value; int eq = pair.indexOf('='); if (eq < 0) { name = pair; value = ""; } else { name = pair.substring(0, eq); value = pair.substring(eq + 1); } List<String> paramValues = params.computeIfAbsent(name, values -> new ArrayList<>()); paramValues.add(value); } } catch (UnsupportedEncodingException ignored) { } return params; }
Source:
protected Response performRemove(String id) { Fault fault = new Fault(); fault.setReason("Unsupported Operation"); fault.setDetail("Remove is not supported"); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(fault).build()); }

Target:
protected Response performRemove(String id) { throw new UnsupportedOperationException(); }
Source:
private static void updateNumOfMonitorsInVmDevice(VmBase oldVmBase, VmBase newStatic) { int prevNumOfMonitors=0; if (oldVmBase != null) { prevNumOfMonitors = oldVmBase.getnum_of_monitors(); } if (newStatic.getnum_of_monitors() > prevNumOfMonitors) { for (int i = prevNumOfMonitors; i < newStatic .getnum_of_monitors(); i++) { Guid newId = Guid.NewGuid(); VmDeviceUtils.addManagedDevice(new VmDeviceId(newId, newStatic.getId()), VmDeviceType.VIDEO, VmDeviceType.QXL, getMemExpr(newStatic.getnum_of_monitors()), true, false, ""); } } else { List<VmDevice> list = DbFacade .getInstance() .getVmDeviceDAO() .getVmDeviceByVmIdAndType(newStatic.getId(), VmDeviceType.VIDEO.getName()); removeNumberOfDevices(list, prevNumOfMonitors - newStatic.getnum_of_monitors()); } }

Target:
private static void updateNumOfMonitorsInVmDevice(VmBase oldVmBase, VmBase newStatic) { int prevNumOfMonitors=0; if (oldVmBase != null) { prevNumOfMonitors = oldVmBase.getnum_of_monitors(); } if (newStatic.getnum_of_monitors() > prevNumOfMonitors) { for (int i = prevNumOfMonitors; i < newStatic .getnum_of_monitors(); i++) { Guid newId = Guid.NewGuid(); VmDeviceUtils.addManagedDevice(new VmDeviceId(newId, newStatic.getId()), VmDeviceType.VIDEO, VmDeviceType.QXL, getMemExpr(newStatic.getnum_of_monitors()), true, false); } } else { List<VmDevice> list = DbFacade .getInstance() .getVmDeviceDAO() .getVmDeviceByVmIdAndType(newStatic.getId(), VmDeviceType.VIDEO.getName()); removeNumberOfDevices(list, prevNumOfMonitors - newStatic.getnum_of_monitors()); } }
Source:
public static int getHeaderSize() { return Version_Field_Size_In_Bytes + Total_Size_Field_Size_In_Bytes + (3 * Relative_Offset_Field_Sizes_In_Bytes) + Crc_Size; }

Target:
public static int getHeaderSize() { return Version_Field_Size_In_Bytes + Total_Size_Field_Size_In_Bytes + (Number_Of_Relative_Offset_Fields * Relative_Offset_Field_Sizes_In_Bytes) + Crc_Size; }
Source:
public AS7ManagementDetails(IServer server) { this(server, new HashMap<String,Object>()); }

Target:
public AS7ManagementDetails(IServer server) { this(server, new HashMap<String,Object>(0)); }
Source:
public void process(String sessionId, String taskId, NodeId agentId, NodeContext nodeContext, SystemInfo systemInfo) { String serviceId = getKey(sessionId, taskId); if (!metricServiceMap.containsKey(serviceId)){ metricServiceMap.put(serviceId, new DefaultMetricService(sessionId, taskId, nodeContext)); } saveMonitoringValues(serviceId, agentId.getIdentifier(), systemInfo.getSysInfo()); if (systemInfo.getSysUnderTest() == null){ return; } for (Map.Entry<String, SystemUnderTestInfo> entry : systemInfo.getSysUnderTest().entrySet()){ saveMonitoringValues(serviceId, entry.getKey(), entry.getValue().getSysUTInfo()); } log.trace("System info received from agent and has been written to FileStorage", systemInfo, agentId); }

Target:
public void process(String sessionId, String taskId, NodeId agentId, NodeContext nodeContext, SystemInfo systemInfo) { String serviceId = getKey(sessionId, taskId); if (!metricServiceMap.containsKey(serviceId)){ metricServiceMap.put(serviceId, new DefaultMetricService(sessionId, taskId, nodeContext)); } saveMonitoringValues(serviceId, agentId.getIdentifier(), systemInfo.getSysInfo()); if (systemInfo.getSysUnderTest() != null){ for (Map.Entry<String, SystemUnderTestInfo> entry : systemInfo.getSysUnderTest().entrySet()){ saveMonitoringValues(serviceId, entry.getKey(), entry.getValue().getSysUTInfo()); } } log.trace("System info received from agent and has been written to FileStorage", systemInfo, agentId); }
Source:
public boolean shouldSync(UdbTable udbTable) { if (!Objects.equals(mName, udbTable.getName()) || !Objects.equals(mSchema, udbTable.getSchema()) || !Objects.equals(mOwner, udbTable.getOwner()) || !Objects.equals(mStatistics, udbTable.getStatistics()) || !Objects.equals(mParameters, udbTable.getParameters())) { return true; } Map<String, Partition> existingPartitions = mPartitionScheme.getPartitions().stream() .collect(Collectors.toMap(Partition::getSpec, Function.identity())); if (existingPartitions.size() != udbTable.getPartitions().size()) { return true; } for (UdbPartition udbPartition : udbTable.getPartitions()) { Partition newPartition = existingPartitions.get(udbPartition.getSpec()); if (newPartition == null || !newPartition.getLayout() .equals(udbPartition.getLayout())) { return true; } } return false; }

Target:
public boolean shouldSync(UdbTable udbTable) { if (!Objects.equals(mName, udbTable.getName()) || !Objects.equals(mSchema, udbTable.getSchema()) || !Objects.equals(mOwner, udbTable.getOwner()) || !Objects.equals(mStatistics, udbTable.getStatistics()) || !Objects.equals(mParameters, udbTable.getParameters())) { return true; } Map<String, Partition> existingPartitions = mPartitionScheme.getPartitions().stream() .collect(Collectors.toMap(Partition::getSpec, Function.identity())); if (existingPartitions.size() != udbTable.getPartitions().size()) { return true; } for (UdbPartition udbPartition : udbTable.getPartitions()) { Partition newPartition = existingPartitions.get(udbPartition.getSpec()); if (newPartition == null || !newPartition.getBaseLayout().equals(udbPartition.getLayout())) { return true; } } return false; }
Source:
public int getVmlist(){ log.debug("about to print collection"); Host host = getActiveHost(); List statusList = new ArrayList(); for (VM vm : host.getRunningVMs().values()) { statusList.add(vm.getName()); } log.debug("printing collection {}", statusList.size()); return statusList.size(); }

Target:
public int getVmlist(){ Host host = getActiveHost(); List statusList = new ArrayList(); for (VM vm : host.getRunningVMs().values()) { statusList.add(vm.getName()); } return statusList.size(); }
Source:
public void widgetDisposed(DisposeEvent e) { if (fImages != null) { for (Image fImage : fImages) { fImage.dispose(); } } }

Target:
public void widgetDisposed(DisposeEvent e) { if (fImages != null) { for (Image image : fImages) { image.dispose(); } } }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); vanillaValues.add(this.primed().asImmutable()); vanillaValues.add(this.fuseDuration().asImmutable()); if (this.tntPlacedBy != null) { this.detonator().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.primed().asImmutable()); values.add(this.fuseDuration().asImmutable()); this.detonator().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
public void refreshItems() { if (dataManager != null) { try { Collection<? extends BaseModel> databaseItems = dataManager.getObjects(baseClass); if (items == null) { items = new ConcurrentHashMap<>(databaseItems.size()); } Set<Long> databaseItemIds = new HashSet<>(); for (BaseModel item : databaseItems) { databaseItemIds.add(item.getId()); if (items.containsKey(item.getId())) { updateCachedItem(item); } else { addNewItem(item); } } for (Long cachedItemId : items.keySet()) { if (!databaseItemIds.contains(cachedItemId)) { items.remove(cachedItemId); } } } catch (SQLException error) { Log.warning(error); } } refreshUserItems(); }

Target:
public void refreshItems() { if (dataManager != null) { try { Collection<? extends BaseModel> databaseItems = dataManager.getObjects(baseClass); if (items == null) { items = new ConcurrentHashMap<>(databaseItems.size()); } Set<Long> databaseItemIds = new HashSet<>(); for (BaseModel item : databaseItems) { databaseItemIds.add(item.getId()); if (items.containsKey(item.getId())) { updateCachedItem(item); } else { addNewItem(item); } } for (Long cachedItemId : items.keySet()) { if (!databaseItemIds.contains(cachedItemId)) { removeCachedItem(cachedItemId); } } } catch (SQLException error) { Log.warning(error); } } refreshUserItems(); }
Source:
Moment getDateInInput(){ return moment(getInputBind().value, "HH:mm:ss"); }

Target:
Moment getDateInInput() { return moment(getInputBind().value, TIME_FORMAT); }
Source:
protected void initPlayback(@NonNull final PlayQueue queue, @Player.RepeatMode final int repeatMode, final float playbackSpeed, final float playbackPitch, final boolean playbackSkipSilence, final boolean playOnReady, final boolean isMuted) { destroyPlayer(); initPlayer(playOnReady); setRepeatMode(repeatMode); setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence); playQueue = queue; playQueue.init(); if (playbackManager != null) playbackManager.dispose(); playbackManager = new MediaSourceManager(this, playQueue); if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); if (isMuted) simpleExoPlayer.setVolume(0); }

Target:
protected void initPlayback(@NonNull final PlayQueue queue, @Player.RepeatMode final int repeatMode, final float playbackSpeed, final float playbackPitch, final boolean playbackSkipSilence, final boolean playOnReady, final boolean isMuted) { destroyPlayer(); initPlayer(playOnReady); setRepeatMode(repeatMode); setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence); playQueue = queue; playQueue.init(); if (playbackManager != null) playbackManager.dispose(); playbackManager = new MediaSourceManager(this, playQueue); if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); simpleExoPlayer.setVolume(isMuted ? 0 : 1); }
Source:
public void testGeneratedClassName() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); String planNodeId = "7"; String stageId = "20170707_223500_67496_zguwn.2"; String classSuffix = stageId + "_" + planNodeId; Supplier<PageProjection> projectionSupplier = functionCompiler.compileProjection(ADD_10_EXPRESSION, Optional.of(classSuffix)); PageProjection projection = projectionSupplier.get(); PageProjectionOutput pageProjectionOutput = projection.project(SESSION, new DriverYieldSignal(), createLongBlockPage(0), SelectedPositions.positionsRange(0, 1)); System.out.println(pageProjectionOutput.getClass().getSimpleName()); assertTrue(pageProjectionOutput.getClass().getSimpleName().startsWith("PageProjectionOutput_" + stageId.replace('.', '_') + "_" + planNodeId)); }

Target:
public void testGeneratedClassName() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); String planNodeId = "7"; String stageId = "20170707_223500_67496_zguwn.2"; String classSuffix = stageId + "_" + planNodeId; Supplier<PageProjection> projectionSupplier = functionCompiler.compileProjection(ADD_10_EXPRESSION, Optional.of(classSuffix)); PageProjection projection = projectionSupplier.get(); PageProjectionOutput pageProjectionOutput = projection.project(SESSION, new DriverYieldSignal(), createLongBlockPage(0), SelectedPositions.positionsRange(0, 1)); assertTrue(pageProjectionOutput.getClass().getSimpleName().startsWith("PageProjectionOutput_" + stageId.replace('.', '_') + "_" + planNodeId)); }
Source:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity = capacityMap.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { LOG.warn("The capacity usage of the specified partition is not configured in the Resource" + " Config {}. No default partition capacity is configured neither. Will proceed with" + " empty capacity configuration.", partitionName, resourceConfig.getResourceName()); partitionCapacity = new HashMap<>(); } List<String> requiredCapacityKeys = clusterConfig.getInstanceCapacityKeys(); partitionCapacity.keySet().retainAll(requiredCapacityKeys); for (String capacityKey : requiredCapacityKeys) { partitionCapacity.putIfAbsent(capacityKey, 0); } return partitionCapacity; }

Target:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity = capacityMap.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { LOG.warn("The capacity usage of the specified partition is not configured in the Resource" + " Config {}. No default partition capacity is configured either. Will proceed with" + " empty capacity configuration.", partitionName, resourceConfig.getResourceName()); partitionCapacity = new HashMap<>(); } List<String> requiredCapacityKeys = clusterConfig.getInstanceCapacityKeys(); partitionCapacity.keySet().retainAll(requiredCapacityKeys); for (String capacityKey : requiredCapacityKeys) { partitionCapacity.putIfAbsent(capacityKey, 0); } return partitionCapacity; }
Source:
public void createMergewithMergeRevision_validation_valid() throws Exception { PullRequestSCMRevision prRevision = new PullRequestSCMRevision( prMerge, "8f1314fc3c8284d8c6d5886d473db98f2126071c", "c0e024f89969b976da165eecaa71e09dc60c3da1", "38814ca33833ff5583624c29f305be9133f27a40"); assertThat(prRevision.toString(), is("c0e024f89969b976da165eecaa71e09dc60c3da1+8f1314fc3c8284d8c6d5886d473db98f2126071c (38814ca33833ff5583624c29f305be9133f27a40)")); prRevision.validateMergeHash(repo); }

Target:
public void createMergewithMergeRevision_validation_valid() throws Exception { PullRequestSCMRevision prRevision = new PullRequestSCMRevision( prMerge, "8f1314fc3c8284d8c6d5886d473db98f2126071c", "c0e024f89969b976da165eecaa71e09dc60c3da1", "38814ca33833ff5583624c29f305be9133f27a40"); assertThat(prRevision.toString(), is("c0e024f89969b976da165eecaa71e09dc60c3da1+8f1314fc3c8284d8c6d5886d473db98f2126071c (38814ca33833ff5583624c29f305be9133f27a40)")); try { prRevision.validateMergeHash(repo); } catch (AbortException e) { fail("Validation should succeed, but: " + e.getMessage()); } }
Source:
private ReadResponse getLongPollReadResponse() { if (!shouldReadEntry() && readRequest.hasTimeOut()) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}", previousLAC); } final Stopwatch startTimeSw = Stopwatch.createStarted(); final boolean watched; try { watched = requestProcessor.bookie.waitForLastAddConfirmedUpdate(ledgerId, previousLAC, this); } catch (Bookie.NoLedgerException e) { logger.info("No ledger found while longpoll reading ledger {}, previous lac = {}.", ledgerId, previousLAC); return buildErrorResponse(StatusCode.ENOLEDGER, startTimeSw); } catch (IOException ioe) { logger.error("IOException while longpoll reading ledger {}, previous lac = : ", ledgerId, previousLAC, ioe); return buildErrorResponse(StatusCode.EIO, startTimeSw); } registerSuccessfulEvent(requestProcessor.getRequestStats().getLongPollPreWaitStats(), startTimeSw); lastPhaseStartTime.reset().start(); if (watched) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}: Timeout {}", previousLAC, readRequest.getTimeOut()); } synchronized (this) { expirationTimerTask = requestTimer.newTimeout(timeout -> { requestProcessor.bookie.cancelWaitForLastAddConfirmedUpdate(ledgerId, this); LongPollReadEntryProcessorV3.this.scheduleDeferredRead(true); }, readRequest.getTimeOut(), TimeUnit.MILLISECONDS); } return null; } } return getReadResponse(); }

Target:
private ReadResponse getLongPollReadResponse() { if (!shouldReadEntry() && readRequest.hasTimeOut()) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}", previousLAC); } final Stopwatch startTimeSw = Stopwatch.createStarted(); final boolean watched; try { watched = requestProcessor.getBookie().waitForLastAddConfirmedUpdate(ledgerId, previousLAC, this); } catch (Bookie.NoLedgerException e) { logger.info("No ledger found while longpoll reading ledger {}, previous lac = {}.", ledgerId, previousLAC); return buildErrorResponse(StatusCode.ENOLEDGER, startTimeSw); } catch (IOException ioe) { logger.error("IOException while longpoll reading ledger {}, previous lac = : ", ledgerId, previousLAC, ioe); return buildErrorResponse(StatusCode.EIO, startTimeSw); } registerSuccessfulEvent(requestProcessor.getRequestStats().getLongPollPreWaitStats(), startTimeSw); lastPhaseStartTime.reset().start(); if (watched) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}: Timeout {}", previousLAC, readRequest.getTimeOut()); } synchronized (this) { expirationTimerTask = requestTimer.newTimeout(timeout -> { requestProcessor.getBookie().cancelWaitForLastAddConfirmedUpdate(ledgerId, this); LongPollReadEntryProcessorV3.this.scheduleDeferredRead(true); }, readRequest.getTimeOut(), TimeUnit.MILLISECONDS); } return null; } } return getReadResponse(); }
Source:
private Artifact getLinkedArtifact(LinkTargetType linkTargetType) throws RuleErrorException { String maybePicName = label.getName() + linkedArtifactNameSuffix; if(featureConfiguration.isEnabled(CppRuleClasses.TARGETS_WINDOWS) && linkTargetType == LinkTargetType.NODEPS_DYNAMIC_LIBRARY) { maybePicName += linkedDLLNameSuffix; } if (linkTargetType.picness() == Picness.PIC) { maybePicName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, ArtifactCategory.PIC_FILE, maybePicName); } String linkedName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, linkTargetType.getLinkerOutput(), maybePicName); PathFragment artifactFragment = PathFragment.create(label.getName()).getParentDirectory().getRelative(linkedName); return CppHelper.getLinkedArtifact( label, actionConstructionContext, configuration, linkTargetType, linkedArtifactNameSuffix, artifactFragment); }

Target:
private Artifact getLinkedArtifact(LinkTargetType linkTargetType) throws RuleErrorException { String maybePicName = label.getName() + linkedArtifactNameSuffix; if (linkTargetType.picness() == Picness.PIC) { maybePicName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, ArtifactCategory.PIC_FILE, maybePicName); } String linkedName = maybePicName + (linkTargetType == LinkTargetType.NODEPS_DYNAMIC_LIBRARY ? linkedDLLNameSuffix : ""); linkedName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, linkTargetType.getLinkerOutput(), linkedName); PathFragment artifactFragment = PathFragment.create(label.getName()).getParentDirectory().getRelative(linkedName); return CppHelper.getLinkedArtifact( label, actionConstructionContext, configuration, linkTargetType, linkedArtifactNameSuffix, artifactFragment); }
Source:
public synchronized void addMissingReferencePointsToUser(User user) { List<String> referencePoints = new ArrayList<String>(); for (String referencePoint : idToReferencePointMapping.keySet()) { referencePoints.add(referencePoint); } this.referencePointsOfUsers.put(user, referencePoints); }

Target:
public synchronized void addMissingReferencePointsToUser(User user) { List<String> referencePoints = new ArrayList(idToReferencePointMapping.keySet()); this.referencePointsOfUsers.put(user, referencePoints); }
Source:
public void requestBannerAd(final Context context, final MediationBannerListener mediationBannerListener, Bundle bundle, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { initializeFromBundle(context, bundle); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render banner ad. Please define a valid spot id on the AdMob console"); return; } mMediationBannerListener = mediationBannerListener; mBannerSpot = InneractiveAdSpotManager.get().createSpot(); mBannerSpot.setMediationName(MEDIATOR_NAME); InneractiveAdViewUnitController controller = new InneractiveAdViewUnitController(); mBannerSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); mBannerWrapperView = new RelativeLayout(context); InneractiveAdSpot.RequestListener requestListener = createFyberBannerAdListener(mBannerSpot, mMediationBannerListener); if (requestListener != null) { mBannerSpot.requestAd(request); } else { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } }

Target:
public void requestBannerAd(final Context context, final MediationBannerListener mediationBannerListener, Bundle bundle, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { initializeFromBundle(context, bundle); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render banner ad. Please define a valid spot id on the AdMob UI"); return; } mBannerSpot = InneractiveAdSpotManager.get().createSpot(); mBannerSpot.setMediationName(MEDIATOR_NAME); InneractiveAdViewUnitController controller = new InneractiveAdViewUnitController(); mBannerSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); mBannerWrapperView = new RelativeLayout(context); InneractiveAdSpot.RequestListener requestListener = createFyberBannerAdListener(mediationBannerListener); mBannerSpot.setRequestListener(requestListener); mBannerSpot.requestAd(request); }
Source:
public void init() { Bundle arguments = InstrumentationRegistry.getArguments(); testUser = arguments.getString("TEST_USER"); testUser2 = arguments.getString("TEST_USER2"); testPassword = arguments.getString("TEST_PASSWORD"); testPassword2 = arguments.getString("TEST_PASSWORD2"); testServerURL = arguments.getString("TEST_SERVER_URL"); trusted = Integer.parseInt(arguments.getString("TRUSTED")); switch (trusted) { case (1): servertype = ServerType.HTTP; break; case (2): servertype = ServerType.HTTPS_NON_SECURE; break; case (3): servertype = ServerType.HTTPS_SECURE; break; case (4): servertype = ServerType.REDIRECTED_NON_SECURE; break; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); try { if (!uiDevice.isScreenOn()) { uiDevice.wakeUp(); } } catch (RemoteException e) { e.printStackTrace(); } } }

Target:
public void init() { Bundle arguments = InstrumentationRegistry.getArguments(); testUser = arguments.getString("TEST_USER"); testUser2 = arguments.getString("TEST_USER2"); testPassword = arguments.getString("TEST_PASSWORD"); testPassword2 = arguments.getString("TEST_PASSWORD2"); testServerURL = arguments.getString("TEST_SERVER_URL"); servertype = ServerType.fromValue(Integer.parseInt(arguments.getString("TRUSTED"))); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); try { if (!uiDevice.isScreenOn()) { uiDevice.wakeUp(); } } catch (RemoteException e) { e.printStackTrace(); } } }
Source:
public Double interpolate(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(value, "value"); Validate.notNull(data, "data bundle"); InterpolationBoundedValues boundedValues = data.getBoundedValues(value); Double x1 = boundedValues.getLowerBoundKey(); Double y1 = boundedValues.getLowerBoundValue(); if (boundedValues.getLowerBoundIndex() == data.size() - 1) { return y1; } Double x2 = boundedValues.getHigherBoundKey(); Double y2 = boundedValues.getHigherBoundValue(); double xDiffInv = 1.0 / (x2 - x1); double a = Math.pow(y1 / y2, x1 * xDiffInv) * y1; double b = Math.log(y2 / y1) * xDiffInv; return a * Math.exp(b * value); }

Target:
public Double interpolate(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(value, "value"); Validate.notNull(data, "data bundle"); InterpolationBoundedValues boundedValues = data.getBoundedValues(value); Double x1 = boundedValues.getLowerBoundKey(); Double y1 = boundedValues.getLowerBoundValue(); if (boundedValues.getLowerBoundIndex() == data.size() - 1) { return y1; } Double x2 = boundedValues.getHigherBoundKey(); Double y2 = boundedValues.getHigherBoundValue(); return Math.pow(y2 / y1, (value - x1) / (x2 - x1)) * y1; }
Source:
EmCatch(final Action act, final String usr, final String pass, final String hst, final int prt, final long prd) { this.action = act; this.user = usr; this.password = pass; this.host = hst; this.port = prt; final Thread monitor = new Thread( new Runnable() { @Override public void run() { long period = prd; while (true) { try { EmCatch.this.check(); TimeUnit.SECONDS.sleep(period); period = prd; } catch (final InterruptedException | MessagingException ex) { Logger.error(this, "%[exception]s", ex); if (period < MAX_SLEEP_TIME) { period = period * 2; } } } } } ); monitor.setDaemon(true); monitor.start(); }

Target:
EmCatch(final Action act, final String usr, final String pass, final String hst, final int prt, final long prd) { this.action = act; this.user = usr; this.password = pass; this.host = hst; this.port = prt; this.period = prd; final Thread monitor = new Thread( new Runnable() { @Override public void run() { EmCatch.this.mainLoop(); } } ); monitor.setDaemon(true); monitor.start(); }
Source:
public AggregatorFactory getCombiningFactory() { return new SketchMergeAggregatorFactory(name, name, size, shouldFinalize, true); }

Target:
public AggregatorFactory getCombiningFactory() { return new SketchMergeAggregatorFactory(name, name, size, shouldFinalize, false); }
Source:
public int getEstimatedRetainedSizeInBytes() { return INSTANCE_SIZE; }

Target:
public int getEstimatedRetainedSizeInBytes() { return INSTANCE_SIZE + hiveTypeName.getEstimatedSizeInBytes(); }
Source:
protected ClientAuthenticationCustomCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { ClientAuthenticationCustomCodec.RequestParameters parameters = ClientAuthenticationCustomCodec .decodeRequest(clientMessage); String uuid = parameters.uuid; String ownerUuid = parameters.ownerUuid; if (uuid != null && uuid.length() > 0) { principal = new ClientPrincipal(uuid, ownerUuid); } credentials = serializationService.toObject(parameters.credentials); clientSerializationVersion = parameters.serializationVersion; if (parameters.clientHazelcastVersionExist) { clientVersion = parameters.clientHazelcastVersion; } if (parameters.clientNameExist) { clientName = parameters.clientName; } if (parameters.labelsExist) { Set<String> set = new HashSet<String>(); for (String label : parameters.labels) { set.add(label); } labels = Collections.unmodifiableSet(set); } return parameters; }

Target:
protected ClientAuthenticationCustomCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { ClientAuthenticationCustomCodec.RequestParameters parameters = ClientAuthenticationCustomCodec .decodeRequest(clientMessage); String uuid = parameters.uuid; String ownerUuid = parameters.ownerUuid; if (uuid != null && uuid.length() > 0) { principal = new ClientPrincipal(uuid, ownerUuid); } credentials = serializationService.toObject(parameters.credentials); clientSerializationVersion = parameters.serializationVersion; if (parameters.clientHazelcastVersionExist) { clientVersion = parameters.clientHazelcastVersion; } if (parameters.clientNameExist) { clientName = parameters.clientName; } if (parameters.labelsExist) { labels = Collections.unmodifiableSet(new HashSet<String>(parameters.labels)); } return parameters; }
Source:
public void shouldFailWhenNewProcessorJoinsWithSameIdAsExistingProcessor() throws InterruptedException { publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[0]); CountDownLatch kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); CountDownLatch processedMessagesLatch1 = new CountDownLatch(1); CountDownLatch processedMessagesLatch2 = new CountDownLatch(1); StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch1, null, kafkaEventsConsumedLatch); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch2, null, kafkaEventsConsumedLatch); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); processedMessagesLatch1.await(); processedMessagesLatch2.await(); LocalApplicationRunner applicationRunner3 = new LocalApplicationRunner(new MapConfig(applicationConfig2)); publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[2]); kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); StreamApplication streamApp3 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, kafkaEventsConsumedLatch); expectedException.expect(Exception.class); applicationRunner3.run(streamApp3); }

Target:
public void shouldFailWhenNewProcessorJoinsWithSameIdAsExistingProcessor() throws InterruptedException { publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[0]); CountDownLatch kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); CountDownLatch processedMessagesLatch1 = new CountDownLatch(1); CountDownLatch processedMessagesLatch2 = new CountDownLatch(1); StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch1, null, kafkaEventsConsumedLatch); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch2, null, kafkaEventsConsumedLatch); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); processedMessagesLatch1.await(); processedMessagesLatch2.await(); LocalApplicationRunner applicationRunner3 = new LocalApplicationRunner(new MapConfig(applicationConfig2)); publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[2]); kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); StreamApplication streamApp3 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, kafkaEventsConsumedLatch); expectedException.expect(SamzaException.class); applicationRunner3.run(streamApp3); }
Source:
private void bootstrap(Content content, BitSet sentAlready) { if (content instanceof Episode) { Episode episode = (Episode) content; ContainerRef brand = episode.getContainerRef(); SeriesRef series = episode.getSeriesRef(); EpisodeRef episodeRef = episode.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, series, episodeRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } if (series != null && ! sentAlready.get(toInt(series))) { sendMessage(series, partition); sentAlready.set(toInt(series)); } sendMessage(episodeRef, partition); sentAlready.set(toInt(episodeRef)); } else if (content instanceof Series) { Series series = (Series) content; BrandRef brand = series.getBrandRef(); SeriesRef seriesRef = series.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, seriesRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } sendMessage(seriesRef, partition); sentAlready.set(toInt(seriesRef)); } else { ContentRef contentRef = content.toRef(); sendMessage(contentRef, contentRef); sentAlready.set(toInt(contentRef)); } }

Target:
private void bootstrap(Content content, BitSet sentAlready) { if (content instanceof Episode) { Episode episode = (Episode) content; ContainerRef brand = episode.getContainerRef(); SeriesRef series = episode.getSeriesRef(); EpisodeRef episodeRef = episode.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, series, episodeRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } if (series != null && ! sentAlready.get(toInt(series))) { sendMessage(series, partition); sentAlready.set(toInt(series)); } sendMessage(episodeRef, partition); } else if (content instanceof Series) { Series series = (Series) content; BrandRef brand = series.getBrandRef(); SeriesRef seriesRef = series.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, seriesRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } sendMessage(seriesRef, partition); sentAlready.set(toInt(seriesRef)); } else { ContentRef contentRef = content.toRef(); sendMessage(contentRef, contentRef); sentAlready.set(toInt(contentRef)); } }
Source:
public String onMessage(String message) { CommandScript script = deserialize(message, CommandScript.class); String capability = TARGET_CAPABILITY; boolean hasBPMCommand = script.getCommands().stream().filter(cmd -> cmd instanceof DescriptorCommand).findAny().isPresent(); if (hasBPMCommand) { capability = KieServerConstants.CAPABILITY_BPM; } KieContainerCommandService<?> executor = null; for (KieServerExtension extension : context.getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (tmp != null && extension.getImplementedCapability().equalsIgnoreCase(capability)) { executor = tmp; logger.debug("Extension returned command executor with capability {}", extension, executor, extension.getImplementedCapability()); break; } } if (executor == null) { throw new IllegalStateException("No executor found for script execution"); } ServiceResponsesList response = executor.executeScript(script, MarshallingFormat.JSON, null); String reply = serialize(response); return reply; }

Target:
public String onMessage(String message) { CommandScript script = deserialize(message, CommandScript.class); String capability = TARGET_CAPABILITY; boolean hasBPMCommand = script.getCommands().stream().anyMatch(cmd -> cmd instanceof DescriptorCommand); if (hasBPMCommand) { capability = KieServerConstants.CAPABILITY_BPM; } KieContainerCommandService<?> executor = null; for (KieServerExtension extension : context.getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (tmp != null && extension.getImplementedCapability().equalsIgnoreCase(capability)) { executor = tmp; logger.debug("Extension returned command executor with capability {}", extension, executor, extension.getImplementedCapability()); break; } } if (executor == null) { throw new IllegalStateException("No executor found for script execution"); } ServiceResponsesList response = executor.executeScript(script, MarshallingFormat.JSON, null); String reply = serialize(response); return reply; }
Source:
public CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String,String> groupSubjectData, ExtSource source) throws InternalErrorException { if(groupSubjectData == null || groupSubjectData.isEmpty()) throw new InternalErrorException(" Group subject data can't be null or empty, at least group name has to exists."); CandidateGroup candidateGroup = new CandidateGroup(); candidateGroup.setExtSource(source); candidateGroup.asGroup().setName(groupSubjectData.get("groupName")); if(candidateGroup.asGroup().getName() != null) { Matcher name = namePattern.matcher(candidateGroup.asGroup().getName()); if(!name.matches()) throw new InternalErrorException("Group subject data has to contains valid group name!"); } else { throw new InternalErrorException("group name cannot be null in Group subject data!"); } candidateGroup.setParentGroupName(groupSubjectData.get("parentGroupName")); candidateGroup.asGroup().setDescription(groupSubjectData.get("description")); return candidateGroup; }

Target:
public CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String,String> groupSubjectData, ExtSource source) throws InternalErrorException { if(groupSubjectData == null) throw new InternalErrorException("Group subject data cannot be null."); if(groupSubjectData.isEmpty()) throw new InternalErrorException("Group subject data cannot be empty, at least group name has to exists."); if(source == null) throw new InternalErrorException("ExtSource cannot be null while generating CandidateGroup"); CandidateGroup candidateGroup = new CandidateGroup(); candidateGroup.setExtSource(source); candidateGroup.asGroup().setName(groupSubjectData.get(GroupsManagerBlImpl.GROUP_NAME)); if(candidateGroup.asGroup().getName() != null) { Matcher name = groupNamePattern.matcher(candidateGroup.asGroup().getName()); if(!name.matches()) throw new InternalErrorException("Group subject data has to contains valid group name!"); } else { throw new InternalErrorException("group name cannot be null in Group subject data!"); } candidateGroup.setParentGroupName(groupSubjectData.get(GroupsManagerBlImpl.PARENT_GROUP_NAME)); candidateGroup.asGroup().setDescription(groupSubjectData.get(GroupsManagerBlImpl.GROUP_DESCRIPTION)); return candidateGroup; }
Source:
public String author() { try { return new JdkRequest(URI.create(this.url)) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON) .method(Request.GET).fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(JsonResponse.class) .json() .readObject() .getJsonObject("author") .getString("name"); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public String author() { try { return new JdkRequest(this.url) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(JsonResponse.class) .json() .readObject() .getJsonObject("author") .getString("name"); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public DirListingMetadata listChildren(final Path path) throws IOException { checkPath(path); LOG.debug("Listing table in region {}: {}", tableName, region, path); return readOp.retry( "listChildren", path.toString(), true, () -> { final QuerySpec spec = new QuerySpec() .withHashKey(pathToParentKeyAttribute(path)) .withConsistentRead(true); final ItemCollection<QueryOutcome> items = table.query(spec); final List<PathMetadata> metas = new ArrayList<>(); for (Item item : items) { DDBPathMetadata meta = itemToPathMetadata(item, username); metas.add(meta); } DDBPathMetadata dirPathMeta = get(path); boolean isAuthoritative = false; if(dirPathMeta != null) { isAuthoritative = dirPathMeta.isAuthoritativeDir(); } LOG.trace("Listing table in region for returning {}", tableName, region, path, metas); if (!metas.isEmpty() && dirPathMeta == null) { LOG.warn("Directory metadata is null, but the list of the " + "directory elements is not empty: {}. This case is handled " + "as the directory is deleted.", metas); return null; } if(metas.isEmpty() && dirPathMeta == null) { return null; } return new DirListingMetadata(path, metas, isAuthoritative, dirPathMeta.getLastUpdated()); }); }

Target:
public DirListingMetadata listChildren(final Path path) throws IOException { checkPath(path); LOG.debug("Listing table in region {}: {}", tableName, region, path); return readOp.retry( "listChildren", path.toString(), true, () -> { final QuerySpec spec = new QuerySpec() .withHashKey(pathToParentKeyAttribute(path)) .withConsistentRead(true); final ItemCollection<QueryOutcome> items = table.query(spec); final List<PathMetadata> metas = new ArrayList<>(); for (Item item : items) { DDBPathMetadata meta = itemToPathMetadata(item, username); metas.add(meta); } DDBPathMetadata dirPathMeta = get(path); return getDirListingMetadataFromDirMetaAndList(path, metas, dirPathMeta); }); }
Source:
public void onUnbind(GraphContainerProvider graphContainerProvider, Map<String, String> props) { if(graphContainerProvider != null) { graphContainerProviders.remove(graphContainerProvider); final ServiceRegistration<GraphContainerProviderRegistration> serviceRegistration = serviceRegistrationMap.remove(graphContainerProvider); if (serviceRegistration != null) { serviceRegistration.unregister(); } } }

Target:
public void onUnbind(GraphContainerProvider graphContainerProvider, Map<String, String> props) { if(graphContainerProvider == null) { return; } graphContainerProviders.remove(graphContainerProvider); final ServiceRegistration<GraphContainerProviderRegistration> serviceRegistration = serviceRegistrationMap.remove(graphContainerProvider); if (serviceRegistration != null) { serviceRegistration.unregister(); } }
Source:
public void onFatalError(Throwable throwable) { synchronized (lock) { if (running) { if (throwable instanceof LeaderRetrievalException) { leaderListener.handleError((LeaderRetrievalException) throwable); } else { leaderListener.handleError(new LeaderRetrievalException(throwable)); } } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } } } }

Target:
public void onFatalError(Throwable throwable) { synchronized (lock) { if (!running) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } return; } if (throwable instanceof LeaderRetrievalException) { leaderListener.handleError((LeaderRetrievalException) throwable); } else { leaderListener.handleError(new LeaderRetrievalException(throwable)); } } }
Source:
public InputStream getErrorStream() { errorStream = provider.getErrorStream(); if (errorStream != null) { errorStream = new FilterInputStream(errorStream) { @Override public int read(byte[] b, int off, int len) throws IOException { int bytes = super.read(b, off, len); byte[] payload = new byte[bytes]; System.arraycopy(b, off, payload, 0, bytes); if (logToStderr) { System.err.println(id + " to LSP4E:" + new String(payload)); } if (logToFile) { log(new String("\n" + id + " to LSP4E:" + payload)); } return bytes; } }; } return errorStream; }

Target:
public InputStream getErrorStream() { if (errorStream != null) { return errorStream; } if (provider.getErrorStream() != null) { errorStream = new FilterInputStream(provider.getErrorStream()) { @Override public int read(byte[] b, int off, int len) throws IOException { int bytes = super.read(b, off, len); byte[] payload = new byte[bytes]; System.arraycopy(b, off, payload, 0, bytes); if (logToStderr) { System.err.println(id + " to LSP4E:" + new String(payload)); } if (logToFile) { log(new String("\n" + id + " to LSP4E:" + payload)); } return bytes; } }; } return errorStream; }
Source:
private HttpRequest createSoapRequest(HttpRequest request) { final String body = request.getPayload().getRawContent().toString(); final Payload payload = Payloads.newStringPayload(SOAP_PREFIX.concat(body).concat(SOAP_SUFFIX)); payload.getContentMetadata().setContentType(MediaType.TEXT_XML); return request.toBuilder().payload(payload).build(); }

Target:
private HttpRequest createSoapRequest(HttpRequest request) { Payload oldPayload = request.getPayload(); ContentMetadata oldMetadata = oldPayload.getContentMetadata(); String body = SOAP_PREFIX.concat(oldPayload.getRawContent().toString()).concat(SOAP_SUFFIX); Payload newPayload = Payloads.newStringPayload(body); HttpUtils.copy(oldMetadata, newPayload.getContentMetadata()); newPayload.getContentMetadata().setContentLength(Long.valueOf(body.length())); return request.toBuilder().payload(newPayload).build(); }