auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static int positionToDragCursor(int swtPositionConstant) { switch (swtPositionConstant) { case SWT.LEFT: return LEFT; case SWT.RIGHT: return RIGHT; case SWT.TOP: return TOP; case SWT.BOTTOM: return BOTTOM; case SWT.CENTER: return CENTER; } return INVALID; }

Target:
public static int positionToDragCursor(int swtPositionConstant) { switch (swtPositionConstant) { case SWT.LEFT: return LEFT; case SWT.RIGHT: return RIGHT; case SWT.TOP: return TOP; case SWT.BOTTOM: return BOTTOM; case SWT.CENTER: return CENTER; default: return INVALID; } }
Source:
public static boolean shouldCaptureIncrementalChanges(FileSystem fs,Path rootDir) throws StandardException{ boolean shouldRegister = false; try { boolean enabled = incrementalBackupEnabled(); if (enabled) { RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper(); String spliceBackupPath = BackupUtils.getBackupPath(); if (zooKeeper.exists(spliceBackupPath, false)==null){ return false; } boolean isRestoreMode = SIDriver.driver().lifecycleManager().isRestoreMode(); if (!isRestoreMode) { if (BackupUtils.existsDatabaseBackup(fs, rootDir)) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "There exists a successful full or incremental backup in the system"); } shouldRegister = true; } else { List<String> backupJobs = zooKeeper.getChildren(spliceBackupPath, false); for (String backupId : backupJobs) { String path = spliceBackupPath + "/" + backupId; byte[] data = zooKeeper.getData(path, false, null); BackupJobStatus status = BackupJobStatus.parseFrom(data); if (status.getScope() == BackupJobStatus.BackupScope.DATABASE.DATABASE) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "A database backup is running"); } shouldRegister = true; } } } } } return shouldRegister; } catch (Exception e) { e.printStackTrace(); throw StandardException.plainWrapException(e); } }

Target:
public static boolean shouldCaptureIncrementalChanges(FileSystem fs,Path rootDir) throws StandardException{ boolean shouldRegister = false; try { boolean enabled = incrementalBackupEnabled(); if (enabled) { RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper(); String spliceBackupPath = BackupUtils.getBackupPath(); if (zooKeeper.exists(spliceBackupPath, false)==null){ return false; } boolean isRestoreMode = SIDriver.driver().lifecycleManager().isRestoreMode(); if (!isRestoreMode) { if (BackupUtils.existsDatabaseBackup(fs, rootDir)) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "There exists a successful full or incremental backup in the system"); } shouldRegister = true; } else { List<String> backupJobs = zooKeeper.getChildren(spliceBackupPath, false); for (String backupId : backupJobs) { String path = spliceBackupPath + "/" + backupId; byte[] data = zooKeeper.getData(path, false, null); BackupJobStatus status = BackupJobStatus.parseFrom(data); if (status.getScope() == BackupJobStatus.BackupScope.DATABASE) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "A database backup is running"); } shouldRegister = true; } } } } } return shouldRegister; } catch (Exception e) { e.printStackTrace(); throw StandardException.plainWrapException(e); } }
Source:
public synchronized void onCompleted(AbstractBuild r, TaskListener listener) { GerritCause cause = getCause(r); logger.info("Completed. Build: Cause: {}", r, cause); if (cause != null) { cleanUpGerritCauses(cause, r); PatchsetCreated event = cause.getEvent(); if (GerritTrigger.getTrigger(r.getProject()) != null) { GerritTrigger.getTrigger(r.getProject()).notifyBuildEnded(event); } event.fireBuildCompleted(r); if (!cause.isSilentMode()) { PatchSetKey key = memory.completed(event, r); if (r.getResult() != Result.SUCCESS) { try { String failureMessage = this.obtainFailureMessage(event, r, listener); memory.setEntryFailureMessage(key, r, failureMessage); } catch (IOException e) { e.printStackTrace(listener.getLogger()); } catch (InterruptedException e) { e.printStackTrace(listener.getLogger()); } } updateTriggerContexts(r, key); if (memory.isAllBuildsCompleted(key)) { try { logger.info("All Builds are completed for cause: {}", cause); event.fireAllBuildsCompleted(); NotificationFactory.getInstance().queueBuildCompleted(memory.getMemoryImprint(key), listener); } finally { memory.forget(key); } } else { logger.info("Waiting for more builds to complete for cause [{}]. Status: \n{}", cause, memory.getStatusReport(key)); } } } }

Target:
public synchronized void onCompleted(AbstractBuild r, TaskListener listener) { GerritCause cause = getCause(r); logger.info("Completed. Build: Cause: {}", r, cause); if (cause != null) { cleanUpGerritCauses(cause, r); PatchsetCreated event = cause.getEvent(); if (GerritTrigger.getTrigger(r.getProject()) != null) { GerritTrigger.getTrigger(r.getProject()).notifyBuildEnded(event); } event.fireBuildCompleted(r); if (!cause.isSilentMode()) { PatchSetKey key = memory.completed(event, r); if (r.getResult().isWorseThan(Result.SUCCESS)) { try { String failureMessage = this.obtainFailureMessage(event, r, listener); logger.info("Obtained failure message: {}", failureMessage); memory.setEntryFailureMessage(key, r, failureMessage); } catch (IOException e) { listener.error("[gerrit-trigger] Unable to read failure message from the workspace."); logger.warn("IOException while obtaining failure message for build: " + r.getDisplayName(), e); } catch (InterruptedException e) { listener.error("[gerrit-trigger] Unable to read failure message from the workspace."); logger.warn("InterruptedException while obtaining failure message for build: " + r.getDisplayName(), e); } } updateTriggerContexts(r, key); if (memory.isAllBuildsCompleted(key)) { try { logger.info("All Builds are completed for cause: {}", cause); event.fireAllBuildsCompleted(); NotificationFactory.getInstance().queueBuildCompleted(memory.getMemoryImprint(key), listener); } finally { memory.forget(key); } } else { logger.info("Waiting for more builds to complete for cause [{}]. Status: \n{}", cause, memory.getStatusReport(key)); } } } }
Source:
public void testVerifyByteArrayByteArray() { for(int i = 0; i < types.length; i++){ Hash hash = new Hash(types[i]); boolean verified = hash.verify(Hex.decode(trueHashes[i]), helloWorld); assertTrue("HashType: "+types[i].name(), verified); } }

Target:
public void testVerifyByteArrayByteArray() { for(int i = 0; i < types.length; i++){ Hash hash = new Hash(types[i]); assertTrue("HashType: "+types[i].name(), hash.verify(Hex.decode(trueHashes[i]), helloWorld)); } }
Source:
public boolean advance() { if (state.get() != State.RUNNING) { return false; } URI nextUri = currentStatusInfo().getNextUri(); if (nextUri == null) { state.compareAndSet(State.RUNNING, State.FINISHED); return false; } Request request = prepareRequest(HttpUrl.get(nextUri)).build(); Exception cause = null; long start = System.nanoTime(); long attempts = 0; while (true) { if (attempts > 0) { try { MILLISECONDS.sleep(attempts * 100); } catch (InterruptedException e) { try { close(); } finally { Thread.currentThread().interrupt(); } state.compareAndSet(State.RUNNING, State.COMMUNICATION_FAILURE); throw new RuntimeException("StatementClient thread was interrupted"); } } attempts++; JsonResponse<QueryResults> response; try { response = JsonResponse.execute(QUERY_RESULTS_CODEC, httpClient, request); } catch (RuntimeException e) { cause = e; continue; } if ((response.getStatusCode() == HTTP_OK) && response.hasValue()) { processResponse(response.getHeaders(), response.getValue()); return true; } if (response.getStatusCode() != HTTP_UNAVAILABLE) { state.compareAndSet(State.RUNNING, State.COMMUNICATION_FAILURE); throw requestFailedException("fetching next", request, response); } if (System.nanoTime() - start >= requestTimeoutNanos) { state.compareAndSet(State.RUNNING, State.COMMUNICATION_FAILURE); throw new RuntimeException("Time out fetching next", cause); } if (isAborted()) { return false; } } }

Target:
public boolean advance() { if (!isRunning()) { return false; } URI nextUri = currentStatusInfo().getNextUri(); if (nextUri == null) { state.compareAndSet(State.RUNNING, State.FINISHED); return false; } Request request = prepareRequest(HttpUrl.get(nextUri)).build(); Exception cause = null; long start = System.nanoTime(); long attempts = 0; while (true) { if (attempts > 0) { try { MILLISECONDS.sleep(attempts * 100); } catch (InterruptedException e) { try { close(); } finally { Thread.currentThread().interrupt(); } state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException("StatementClient thread was interrupted"); } } attempts++; JsonResponse<QueryResults> response; try { response = JsonResponse.execute(QUERY_RESULTS_CODEC, httpClient, request); } catch (RuntimeException e) { cause = e; continue; } if ((response.getStatusCode() == HTTP_OK) && response.hasValue()) { processResponse(response.getHeaders(), response.getValue()); return true; } if (response.getStatusCode() != HTTP_UNAVAILABLE) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw requestFailedException("fetching next", request, response); } if (Duration.nanosSince(start).compareTo(requestTimeoutNanos) > 0) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException("Error fetching next", cause); } if (isClientAborted()) { return false; } } }
Source:
public void visitNode(Tree tree) { if (hasSemantic()) { MethodTree methodTree = (MethodTree) tree; if (methodTree.block() != null && "equals".equals(methodTree.symbol().name()) && methodTree.parameters().size() == 1) { Symbol parameterSymbol = methodTree.parameters().get(0).symbol(); if (parameterSymbol.type().is("java.lang.Object")) { typeChecked = false; methodTree.accept(new EqualsMethodVisitor(parameterSymbol)); if (!typeChecked) { addIssue(tree, "Add a type test to this method."); } } } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; if (methodTree.block() != null && "equals".equals(methodTree.symbol().name()) && methodTree.parameters().size() == 1) { Symbol parameterSymbol = methodTree.parameters().get(0).symbol(); if (parameterSymbol.type().is("java.lang.Object")) { ExpressionVisitor visitor = new ExpressionVisitor(parameterSymbol); methodTree.accept(visitor); if (!visitor.typeChecked) { addIssue(tree, "Add a type test to this method."); } } } }
Source:
protected void finishFeature() { final SWTBotTree projectExplorerTree = TestUtil.getExplorerTree(); getProjectItem(projectExplorerTree, PROJ1).select(); final String[] menuPath = new String[] { util.getPluginLocalizedValue("TeamMenu.label"), util.getPluginLocalizedValue("TeamGitFlowMenu.name", false, Activator.getDefault().getBundle()), util.getPluginLocalizedValue("TeamGitFlowFeatureFinish.name", false, Activator.getDefault().getBundle()) }; ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath); bot.waitUntil(shellIsActive(UIText.FinishFeatureDialog_title)); selectOptions(); bot.checkBox(UIText.FinishFeatureDialog_saveAsDefault).click(); bot.button("Finish").click(); preFinish(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); }

Target:
protected void finishFeature() { final SWTBotTree projectExplorerTree = TestUtil.getExplorerTree(); getProjectItem(projectExplorerTree, PROJ1).select(); final String[] menuPath = new String[] { util.getPluginLocalizedValue("TeamMenu.label"), util.getPluginLocalizedValue("TeamGitFlowMenu.name", false, Activator.getDefault().getBundle()), util.getPluginLocalizedValue("TeamGitFlowFeatureFinish.name", false, Activator.getDefault().getBundle()) }; ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath); bot.waitUntil(shellIsActive(UIText.FinishFeatureDialog_title)); selectOptions(); bot.checkBox(UIText.FinishFeatureDialog_saveAsDefault).click(); bot.button(UIText.FinishFeatureDialog_ButtonOK).click(); preFinish(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); }
Source:
public void setUp() { spyMap = spy(newConcurrentMap()); registry = DefaultStateRegistry.getInstance(); try { final Field defaultStates = registry.getClass() .getDeclaredField(DEFAULT_STATES_FIELD_NAME); defaultStates.setAccessible(true); defaultStates.set(registry, spyMap); } catch (NoSuchFieldException | IllegalAccessException ignored) { } }

Target:
public void setUp() { spyMap = spy(newConcurrentMap()); registry = DefaultStateRegistry.getInstance(); injectField(registry, DEFAULT_STATES_FIELD_NAME, spyMap); }
Source:
protected AwardAccount createDefaultAwardAccount(RassXmlAwardEntry xmlAward) { Map<String, String> defaultAwardAccountAttributes = getDefaultAwardAccountAttributes(); String directorPrincipalId = parameterService.getParameterValueAsString(RassStep.class, RassParameterConstants.DEFAULT_PROJECT_DIRECTOR); if (StringUtils.isBlank(directorPrincipalId)) { throw new RuntimeException("Default project director parameter cannot be blank"); } AwardAccount awardAccount = new AwardAccount(); awardAccount.setProposalNumber(xmlAward.getProposalNumber()); awardAccount.setPrincipalId(directorPrincipalId); awardAccount.setChartOfAccountsCode(defaultAwardAccountAttributes.get(KFSPropertyConstants.CHART)); awardAccount.setAccountNumber(defaultAwardAccountAttributes.get(KFSPropertyConstants.ACCOUNT_NUMBER)); awardAccount.setActive(defaultAccountIndicatorIsActive(KFSPropertyConstants.ACCOUNT_ACTIVE_INDICATOR)); return awardAccount; }

Target:
protected AwardAccount createDefaultAwardAccount(RassXmlAwardEntry xmlAward) { Map<String, String> defaultAwardAccountAttributes = getDefaultAwardAccountAttributes(); String directorPrincipalId = parameterService.getParameterValueAsString(RassStep.class, RassParameterConstants.DEFAULT_PROJECT_DIRECTOR); if (StringUtils.isBlank(directorPrincipalId)) { throw new RuntimeException("Default project director parameter cannot be blank"); } AwardAccount awardAccount = new AwardAccount(); awardAccount.setProposalNumber(xmlAward.getProposalNumber()); awardAccount.setPrincipalId(directorPrincipalId); awardAccount.setChartOfAccountsCode(defaultAwardAccountAttributes.get(KFSPropertyConstants.CHART)); awardAccount.setAccountNumber(defaultAwardAccountAttributes.get(KFSPropertyConstants.ACCOUNT_NUMBER)); awardAccount.setActive(defaultAccountIndicatorIsActive(defaultAwardAccountAttributes.get(KFSPropertyConstants.ACCOUNT_ACTIVE_INDICATOR))); return awardAccount; }
Source:
protected String[] getListOfPackageJsonFiles(String baseDir, String filename) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setIncludes(new String[] {"**/*" + filename}); scanner.setExcludes(EXCLUDED_DIRECTORIES); scanner.setBasedir(baseDir); scanner.scan(); return scanner.getIncludedFiles(); }

Target:
private String[] getListOfPackageJsonFiles(String baseDir, String filename) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setIncludes(new String[] {"**/*" + filename}); scanner.setExcludes(EXCLUDED_DIRECTORIES); scanner.setBasedir(baseDir); scanner.scan(); return scanner.getIncludedFiles(); }
Source:
public void handle(@Nonnull CorfuPayloadMsg<OrchestratorMsg> msg, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { OrchestratorMsg orchReq = msg.getPayload(); IWorkflow workflow; switch (orchReq.getRequest().getType()) { case QUERY: query(msg, ctx, r); break; case ADD_NODE: workflow = new AddNodeWorkflow((AddNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case REMOVE_NODE: workflow = new RemoveNodeWorkflow((RemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case HEAL_NODE: workflow = new HealNodeWorkflow((HealNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case FORCE_REMOVE_NODE: workflow = new ForceRemoveWorkflow((ForceRemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case MERGE_SEGMENTS: workflow = new MergeSegmentsWorkflow((MergeSegmentsRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; default: log.error("handle: Unknown request type {}", orchReq.getRequest().getType()); } }

Target:
public void handle(@Nonnull CorfuPayloadMsg<OrchestratorMsg> msg, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { OrchestratorMsg orchReq = msg.getPayload(); IWorkflow workflow; switch (orchReq.getRequest().getType()) { case QUERY: query(msg, ctx, r); break; case ADD_NODE: workflow = new AddNodeWorkflow((AddNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case REMOVE_NODE: workflow = new RemoveNodeWorkflow((RemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case HEAL_NODE: workflow = new HealNodeWorkflow((HealNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case FORCE_REMOVE_NODE: workflow = new ForceRemoveWorkflow((ForceRemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case RESTORE_REDUNDANCY_MERGE_SEGMENTS: workflow = new RestoreRedundancyMergeSegmentsWorkflow((RestoreRedundancyMergeSegmentsRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; default: log.error("handle: Unknown request type {}", orchReq.getRequest().getType()); } }
Source:
void inject(@ComponentName(KnownComponentNames.NON_BLOCKING_EXECUTOR) Executor nonBlockingExecutor, TimeService timeService) { for (int i = 0; i < sharedLocks.length; i++) { sharedLocks[i] = new InfinispanLock(nonBlockingExecutor, timeService); } }

Target:
void inject(@ComponentName(KnownComponentNames.NON_BLOCKING_EXECUTOR) Executor nonBlockingExecutor, TimeService timeService) { for (int i = 0; i < sharedLocks.length; i++) { if (sharedLocks[i] == null) { sharedLocks[i] = new InfinispanLock(nonBlockingExecutor, timeService); } else { sharedLocks[i].setTimeService(timeService); } } }
Source:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { try { storageManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); } catch (Exception e) { participantMetrics.standbyCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); if (replicationManagerListener != null) { try { replicationManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); replicaSyncUpManager.waitDeactivationCompleted(partitionName); } catch (InterruptedException e) { logger.error("Deactivation was interrupted on partition {}", partitionName); participantMetrics.standbyCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw new StateTransitionException("Deactivation failed or was interrupted", DeactivationFailure); } catch (StateTransitionException e) { logger.error("Deactivation didn't complete on partition {}", partitionName, e); participantMetrics.standbyCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } participantMetrics.standbyCount.addAndGet(-1); participantMetrics.inactiveCount.addAndGet(1); }

Target:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { try { storageManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); } catch (Exception e) { participantMetrics.standbyCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } PartitionStateChangeListener replicationManagerListener = partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener); try { if (replicationManagerListener != null) { replicationManagerListener.onPartitionBecomeInactiveFromStandby(partitionName); replicaSyncUpManager.waitDeactivationCompleted(partitionName); } } catch (InterruptedException e) { logger.error("Deactivation was interrupted on partition {}", partitionName); participantMetrics.errorStateCount.addAndGet(1); throw new StateTransitionException("Deactivation failed or was interrupted", DeactivationFailure); } catch (StateTransitionException e) { logger.error("Deactivation didn't complete on partition {}", partitionName, e); participantMetrics.errorStateCount.addAndGet(1); throw e; } finally { participantMetrics.standbyCount.addAndGet(-1); } participantMetrics.inactiveCount.addAndGet(1); }
Source:
public Seq<Binding<?>> bindings(final Environment environment, final play.api.Configuration configuration) { return seq( bind(CountryCode.class).qualifiedWith("default").toInstance(defaultCountry(configuration)), bind(PlayJavaSphereClient.class).toProvider(PlayJavaSphereClientProvider.class).in(Singleton.class), bind(CategoryTree.class).toProvider(CategoryTreeProvider.class), bind(TemplateService.class).toProvider(TemplateServiceProvider.class), bind(CmsService.class).toProvider(CmsServiceProvider.class) ); }

Target:
public Seq<Binding<?>> bindings(final Environment environment, final play.api.Configuration configuration) { return seq( bind(CountryCode.class).qualifiedWith("default").toInstance(defaultCountry(configuration)), bind(PlayJavaSphereClient.class).toProvider(PlayJavaSphereClientProvider.class).in(Singleton.class), bind(CategoryTree.class).toProvider(CategoryTreeProvider.class).in(Singleton.class), bind(TemplateService.class).toProvider(TemplateServiceProvider.class).in(Singleton.class), bind(CmsService.class).toProvider(CmsServiceProvider.class).in(Singleton.class) ); }
Source:
public void updateEntriesOnSend(S38PacketPlayerListItem packet) { for (S38PacketPlayerListItem.AddPlayerData data : packet.players) { if (packet.action == S38PacketPlayerListItem.Action.ADD_PLAYER) { this.addEntry(data); } else if (packet.action == S38PacketPlayerListItem.Action.REMOVE_PLAYER) { this.removeEntry(data.getProfile().getId()); } else if (packet.action == S38PacketPlayerListItem.Action.UPDATE_GAME_MODE || packet.action == S38PacketPlayerListItem.Action.UPDATE_LATENCY || packet.action == S38PacketPlayerListItem.Action.UPDATE_DISPLAY_NAME) { this.getEntry(data.getProfile().getId()).ifPresent(entry -> { if (packet.action == S38PacketPlayerListItem.Action.UPDATE_DISPLAY_NAME) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setDisplayName(data.getDisplayName() == null ? null : SpongeTexts.toText(data.getDisplayName())); } else if (packet.action == S38PacketPlayerListItem.Action.UPDATE_LATENCY) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setLatency(data.getPing()); } else if (packet.action == S38PacketPlayerListItem.Action.UPDATE_GAME_MODE) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setGameMode((GameMode) (Object) data.getGameMode()); } }); } else { throw new IllegalArgumentException("unknown packet action: " + packet.action); } } }

Target:
public void updateEntriesOnSend(S38PacketPlayerListItem packet) { for (S38PacketPlayerListItem.AddPlayerData data : packet.players) { if (packet.action == S38PacketPlayerListItem.Action.ADD_PLAYER) { this.addEntry(data); } else if (packet.action == S38PacketPlayerListItem.Action.REMOVE_PLAYER) { this.removeEntry(data.getProfile().getId()); } else { this.getEntry(data.getProfile().getId()).ifPresent(entry -> { if (packet.action == S38PacketPlayerListItem.Action.UPDATE_DISPLAY_NAME) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setDisplayName(data.getDisplayName() == null ? null : SpongeTexts.toText(data.getDisplayName())); } else if (packet.action == S38PacketPlayerListItem.Action.UPDATE_LATENCY) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setLatency(data.getPing()); } else if (packet.action == S38PacketPlayerListItem.Action.UPDATE_GAME_MODE) { ((SpongeTabListEntry) entry).updateWithoutSend(); entry.setGameMode((GameMode) (Object) data.getGameMode()); } else { throw new IllegalArgumentException("unknown packet action: " + packet.action); } }); } } }
Source:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (CollectionUtils.isEmpty(diskList)) { setReturnValue(new ArrayList<>()); return; } setReturnValue(filterDisks(diskList)); }

Target:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (CollectionUtils.isEmpty(diskList)) { setReturnValue(diskList); return; } setReturnValue(filterDisks(diskList)); }
Source:
public OfferAutoscaleSettings getOfferAutoscaleProperties() { return this.offer.getOfferAutoScaleSettings(); }

Target:
OfferAutoscaleSettings getOfferAutoscaleProperties() { return this.offer.getOfferAutoScaleSettings(); }
Source:
public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, StateSystemDisposedException { ITmfStateInterval ret = super.doSingularQuery(t, attributeQuark); if (ret != null) { return ret; } synchronized (intervalQueue) { if (fCurrentInterval.getAttribute() == attributeQuark && fCurrentInterval.intersects(t)) { return fCurrentInterval; } for (ITmfStateInterval interval : intervalQueue) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } } return super.doSingularQuery(t, attributeQuark); }

Target:
public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, StateSystemDisposedException { ITmfStateInterval ret = super.doSingularQuery(t, attributeQuark); if (ret != null) { return ret; } for (ITmfStateInterval interval : intervalQueue) { if (interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } } HTInterval interval = currentInterval; if (interval != null && interval.getAttribute() == attributeQuark && interval.intersects(t)) { return interval; } return super.doSingularQuery(t, attributeQuark); }
Source:
public GuestMigration buildMigrationManifest(ConsumerDTO incoming, Consumer existing) { if (incoming.getGuestIds() == null) { log.debug("Guests not included in this consumer update, skipping update."); migrationPending = false; return this; } Consumer incomingConsumerEntity = new Consumer(); List<GuestId> guestIds = new ArrayList<>(); for (GuestIdDTO dto : incoming.getGuestIds()) { GuestId entity = new GuestId(); GuestIdResource.populateEntity(entity, dto); guestIds.add(entity); } incomingConsumerEntity.setGuestIds(guestIds); return this.buildMigrationManifest(incomingConsumerEntity, existing); }

Target:
public GuestMigration buildMigrationManifest(ConsumerDTO incoming, Consumer existing) { if (incoming.getGuestIds() == null) { log.debug("Guests not included in this consumer update, skipping update."); migrationPending = false; return this; } manifest = new MigrationManifest(existing); log.debug("Updating guest IDs.", incoming.getGuestIds().size()); List<GuestId> existingGuests = existing.getGuestIds(); List<GuestId> incomingGuestIds = incoming.getGuestIds().stream().filter(Objects::nonNull) .map(guestIdDTO -> new GuestId(guestIdDTO.getGuestId(), existing, guestIdDTO.getAttributes())) .collect(Collectors.toList()); List<GuestId> removedGuests = getRemovedGuestIds(existing, incomingGuestIds); List<GuestId> addedGuests = getAddedGuestIds(existing, incomingGuestIds); if (existingGuests != null) { for (GuestId guestId : removedGuests) { existingGuests.remove(guestId); log.debug("Guest ID removed: {}", guestId); } } for (GuestId guestId : incomingGuestIds) { if (addedGuests.contains(guestId)) { manifest.addGuestId(guestId); log.debug("New guest ID added: {}", guestId); } } migrationPending = removedGuests.size() != 0 || addedGuests.size() != 0; return this; }
Source:
public void run() { while (!_shutdownRequested) { try { Thread.sleep(_periodMs); } catch (InterruptedException e) { break; } flushAndMakeCheckpoints(); } LOG.info(String.format("Checkpoint handler exited, tasks = [%s].", _taskDesc)); }

Target:
public void run() { if (_shutdownRequested) { return; } try { flushAndMakeCheckpoints(); LOG.info(String.format("Checkpoint handler exited, tasks = [%s].", _taskDesc)); } catch (Throwable t){ LOG.error(String.format("Checkpoint failed, will retry after %d ms, reason = %s", _periodMs, t.getMessage()), t); } }
Source:
public @ResponseBody CertifiedProductSearchDetails getCertifiedProductByChplProductNumberBasic2( @PathVariable("chplPrefix") final String chplPrefix, @PathVariable("identifier") final String identifier) throws EntityRetrievalException { String chplProductNumber = chplProductNumberUtil.getChplProductNumber(chplPrefix, identifier); CertifiedProductSearchDetails certifiedProduct = cpdManager.getCertifiedProductDetailsBasicByChplProductNumber(chplProductNumber); certifiedProduct = validateCertifiedProduct(certifiedProduct); removeNonBasicCertifiedProductSearchDetails(certifiedProduct); return certifiedProduct; }

Target:
public @ResponseBody CertifiedProductSearchBasicDetails getCertifiedProductByChplProductNumberBasic2( @PathVariable("chplPrefix") final String chplPrefix, @PathVariable("identifier") final String identifier) throws EntityRetrievalException { String chplProductNumber = chplProductNumberUtil.getChplProductNumber(chplPrefix, identifier); CertifiedProductSearchDetails certifiedProduct = cpdManager.getCertifiedProductDetailsBasicByChplProductNumber(chplProductNumber); return mapCertifiedProductDetailsToBasic.apply(certifiedProduct); }
Source:
public ResponseEntity<ResourceSupport> postAdminGroup(@PathVariable UUID uuid, HttpServletResponse response, HttpServletRequest request) throws SQLException, AuthorizeException { Context context = ContextUtil.obtainContext(request); Community community = communityService.find(context, uuid); if (community == null) { throw new ResourceNotFoundException("No such community: " + uuid); } if (!authorizeService.isAdmin(context) && !authorizeService.authorizeActionBoolean(context, community, Constants.ADMIN, true)) { throw new AccessDeniedException("The current user was not allowed to retrieve the AdminGroup for" + " community: " + uuid); } if (community.getAdministrators() != null) { throw new UnprocessableEntityException("The community with UUID: " + uuid + " already has " + "an admin group"); } GroupRest adminGroup = communityRestRepository.createAdminGroup(context, request, community); context.complete(); GroupResource groupResource = converterService.toResource(adminGroup); return ControllerUtils.toResponseEntity(HttpStatus.CREATED, new HttpHeaders(), groupResource); }

Target:
public ResponseEntity<ResourceSupport> postAdminGroup(@PathVariable UUID uuid, HttpServletResponse response, HttpServletRequest request) throws SQLException, AuthorizeException { Context context = ContextUtil.obtainContext(request); Community community = communityService.find(context, uuid); if (community == null) { throw new ResourceNotFoundException("No such community: " + uuid); } AuthorizeUtil.authorizeManageAdminGroup(context, community); if (community.getAdministrators() != null) { throw new UnprocessableEntityException("The community with UUID: " + uuid + " already has " + "an admin group"); } GroupRest adminGroup = communityRestRepository.createAdminGroup(context, request, community); context.complete(); GroupResource groupResource = converterService.toResource(adminGroup); return ControllerUtils.toResponseEntity(HttpStatus.CREATED, new HttpHeaders(), groupResource); }
Source:
public ByteBuf processFrame(ByteBuf inputBuffer) throws TException, IOException { byte[] encodedBytes = new byte[inputBuffer.readableBytes()]; inputBuffer.readBytes(encodedBytes); byte[] inputBytes = Base64.decodeBase64(encodedBytes); if (inputBytes.length < 4) { throw new IOException("Invalid request size " + inputBytes.length); } ByteBuffer buff = ByteBuffer.wrap(inputBytes); int sz = buff.getInt(); if (sz != buff.remaining()) { throw new IOException( String.format("Mismatch between expected frame size (%d) and actual size (%d)", sz, inputBytes.length - 4) ); } byte[] inputFrame = Arrays.copyOfRange(inputBytes, 4, inputBytes.length); TTransport inTransport = new TMemoryInputTransport(inputFrame); TMemoryOutputBuffer outTransport = new TMemoryOutputBuffer(); processor.process(inProtocolFactory.getProtocol(inTransport), outProtocolFactory.getProtocol(outTransport)); byte[] outputBytes = Base64.encodeBase64(outTransport.getWriteBytes()); return Unpooled.copiedBuffer(outputBytes); }

Target:
public ByteBuf processFrame(ByteBuf inputBuffer) throws TException, IOException { byte[] encodedBytes = new byte[inputBuffer.readableBytes()]; inputBuffer.readBytes(encodedBytes); byte[] inputBytes = Base64.decodeBase64(encodedBytes); ByteBuffer buff = ByteBuffer.wrap(inputBytes); int sz; try { sz = buff.getInt(); } catch (BufferUnderflowException e) { throw new IOException("Invalid request size " + inputBytes.length); } if (sz != buff.remaining()) { throw new IOException( String.format("Mismatch between expected frame size (%d) and actual size (%d)", sz, inputBytes.length - 4) ); } byte[] inputFrame = Arrays.copyOfRange(inputBytes, 4, inputBytes.length); TTransport inTransport = new TMemoryInputTransport(inputFrame); TMemoryOutputBuffer outTransport = new TMemoryOutputBuffer(); processor.process(inProtocolFactory.getProtocol(inTransport), outProtocolFactory.getProtocol(outTransport)); byte[] outputBytes = Base64.encodeBase64(outTransport.getWriteBytes()); return Unpooled.copiedBuffer(outputBytes); }
Source:
public FeatureScenario(){ super(); }

Target:
public FeatureScenario(){ }
Source:
public long getLowWatermark() { Map<String, Long> watermarks = new HashMap<>(pools.size()); Set<String> roots = topology.getRoots(); Map<String, Long> watermarkTrees = new HashMap<>(roots.size()); pools.forEach(pool -> watermarks.put(pool.getComputationName(), pool.getLowWatermark())); for (String root : roots) { watermarkTrees.put(root, topology.getDescendantComputationNames(root).stream().map(watermarks::get) .min(Comparator.naturalOrder()).orElse(0L)); } long ret = watermarkTrees.values().stream() .filter(wm -> wm > 1).min(Comparator.naturalOrder()).orElse(0L); if (log.isTraceEnabled()) { log.trace("lowWatermark: " + ret); watermarkTrees.forEach((k, v) -> log.trace("tree " + k + ": " + v)); } return ret; }

Target:
public long getLowWatermark() { Map<String, Long> watermarks = new HashMap<>(pools.size()); Set<String> roots = topology.getRoots(); Map<String, Long> watermarkTrees = new HashMap<>(roots.size()); pools.forEach(pool -> watermarks.put(pool.getComputationName(), pool.getLowWatermark())); for (String root : roots) { watermarkTrees.put(root, topology.getDescendantComputationNames(root).stream().mapToLong(watermarks::get).min().orElse(0)); } long ret = watermarkTrees.values().stream().filter(wm -> wm > 1).mapToLong(Long::new).min().orElse(0); if (log.isTraceEnabled()) { log.trace("lowWatermark: " + ret); watermarkTrees.forEach((k, v) -> log.trace("tree " + k + ": " + v)); } return ret; }
Source:
private void printGroupRecord(ExtMap extMap) { if (extMap != null) { logger.info(String.format("GroupRecord: ID %s, name: %s, Display name: %s", extMap.get(Authz.GroupRecord.ID, ""), extMap.get(Authz.GroupRecord.NAME, ""), extMap.get(Authz.GroupRecord.DISPLAY_NAME, "") )); } }

Target:
private void printGroupRecord(ExtMap extMap) { if (extMap != null) { do { logger.info(String.format("GroupRecord: ID '%s', name: '%s', namespace: '%s', display name: '%s'", extMap.get(Authz.GroupRecord.ID, ""), extMap.get(Authz.GroupRecord.NAME, ""), extMap.get(Authz.GroupRecord.NAMESPACE, ""), extMap.get(Authz.GroupRecord.DISPLAY_NAME, "") )); } while((extMap = extMap.get(Authz.GroupRecord.GROUPS)) != null); } }
Source:
public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); }

Target:
public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (String child : children) { boolean success = deleteDir(new File(dir, child)); if (!success) { return false; } } } return dir.delete(); }
Source:
private List<EmailWrapper> getEmailsToInstructor(InstructorAttributes instructor, List<EmailWrapper> emailsSent) { List<EmailWrapper> emailsToInstructor = new ArrayList<EmailWrapper>(); for (EmailWrapper email : emailsSent) { boolean emailSentToThisInstructor = email.getFirstRecipient().equalsIgnoreCase(instructor.email); if (emailSentToThisInstructor) { emailsToInstructor.add(email); } } return emailsToInstructor; }

Target:
private List<EmailWrapper> getEmailsToInstructor(InstructorAttributes instructor, List<EmailWrapper> emailsSent) { List<EmailWrapper> emailsToInstructor = new ArrayList<EmailWrapper>(); for (EmailWrapper email : emailsSent) { boolean isEmailSentToThisInstructor = email.getFirstRecipient().equalsIgnoreCase(instructor.email); if (isEmailSentToThisInstructor) { emailsToInstructor.add(email); } } return emailsToInstructor; }
Source:
private void dropItem(CommandSender sender, String world, String x, String y, String z, SlimefunItem sfItem, String[] args) { if (sfItem instanceof MultiBlockMachine) { SlimefunPlugin.getLocalization().sendMessage(sender, "guide.cheat.no-multiblocks"); } else { int amount = parseAmount(args); if (amount > 0) { Bukkit.getWorld(world).dropItem(new Location(Bukkit.getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)), new CustomItem(sfItem.getItem(), amount)); SlimefunPlugin.getLocalization().sendMessage(sender, "messages.drop-item", true, msg -> msg.replace(PLACEHOLDER_WORLD, args[1]).replace(PLACEHOLDER_X, args[2]).replace(PLACEHOLDER_Y, args[3]).replace(PLACEHOLDER_Z, args[4]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); } } }

Target:
private void dropItem(CommandSender sender, String world, String x, String y, String z, SlimefunItem sfItem, String[] args) { if (sfItem instanceof MultiBlockMachine) { SlimefunPlugin.getLocalization().sendMessage(sender, "guide.cheat.no-multiblocks"); } else { int amount = parseAmount(args); if (amount > 0) { Bukkit.getWorld(world).dropItem(new Location(Bukkit.getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)), new CustomItem(sfItem.getItem(), amount)); SlimefunPlugin.getLocalization().sendMessage(sender, "messages.drop-item", true, msg -> msg.replace(PLACEHOLDER_WORLD, args[1]).replace(PLACEHOLDER_X, args[2]).replace(PLACEHOLDER_Y, args[3]).replace(PLACEHOLDER_Z, args[4]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.invalid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); } } }
Source:
public boolean pollSocketsInfo() { if (!isTcpInfoSupported()) return false; boolean result = false; FileDescriptor fd = null; try { long time = SystemClock.elapsedRealtime(); fd = connectToKernel(); mTcpStats.clear(); for (int family : ADDRESS_FAMILIES) { if (!sendPollingRequest(fd, family)) continue; StructNlMsgHdr nlmsghdr = new StructNlMsgHdr(); do { final ByteBuffer bytes = recvMesssage(fd); log("pollSocketsInfo: recv size=" + bytes.limit()); int curPos = 0; while (isValidNlMsg(bytes)) { nlmsghdr = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { final int cookiePos = curPos + SOCKDIAG_MSG_HEADER_SIZE - 2 * Integer.BYTES; final long cookie = getSocketCookie(bytes, cookiePos); bytes.position(cookiePos + 2 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, curPos, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); storeSocketInfo(cookie, info); } bytes.position(curPos + nlmsgLen); curPos = bytes.position(); } } while (nlmsghdr.nlmsg_type != NLMSG_DONE); } cleanupSocketInfo(time); result = true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return result; }

Target:
public boolean pollSocketsInfo() { if (!isTcpInfoSupported()) return false; FileDescriptor fd = null; try { final long time = SystemClock.elapsedRealtime(); fd = connectToKernel(); mTcpStats.clear(); for (final int family : ADDRESS_FAMILIES) { if (!sendPollingRequest(fd, family)) continue; final ByteBuffer bytes = recvMesssage(fd); log("pollSocketsInfo: recv size=" + bytes.limit()); while (enoughBytesRemainForValidNlMsg(bytes)) { StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { bytes.position(bytes.position() + StructInetDiagMsg.STRUCT_SIZE - 7 * Integer.BYTES); final long cookie = ((long) bytes.getInt() << 32) | (long) bytes.getInt(); bytes.position(bytes.position() + 5 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); mSocketInfos.put(cookie, info); } if (nlmsghdr.nlmsg_type == NLMSG_DONE) break; } } cleanupSocketInfo(time); return true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return false; }
Source:
public HostAssert host(String hostAddress) { int port = actual.getConfiguration().getProtocolOptions().getPort(); InetSocketAddress socketAddress = new InetSocketAddress(hostAddress, port); Host host = actual.getMetadata().getHost(socketAddress); return new HostAssert(host, actual); }

Target:
public HostAssert host(String hostAddress) { return new HostAssert( TestUtils.findHost(actual, hostAddress), actual); }
Source:
public List<Index> listIndices() { InputStream response = null; try { URI uri = new DatabaseURIHelper(db.getDBUri()).path("_index/").build(); response = client.couchDbClient.get(uri); return getResponseList(response, client.getGson(), new TypeToken<List<Index>>() { }.getType()); } finally { close(response); } }

Target:
public List<Index> listIndices() { InputStream response = null; try { URI uri = new DatabaseURIHelper(db.getDBUri()).path("_index").build(); response = client.couchDbClient.get(uri); return getResponseList(response, client.getGson(), new TypeToken<List<Index>>() { }.getType()); } finally { close(response); } }
Source:
public ResourceGroupConfigurationManager create(Map<String, String> config, ResourceGroupConfigurationManagerContext context) { try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) { Bootstrap app = new Bootstrap( new JsonModule(), new DbResourceGroupsModule(), binder -> binder.bind(ResourceGroupConfigurationManagerContext.class).toInstance(context), binder -> binder.bind(ClusterMemoryPoolManager.class).toInstance(context.getMemoryPoolManager())); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(DbResourceGroupConfigurationManager.class); } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public ResourceGroupConfigurationManager create(Map<String, String> config, ResourceGroupConfigurationManagerContext context) { try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) { Bootstrap app = new Bootstrap( new JsonModule(), new DbResourceGroupsModule(), binder -> binder.bind(String.class).annotatedWith(ForEnvironment.class).toInstance(context.getEnvironment()), binder -> binder.bind(ClusterMemoryPoolManager.class).toInstance(context.getMemoryPoolManager())); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(DbResourceGroupConfigurationManager.class); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public void setUp() throws IOException { MockitoAnnotations.initMocks(this); downloadDir = temp.newFolder(); when(updateCenterMatrixFactory.getUpdateCenter(anyBoolean())).thenReturn(Optional.of(updateCenter)); when(fs.getDownloadedEditionPluginsDir()).thenReturn(downloadDir); downloader = new EditionPluginDownloader(updateCenterMatrixFactory, httpDownloader, fs); }

Target:
public void setUp() throws IOException { MockitoAnnotations.initMocks(this); downloadDir = temp.newFolder(); when(updateCenterMatrixFactory.getUpdateCenter(anyBoolean())).thenReturn(Optional.of(updateCenter)); when(fs.getEditionDownloadedPluginsDir()).thenReturn(downloadDir); downloader = new EditionPluginDownloader(updateCenterMatrixFactory, httpDownloader, fs); }
Source:
public TmfRawEventViewer(Composite parent, int style) { super(parent, style & (~SWT.H_SCROLL) & (~SWT.V_SCROLL)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.horizontalSpacing = 0; gridLayout.verticalSpacing = 0; gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; setLayout(gridLayout); createTextArea(style & SWT.H_SCROLL); createSlider(style & SWT.V_SCROLL); setTabList(new Control[] { fScrolledComposite }); addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { if (fBottomContext != null) { fBottomContext.dispose(); } PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(TmfRawEventViewer.this); } }); }

Target:
public TmfRawEventViewer(Composite parent, int style) { super(parent, style & (~SWT.H_SCROLL) & (~SWT.V_SCROLL)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.horizontalSpacing = 0; gridLayout.verticalSpacing = 0; gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; setLayout(gridLayout); createTextArea(style & SWT.H_SCROLL); createSlider(style & SWT.V_SCROLL); setTabList(new Control[] { fScrolledComposite }); addDisposeListener((e) -> { if (fBottomContext != null) { fBottomContext.dispose(); } PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(TmfRawEventViewer.this); }); }
Source:
public boolean matches(Map<String, Construct> prefilter, BindableEvent e) throws PrefilterNonMatchException { if(e instanceof MCEntityTargetEvent){ MCEntityTargetEvent ple = (MCEntityTargetEvent) e; if (ple.getTarget() instanceof Player) { return true; } } return false; }

Target:
public boolean matches(Map<String, Construct> prefilter, BindableEvent e) throws PrefilterNonMatchException { if(e instanceof MCEntityTargetEvent){ MCEntityTargetEvent ete = (MCEntityTargetEvent) e; if (ete.getTarget() instanceof Player) { Prefilters.match(prefilter, "player", ((Player)ete.getTarget()).getName(), Prefilters.PrefilterType.MACRO); return true; } } return false; }
Source:
public void setup() throws Exception { super.setup(); KubernetesTestUtils.createTemporyFile("some data", flinkConfDir, "logback.xml"); KubernetesTestUtils.createTemporyFile("some data", flinkConfDir, "log4j.properties"); flinkConfig.set(KubernetesConfigOptionsInternal.ENTRY_POINT_CLASS, ENTRY_POINT_CLASS); flinkConfig.set(KubernetesConfigOptions.JOB_MANAGER_SERVICE_ACCOUNT, SERVICE_ACCOUNT_NAME); setHadoopConfDirEnv(); generateHadoopConfFileItems(); this.kubernetesJobManagerSpecification = KubernetesJobManagerFactory.createJobManagerComponent(kubernetesJobManagerParameters); }

Target:
public void setup() throws Exception { super.setup(); KubernetesTestUtils.createTemporyFile("some data", flinkConfDir, "logback.xml"); KubernetesTestUtils.createTemporyFile("some data", flinkConfDir, "log4j.properties"); flinkConfig.set(KubernetesConfigOptionsInternal.ENTRY_POINT_CLASS, ENTRY_POINT_CLASS); flinkConfig.set(KubernetesConfigOptions.JOB_MANAGER_SERVICE_ACCOUNT, SERVICE_ACCOUNT_NAME); this.kubernetesJobManagerSpecification = KubernetesJobManagerFactory.createJobManagerComponent(kubernetesJobManagerParameters); }