auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Iterable<String> createSinglyIterable(final List<String> values) { return new Iterable<String>() { private boolean isIteratorCreated = false; @Override public Iterator<String> iterator() { if (isIteratorCreated) throw new IllegalArgumentException("Cannot create two iterators on a singly-iterable sequence"); isIteratorCreated = true; return new Iterator<String>() { private final Iterator<String> l_it = values.iterator(); @Override public boolean hasNext() { return l_it.hasNext(); } @Override public String next() { return l_it.next(); } }; } }; }

Target:
private Iterable<String> createSinglyIterable(final List<String> values) { return new Iterable<String>() { private boolean isIteratorCreated = false; @Override public Iterator<String> iterator() { if (isIteratorCreated) throw new IllegalArgumentException("Cannot create two iterators on a singly-iterable sequence"); isIteratorCreated = true; return new Iterator<String>() { private final Iterator<String> listIterator = values.iterator(); @Override public boolean hasNext() { return listIterator.hasNext(); } @Override public String next() { return listIterator.next(); } }; } }; }
Source:
public AmbryRequests(StorageManager storageManager, RequestResponseChannel requestResponseChannel, ClusterMap clusterMap, DataNodeId nodeId, MetricRegistry registry, FindTokenFactory findTokenFactory, NotificationSystem operationNotification, ReplicationManager replicationManager, StoreKeyFactory storeKeyFactory) { this.storageManager = storageManager; this.requestResponseChannel = requestResponseChannel; this.clusterMap = clusterMap; this.currentNode = nodeId; this.metrics = new ServerMetrics(registry); this.messageFormatMetrics = new MessageFormatMetrics(registry); this.findTokenFactory = findTokenFactory; this.notification = operationNotification; this.replicationManager = replicationManager; this.storeKeyFactory = storeKeyFactory; requestsDisableInfo.put(RequestOrResponseType.PutRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.GetRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.DeleteRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.ReplicaMetadataRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); Set<PartitionId> partitionIds = new HashSet<>(); for (ReplicaId replicaId : clusterMap.getReplicaIds(currentNode)) { partitionIds.add(replicaId.getPartitionId()); } partitionsInCurrentNode = Collections.unmodifiableList(new ArrayList<>(partitionIds)); }

Target:
public AmbryRequests(StorageManager storageManager, RequestResponseChannel requestResponseChannel, ClusterMap clusterMap, DataNodeId nodeId, MetricRegistry registry, FindTokenFactory findTokenFactory, NotificationSystem operationNotification, ReplicationManager replicationManager, StoreKeyFactory storeKeyFactory) { this.storageManager = storageManager; this.requestResponseChannel = requestResponseChannel; this.clusterMap = clusterMap; this.currentNode = nodeId; this.metrics = new ServerMetrics(registry); this.messageFormatMetrics = new MessageFormatMetrics(registry); this.findTokenFactory = findTokenFactory; this.notification = operationNotification; this.replicationManager = replicationManager; this.storeKeyFactory = storeKeyFactory; requestsDisableInfo.put(RequestOrResponseType.PutRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.GetRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.DeleteRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); requestsDisableInfo.put(RequestOrResponseType.ReplicaMetadataRequest, Collections.newSetFromMap(new ConcurrentHashMap<>())); Set<PartitionId> partitionIds = new HashSet<>(); for (ReplicaId replicaId : clusterMap.getReplicaIds(currentNode)) { partitionIds.add(replicaId.getPartitionId()); } partitionsInCurrentNode = Collections.unmodifiableSet(partitionIds); }
Source:
private String describeNote() { return String.join("\n", this.notes); }

Target:
private String describeNote() { return String.join("\n", notes); }
Source:
void gc() { LOG.info("Starting garbage collecting ledger storage."); LOG.info("Garbage collecting deleted ledgers' index files."); doGcLedgers(); LOG.info("Scanning entry log files to extract metadata and delete empty entry logs if possible."); entryLogMetaMap = extractMetaFromEntryLogs(entryLogMetaMap); if (!running) { return; } LOG.info("Garbage collecting deleted ledgers' index files again just in case ledgers deleted during scanning."); doGcLedgers(); LOG.info("Garbage collecting empty entry log files."); doGcEntryLogs(); }

Target:
void gc() { LOG.debug("Starting garbage collecting ledger storage."); LOG.debug("Garbage collecting deleted ledgers' index files."); doGcLedgers(); Stopwatch scanStopwatch = new Stopwatch(); scanStopwatch.start(); LOG.debug("Scanning entry log files to extract metadata and delete empty entry logs if possible."); entryLogMetaMap = extractMetaFromEntryLogs(entryLogMetaMap); if (!running) { return; } long elapsedTimeOnScan = scanStopwatch.elapsedMillis(); if (elapsedTimeOnScan >= gcWaitTime) { LOG.debug("Garbage collecting deleted ledgers' index files again just in case ledgers deleted during scanning."); doGcLedgers(); } LOG.debug("Garbage collecting empty entry log files."); doGcEntryLogs(); }
Source:
public void downloadLanguagesFromServer() throws Exception { try { if (BuildConfig.downloadLanguagesFromServer) { Log.i(TAG, "Starting to download Languages From Server"); CredentialsReader credentialsReader = CredentialsReader.getInstance(); IConnectivityManager connectivity = NetworkManagerFactory.getConnectivityManager( activity); ISettingsRepository settingsRepository = new SettingsDataSource(activity); DownloadLanguageTranslationUseCase downloader = new DownloadLanguageTranslationUseCase(credentialsReader, connectivity, settingsRepository); downloader.download(); } } catch (Exception e) { Log.e(TAG, "Unable to download Languages From Server" + e.getMessage()); e.printStackTrace(); showToast(R.string.error_downloading_languages, e); } }

Target:
public void downloadLanguagesFromServer() throws Exception { try { if (BuildConfig.downloadLanguagesFromServer) { Log.i(TAG, "Starting to download Languages From Server"); CredentialsReader credentialsReader = CredentialsReader.getInstance(); IConnectivityManager connectivity = NetworkManagerFactory.getConnectivityManager( activity); DownloadLanguageTranslationUseCase downloader = new DownloadLanguageTranslationUseCase(credentialsReader, connectivity); downloader.download(); } } catch (Exception e) { Log.e(TAG, "Unable to download Languages From Server" + e.getMessage()); e.printStackTrace(); showToast(R.string.error_downloading_languages, e); } }
Source:
public LeaderElector getLeaderElector() { return null; }

Target:
public LeaderElector getLeaderElector() throws UnsupportedOperationException { return null; }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Pb("); sb.append((this.id & IProblem.IgnoreCategoriesMask)); sb.append(") "); if (this.message != null) { sb.append(this.message); } else { if (this.arguments != null) { for (int i = 0; i < this.arguments.length; i++) { sb.append(" "); sb.append(this.arguments[i]); } } } return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Pb("); sb.append(this.id & IProblem.IgnoreCategoriesMask); sb.append(") "); if (this.message != null) { sb.append(this.message); } else { if (this.arguments != null) { for (int i = 0; i < this.arguments.length; i++) { sb.append(" "); sb.append(this.arguments[i]); } } } return sb.toString(); }
Source:
public void should_cleanup_on_lbp_init_failure() { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .without(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER) .withClass( DefaultDriverOption.LOAD_BALANCING_POLICY_CLASS, DefaultLoadBalancingPolicy.class) .build(); assertThatThrownBy( () -> CqlSession.builder() .addContactEndPoints(SIMULACRON_RULE.getContactPoints()) .withConfigLoader(loader) .build()) .isInstanceOf(IllegalStateException.class) .hasMessageContaining( "Since you provided explicit contact points, the local DC must be explicitly set"); checkThat(() -> SIMULACRON_RULE.cluster().getConnections().getConnections().isEmpty()) .before(1, SECONDS) .becomesTrue(); }

Target:
public void should_cleanup_on_lbp_init_failure() { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .without(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER) .build(); assertThatThrownBy( () -> SessionUtils.baseBuilder() .addContactEndPoints(SIMULACRON_RULE.getContactPoints()) .withConfigLoader(loader) .build()) .isInstanceOf(IllegalStateException.class) .hasMessageContaining( "Since you provided explicit contact points, the local DC must be explicitly set"); checkThat(() -> SIMULACRON_RULE.cluster().getConnections().getConnections().isEmpty()) .before(1, SECONDS) .becomesTrue(); }
Source:
public void onDisconnectHandler(PlayerList this$0, ITextComponent component) { if (this.player.connection == null) { return; } final Player player = ((Player) this.player); final Text message = SpongeTexts.toText(component); final MessageChannel originalChannel = player.getMessageChannel(); final ClientConnectionEvent.Disconnect event = SpongeEventFactory.createClientConnectionEventDisconnect( Cause.of(NamedCause.source(player)), originalChannel, Optional.of(originalChannel), new MessageEvent.MessageFormatter(message), player, false ); SpongeImpl.postEvent(event); if (!event.isMessageCancelled()) { event.getChannel().ifPresent(channel -> channel.send(player, event.getMessage())); } ((MixinEntityPlayerMP) (Object) this.player).borderListener.onPlayerDisconnect(); }

Target:
public void onDisconnectHandler(PlayerList this$0, ITextComponent component) { if (this.player.connection == null) { return; } final Player player = ((Player) this.player); final Text message = SpongeTexts.toText(component); final MessageChannel originalChannel = player.getMessageChannel(); final ClientConnectionEvent.Disconnect event = SpongeEventFactory.createClientConnectionEventDisconnect( Cause.of(NamedCause.source(player)), originalChannel, Optional.of(originalChannel), new MessageEvent.MessageFormatter(message), player, false ); SpongeImpl.postEvent(event); if (!event.isMessageCancelled()) { event.getChannel().ifPresent(channel -> channel.send(player, event.getMessage())); } ((IMixinEntityPlayerMP) this.player).getWorldBorderListener().onPlayerDisconnect(); }
Source:
private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("bucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("bucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ds3Request.getRequiredQueryParams() != null) { for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) { break; } LOG.debug(" query param " + ds3Param.getType().toString()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); LOG.debug("param " + paramType + " is required."); requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } } return requiredArgsBuilder.build(); }

Target:
private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("bucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("object name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ds3Request.getRequiredQueryParams() != null) { for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) { break; } LOG.debug(" query param " + ds3Param.getType().toString()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); LOG.debug("param " + paramType + " is required."); requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } } return requiredArgsBuilder.build(); }
Source:
private Map<Class<?>, List<EntityInfo>> groupInfosByIdSpace(EntityInfo[] entityInfos, ObjectInitializationContext objectInitializationContext) { ServiceManager serviceManager = objectInitializationContext.getExtendedSearchintegrator().getServiceManager(); IdUniquenessResolver resolver = serviceManager.requestService( IdUniquenessResolver.class ); SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) objectInitializationContext.getSession().getSessionFactory(); try { Map<Class<?>, List<EntityInfo>> infosByIdSpace = new HashMap<>(); for ( EntityInfo entityInfo : entityInfos ) { boolean addedToExistingGroup = processEntityInfo( infosByIdSpace, resolver, entityInfo ); if ( !addedToExistingGroup ) { List<EntityInfo> infos = new ArrayList<>(); infos.add( entityInfo ); infosByIdSpace.put( getRootEntityType( sessionFactory, entityInfo.getClazz() ), infos ); } } return infosByIdSpace; } finally { serviceManager.releaseService( IdUniquenessResolver.class ); } }

Target:
private Map<Class<?>, List<EntityInfo>> groupInfosByIdSpace(EntityInfo[] entityInfos, ObjectInitializationContext objectInitializationContext) { ServiceManager serviceManager = objectInitializationContext.getExtendedSearchintegrator().getServiceManager(); IdUniquenessResolver resolver = serviceManager.requestService( IdUniquenessResolver.class ); SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) objectInitializationContext.getSession().getSessionFactory(); try { Map<Class<?>, List<EntityInfo>> idSpaces = new HashMap<>(); for ( EntityInfo entityInfo : entityInfos ) { addToIdSpace( idSpaces, entityInfo, resolver, sessionFactory ); } return idSpaces; } finally { serviceManager.releaseService( IdUniquenessResolver.class ); } }
Source:
public void blockingTimeout() { final FailoverFeignTarget spiedTarget = Mockito.spy(new FailoverFeignTarget<>( SERVERS, 1, Object.class)); for (int i = 0; i < CLUSTER_SIZE; i++) { spiedTarget.url(); spiedTarget.continueOrPropagate(EXCEPTION_WITH_RETRY_AFTER); } ArgumentCaptor<Long> argument = ArgumentCaptor.forClass(Long.class); verify(spiedTarget, times(CLUSTER_SIZE)).pauseForBackoff(any(), argument.capture()); List<Long> arguments = argument.getAllValues(); assertThat(arguments.size()).isEqualTo(CLUSTER_SIZE); for (int i = 0; i < CLUSTER_SIZE - 1; i++) { assertThat(arguments.get(i)).isEqualTo(1L); } assertThat(arguments.get(CLUSTER_SIZE - 1)).isEqualTo(1000L); }

Target:
public void blockingTimeout() { final FailoverFeignTarget spiedTarget = Mockito.spy(new FailoverFeignTarget<>( SERVERS, 1, Object.class)); for (int i = 0; i < CLUSTER_SIZE; i++) { spiedTarget.url(); spiedTarget.continueOrPropagate(EXCEPTION_WITH_RETRY_AFTER); } ArgumentCaptor<Long> argument = ArgumentCaptor.forClass(Long.class); verify(spiedTarget, times(CLUSTER_SIZE)).pauseForBackoff(any(), argument.capture()); List<Long> arguments = argument.getAllValues(); MatcherAssert.assertThat(arguments, Matchers.contains(1L, 1L, 500L)); }
Source:
public boolean shouldOverrideUrlLoading(WebView view, String url) { Uri uri = Uri.parse(url); if (arrivedAtRedirectUri(uri)) { final String error = uri.getQueryParameter("error"); if (error != null) { Timber.i("got oauth error: " + error); errorHandler.onError(error); requestHandler.onErrorWhenGettingOAuthCode(error); return true; } String oAuthCode = uri.getQueryParameter("code"); requestHandler.onOAuthCodeGot(oAuthCode); return true; } if (getOutOfDomain(uri)) { requestHandler.onErrorWhenGettingOAuthCode("Don't surf away"); return true; } return false; }

Target:
public boolean shouldOverrideUrlLoading(WebView view, String url) { Uri uri = Uri.parse(url); if (arrivedAtRedirectUri(uri)) { final String error = uri.getQueryParameter("error"); if (error != null) { Timber.e("got oauth error: " + error); errorHandler.onError(error); requestHandler.onErrorWhenGettingOAuthCode(error); return true; } String oAuthCode = uri.getQueryParameter("code"); requestHandler.onOAuthCodeGot(oAuthCode); return true; } if (getOutOfDomain(uri)) { requestHandler.onErrorWhenGettingOAuthCode("Don't surf away"); return true; } return false; }
Source:
public void close() throws IOException { if (mCachedDataReader.deRef() == 0) { try (LockResource lockResource = new LockResource( BLOCK_LOCKS[(int) (mBlockId % BLOCK_LOCKS.length)].writeLock())) { if (mCachedDataReader.getRefCount() == 0) { BLOCK_READERS.remove(mBlockId); } } if (mCachedDataReader.getRefCount() == 0) { mCachedDataReader.close(); } } }

Target:
public void close() throws IOException { if (mCachedDataReader.deRef() > 0) { return; } try (LockResource lockResource = new LockResource( getBlockLock(mBlockId).writeLock())) { if (mCachedDataReader.getRefCount() == 0) { BLOCK_READERS.remove(mBlockId); } } if (mCachedDataReader.getRefCount() == 0) { mCachedDataReader.close(); } }
Source:
private void startInvocation(IConfiguration config, IInvocationContext context, ITestInvocationListener listener) { if (mInvocationStarted) { return; } logStartInvocation(context, config); listener.invocationStarted(context); mInvocationStarted = true; }

Target:
private void startInvocation(IConfiguration config, IInvocationContext context, ITestInvocationListener listener) { logStartInvocation(context, config); listener.invocationStarted(context); }
Source:
public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { for (MapGenStructure struct : structures) { if (struct.getStructureName().equals(structureName)) { return struct.getNearestStructurePos(worldIn, position, findUnexplored); } } return null; }

Target:
public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { MapGenStructure structure = structureMap.get(structureName); if (structure != null) { return structure.getNearestStructurePos(worldIn, position, findUnexplored); } return null; }
Source:
public GitHubSCMSource(String repoOwner, String repository, String repositoryUrl, boolean configuredByUrl) { this(); if (!configuredByUrl) { this.setRepoOwner(repoOwner); this.setRepository(repository); } else { this.setRepositoryUrl(repositoryUrl); } }

Target:
public GitHubSCMSource(String repoOwner, String repository, String repositoryUrl, boolean configuredByUrl) { this(); if (configuredByUrl) { setRepositoryUrl(repositoryUrl); } else { setRepoOwner(repoOwner); setRepository(repository); } }
Source:
public synchronized void start() { if (enabled) return; FileWriter writer = fileWriter; if (writer != null) { try { writer.shutdown().get(); } catch (IgniteCheckedException e) { throw new IgniteException("Failed to wait for previous writer stopping.", e); } } assert fileWriter == null; try { File file = statisticsFile(ctx); U.delete(file); FileIO fileIo = fileIoFactory.create(file); fileIo.position(0); fileWriter = new FileWriter(ctx, fileIo, DFLT_FILE_MAX_SIZE, DFLT_BUFFER_SIZE, DFLT_FLUSH_SIZE, log); new IgniteThread(fileWriter).start(); enabled = true; log.info("Performance statistics writer started [file=" + file.getAbsolutePath() + ']'); } catch (IOException | IgniteCheckedException e) { log.error("Failed to start performance statistics writer.", e); throw new IgniteException("Failed to start performance statistics writer.", e); } }

Target:
public synchronized void start() { assert !started; new IgniteThread(fileWriter).start(); started = true; }
Source:
public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { prepare(0); ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }

Target:
public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { prepare(TIMEOUT_NO_RETRY); ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }
Source:
public void escapedEmphasis() { String html = parseToHtml("\\_foo bar_"); assertEquals(html,"<p>_foo bar_</p>\n"); }

Target:
public void escapedEmphasis() { String html = parseToHtml("\\_foo bar_"); assertEquals("<p>_foo bar_</p>\n", html); }
Source:
protected Message<?> createOutputMessage(Object output, MessageHeaders requestHeaders) { AbstractIntegrationMessageBuilder<?> builder = null; if (output instanceof Message<?>) { if (!shouldCopyRequestHeaders()) { return (Message<?>) output; } builder = this.getMessageBuilderFactory().fromMessage((Message<?>) output); } else if (output instanceof AbstractIntegrationMessageBuilder) { builder = (AbstractIntegrationMessageBuilder<?>) output; } else { builder = this.getMessageBuilderFactory().withPayload(output); } if (shouldCopyRequestHeaders()) { if (this.selectiveHeaderPropagation) { String[] patterns = this.notPropagatedHeaders.toArray(new String[this.notPropagatedHeaders.size()]); Map<String, Object> headersToCopy = new HashMap<>(requestHeaders); headersToCopy.entrySet() .removeIf(entry -> PatternMatchUtils.simpleMatch(patterns, entry.getKey())); builder.copyHeadersIfAbsent(headersToCopy); } else { builder.copyHeadersIfAbsent(requestHeaders); } } return builder.build(); }

Target:
protected Message<?> createOutputMessage(Object output, MessageHeaders requestHeaders) { AbstractIntegrationMessageBuilder<?> builder = null; if (output instanceof Message<?>) { if (this.noHeadersPropagation || !shouldCopyRequestHeaders()) { return (Message<?>) output; } builder = this.getMessageBuilderFactory().fromMessage((Message<?>) output); } else if (output instanceof AbstractIntegrationMessageBuilder) { builder = (AbstractIntegrationMessageBuilder<?>) output; } else { builder = this.getMessageBuilderFactory().withPayload(output); } if (!this.noHeadersPropagation && shouldCopyRequestHeaders()) { if (this.selectiveHeaderPropagation) { Map<String, Object> headersToCopy = new HashMap<>(requestHeaders); headersToCopy.entrySet() .removeIf(entry -> PatternMatchUtils.simpleMatch(this.notPropagatedHeaders, entry.getKey())); builder.copyHeadersIfAbsent(headersToCopy); } else { builder.copyHeadersIfAbsent(requestHeaders); } } return builder.build(); }
Source:
public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.error("An exception occurred", e); } } if (this.connMan.checkConnection()) { lastSceneCall = System.currentTimeMillis(); boolean requestSucsessfull = false; if (scene.getZoneID() == 0) { if (call_undo) { requestSucsessfull = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSucsessfull = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSucsessfull = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSucsessfull = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } logger.debug("scenecall sucsess?: " + requestSucsessfull); if (requestSucsessfull) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } }

Target:
public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (scene != null) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.error("An exception occurred", e); } } if (this.connMan.checkConnection()) { lastSceneCall = System.currentTimeMillis(); boolean requestSuccsessfull = false; if (scene.getZoneID() == 0) { if (call_undo) { logger.debug(scene.getGroupID() + " " + scene.getSceneID() + " " + ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); requestSuccsessfull = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSuccsessfull = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } logger.debug("Was the scene call succsessful?: " + requestSuccsessfull); if (requestSuccsessfull) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } } }
Source:
private void submit(@Nullable String email) { if (!NetworkUtil.isConnected(getContext())) { showError(getString(R.string.network_not_connected_short)); } else if (!InputValidationUtil.isValidEmail(email)) { showError(getString(R.string.error_invalid_email)); } else { setUiForInteraction(false); loadingIndicator.setVisibility(View.VISIBLE); resetCall = loginService.resetPassword(email); resetCall.enqueue(new ErrorHandlingCallback<ResetPasswordResponse>( getContext(), CallTrigger.USER_ACTION) { @Override protected void onResponse(@NonNull final ResetPasswordResponse result) { setUiForInteraction(true); final OnActivityResultListener listener = OnActivityResultListener.Util.getListener(getContext()); if (listener != null) { if (result.isSuccess()) { listener.onActivityResult(0, RESULT_OK, null); dismiss(); } else { final String errorMsg = result.getPrimaryReason(); final Intent data = new Intent(); data.putExtra("error", errorMsg); listener.onActivityResult(0, RESULT_FAILURE, data); showError(errorMsg); } } } @Override protected void onFailure(@NonNull Throwable error) { setUiForInteraction(true); final OnActivityResultListener listener = OnActivityResultListener.Util.getListener(getContext()); if (listener != null) { final String errorMsg = ErrorUtils.getErrorMessage(error, getContext()); final Intent data = new Intent(); data.putExtra("error", errorMsg); listener.onActivityResult(0, RESULT_FAILURE, data); showError(errorMsg); } } }); } }

Target:
private void submit(@Nullable String email) { if (!NetworkUtil.isConnected(getContext())) { showError(getString(R.string.network_not_connected_short)); } else if (!InputValidationUtil.isValidEmail(email)) { showError(getString(R.string.error_invalid_email)); } else { setUiForInteraction(false); binding.emailInputLayout.setError(null); resetCall = loginService.resetPassword(email); resetCall.enqueue(new ErrorHandlingCallback<ResetPasswordResponse>( getContext(), CallTrigger.USER_ACTION) { @Override protected void onResponse(@NonNull final ResetPasswordResponse result) { setUiForInteraction(true); if (result.isSuccess()) { OnActivityResultListener.Util.deliverResult( ResetPasswordDialogFragment.this, REQUEST_CODE, RESULT_OK, null); dismiss(); } else { final String errorMsg = result.getPrimaryReason(); showError(errorMsg); } } @Override protected void onFailure(@NonNull Throwable error) { setUiForInteraction(true); final String errorMsg = ErrorUtils.getErrorMessage(error, getContext()); showError(errorMsg); } }); } }
Source:
public static void scheduleTokenUpload(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context.getApplicationContext())); Job job = dispatcher.newJobBuilder() .setRecurring(false) .setReplaceCurrent(true) .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL) .setConstraints( Constraint.ON_ANY_NETWORK ) .setService(ParseFirebaseJobService.class) .setTag("upload-token") .build(); dispatcher.mustSchedule(job); }

Target:
public static void scheduleTokenUpload(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context.getApplicationContext())); Job job = dispatcher.newJobBuilder() .setRecurring(false) .setReplaceCurrent(true) .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL) .setConstraints( Constraint.ON_ANY_NETWORK ) .setService(ParseFirebaseJobService.class) .setTag(JOB_TAG_UPLOAD_TOKEN) .build(); dispatcher.mustSchedule(job); }
Source:
public BooleanWritable evaluate(Text uriHost, Text uriPath, Text uriQuery, Text httpStatus, Text contentType, Text userAgent) { boolean isPageview = Webrequest.isPageview(uriHost.toString(), uriPath.toString(), uriQuery.toString(), httpStatus.toString(), contentType.toString(), userAgent.toString()); return new BooleanWritable(isPageview); }

Target:
public BooleanWritable evaluate(Text uriHost, Text uriPath, Text uriQuery, Text httpStatus, Text contentType, Text userAgent) { boolean isPageview = NewPageviewsDef.isPageview(uriHost.toString(), uriPath.toString(), uriQuery.toString(), httpStatus.toString(), contentType.toString(), userAgent.toString()); return new BooleanWritable(isPageview); }
Source:
public void handleFragmentResponseMessage(FragmentResponseMessage message) { DuplicateCounter counter = m_duplicateCounters.get(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); m_repairLogTruncationHandle = message.getSpHandle(); FragmentResponseMessage resp = (FragmentResponseMessage)counter.getLastResponse(); resp.setExecutorSiteId(m_mailbox.getHSId()); m_mailbox.send(counter.m_destinationId, resp); if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { assert(m_bufferedReadLog != null); m_bufferedReadLog.releaseBufferedRead(m_repairLogTruncationHandle); } } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH running multi-part procedure.", true, null); } return; } TransactionState txn = m_outstandingTxns.get(message.getTxnId()); if (txn != null) { if (txn.isReadOnly()) { assert(m_isLeader); assert(m_bufferedReadLog != null); if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offerSp(message, m_repairLogTruncationHandle); return; } } else { if (m_isLeader && message.getSpHandle() > m_repairLogTruncationHandle) { m_repairLogTruncationHandle = message.getSpHandle(); } } } m_mailbox.send(message.getDestinationSiteId(), message); }

Target:
public void handleFragmentResponseMessage(FragmentResponseMessage message) { DuplicateCounter counter = m_duplicateCounters.get(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); final TransactionState txn = m_outstandingTxns.get(message.getTxnId()); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { if (txn != null && txn.isDone()) { setRepairLogTruncationHandle(txn.m_spHandle); } m_duplicateCounters.remove(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); FragmentResponseMessage resp = (FragmentResponseMessage)counter.getLastResponse(); resp.setExecutorSiteId(m_mailbox.getHSId()); m_mailbox.send(counter.m_destinationId, resp); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH running multi-part procedure.", true, null); } return; } else { if (txn == null) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offer(m_mailbox, message, m_repairLogTruncationHandle); return; } } else { if (txn.isReadOnly()) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offer(m_mailbox, message, m_repairLogTruncationHandle); return; } } else if (txn.isDone()) { setRepairLogTruncationHandle(txn.m_spHandle); } } } m_mailbox.send(message.getDestinationSiteId(), message); }
Source:
public void widgetSelected(@Nullable SelectionEvent e) { int selectedCell = getColumnIndex(); ISegment selectedSegment = ((ISegment) NonNullUtils.checkNotNull(e).item.getData()); if (selectedSegment == null) { return; } ITmfTimestamp start = new TmfNanoTimestamp(selectedSegment.getStart()); ITmfTimestamp end = new TmfNanoTimestamp(selectedSegment.getEnd()); TmfSelectionRangeUpdatedSignal signal; switch (selectedCell) { case 0: signal = new TmfSelectionRangeUpdatedSignal(this, start); break; case 1: signal = new TmfSelectionRangeUpdatedSignal(this, end, end); break; case 2: signal = new TmfSelectionRangeUpdatedSignal(this, start, end); break; default: return; } TmfSignalManager.dispatchSignal(signal); }

Target:
public void widgetSelected(@Nullable SelectionEvent e) { int selectedCell = getColumnIndex(); ISegment selectedSegment = ((ISegment) NonNullUtils.checkNotNull(e).item.getData()); if (selectedSegment == null) { return; } ITmfTimestamp start = new TmfNanoTimestamp(selectedSegment.getStart()); ITmfTimestamp end = new TmfNanoTimestamp(selectedSegment.getEnd()); TmfSelectionRangeUpdatedSignal signal; switch (selectedCell) { case START_TIME_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, start); break; case END_TIME_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, end, end); break; case DURATION_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, start, end); break; default: return; } TmfSignalManager.dispatchSignal(signal); }
Source:
public RealmAsyncTask makeOffer(PermissionOffer offer, final Callback<String> callback) { checkIfValidThread(); checkCallbackNotNull(callback); if (offer.isOfferCreated()) { throw new IllegalStateException("Offer is already created: " + offer); } return addTask(new MakeOfferAsyncTask(this, offer, callback)); }

Target:
public RealmAsyncTask makeOffer(PermissionOffer offer, final Callback<String> callback) { checkIfValidThread(); checkCallbackNotNull(callback); if (offer.isOfferCreated()) { throw new IllegalStateException("Offer has already been created: " + offer); } return addTask(new MakeOfferAsyncTask(this, offer, callback)); }
Source:
private String computeDigest() { StringBuilder buf = new StringBuilder("rule [" + getRule() + "] rels ["); for (int i = 0; i < rels.length; i++) { if (i > 0) { buf.append(", "); } buf.append("rel#").append(rels[i].getId()) .append(':').append(rels[i].getDigest()); } buf.append("]"); return buf.toString(); }

Target:
private String computeDigest() { StringBuilder buf = new StringBuilder("rule [" + getRule() + "] rels ["); for (int i = 0; i < rels.length; i++) { if (i > 0) { buf.append(", "); } RelOptUtil.appendRelDescription(buf, rels[i]); } buf.append("]"); return buf.toString(); }
Source:
public void testGetStorages() throws Exception { String url = getContextBaseUrl() + BrowseController.ROOT_CONTEXT; String storages = given().contentType(MediaType.APPLICATION_JSON_VALUE) .when() .get(url) .prettyPeek() .asString(); DirectoryContent returned = new ObjectMapper() .readValue(storages, DirectoryContent.class); assertNotNull("Failed to get storage list!", returned); assertNotNull("Failed to get storage list!", returned.getDirectories()); assertFalse("Returned storage size does not match", returned.getDirectories().isEmpty()); for(int i=0; i<returned.getDirectories().size(); i++) logger.debug(returned.getDirectories().get(i).getName()); }

Target:
public void testGetStorages() throws Exception { String url = getContextBaseUrl() + BrowseController.ROOT_CONTEXT; String storages = given().accept(MediaType.APPLICATION_JSON_VALUE) .when() .get(url) .prettyPeek() .asString(); DirectoryContent returned = new ObjectMapper() .readValue(storages, DirectoryContent.class); assertNotNull("Failed to get storage list!", returned); assertNotNull("Failed to get storage list!", returned.getDirectories()); assertFalse("Returned storage size does not match", returned.getDirectories().isEmpty()); String responseBody = given().accept(MediaType.TEXT_HTML_VALUE) .when() .get(url + "/") .prettyPeek() .then() .statusCode(200) .and() .extract() .asString(); assertTrue("Returned HTML is incorrect", responseBody.contains("storage0")); }
Source:
public Result link(String target) throws IOException { if (!target.startsWith(Constants.R_REFS)) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().illegalArgumentNotA, Constants.R_REFS)); if (checkConflicting && getRefDatabase().isNameConflicting(getName())) return Result.LOCK_FAILURE; try { if (!tryLock(false)) return Result.LOCK_FAILURE; final Ref old = getRefDatabase().findRef(getName()); if (old != null && old.isSymbolic()) { final Ref dst = old.getTarget(); if (target.equals(dst.getName())) return result = Result.NO_CHANGE; } if (old != null && old.getObjectId() != null) setOldObjectId(old.getObjectId()); final Ref dst = getRefDatabase().findRef(target); if (dst != null && dst.getObjectId() != null) setNewObjectId(dst.getObjectId()); return result = doLink(target); } catch (IOException x) { result = Result.IO_FAILURE; throw x; } finally { unlock(); } }

Target:
public Result link(String target) throws IOException { if (!target.startsWith(Constants.R_REFS)) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().illegalArgumentNotA, Constants.R_REFS)); if (checkConflicting && getRefDatabase().isNameConflicting(getName())) return Result.LOCK_FAILURE; try { if (!tryLock(false)) return Result.LOCK_FAILURE; final Ref old = getRefDatabase().exactRef(getName()); if (old != null && old.isSymbolic()) { final Ref dst = old.getTarget(); if (target.equals(dst.getName())) return result = Result.NO_CHANGE; } if (old != null && old.getObjectId() != null) setOldObjectId(old.getObjectId()); final Ref dst = getRefDatabase().exactRef(target); if (dst != null && dst.getObjectId() != null) setNewObjectId(dst.getObjectId()); return result = doLink(target); } catch (IOException x) { result = Result.IO_FAILURE; throw x; } finally { unlock(); } }
Source:
private DatastreamProducerRecord translate(ConsumerRecord<byte[], byte[]> fromKafka, long readTime, String strReadTime) { DatastreamEvent event = new DatastreamEvent(); event.key = ByteBuffer.wrap(fromKafka.key()); event.payload = ByteBuffer.wrap(fromKafka.value()); event.previous_payload = null; event.metadata = new HashMap<>(); event.metadata.put("kafka-origin", _srcValue); String partitionStr = String.valueOf(fromKafka.partition()); event.metadata.put("kafka-origin-partition", partitionStr); String offsetStr = String.valueOf(fromKafka.offset()); event.metadata.put("kafka-origin-offset", offsetStr); event.metadata.put(DatastreamEventMetadata.EVENT_TIMESTAMP, strReadTime); DatastreamProducerRecordBuilder builder = new DatastreamProducerRecordBuilder(); builder.addEvent(event); builder.setEventsSourceTimestamp(readTime); if (!_task.isUserManagedDestination()) { builder.setPartition(0); } builder.setSourceCheckpoint(partitionStr + "-" + offsetStr); return builder.build(); }

Target:
private DatastreamProducerRecord translate(ConsumerRecord<byte[], byte[]> fromKafka, long readTime, String strReadTime) { DatastreamEvent event = new DatastreamEvent(); event.key = ByteBuffer.wrap(fromKafka.key()); event.payload = ByteBuffer.wrap(fromKafka.value()); event.previous_payload = null; event.metadata = new HashMap<>(); event.metadata.put("kafka-origin", _srcValue); int partition = fromKafka.partition(); String partitionStr = String.valueOf(partition); event.metadata.put("kafka-origin-partition", partitionStr); String offsetStr = String.valueOf(fromKafka.offset()); event.metadata.put("kafka-origin-offset", offsetStr); event.metadata.put(DatastreamEventMetadata.EVENT_TIMESTAMP, strReadTime); DatastreamProducerRecordBuilder builder = new DatastreamProducerRecordBuilder(); builder.addEvent(event); builder.setEventsSourceTimestamp(readTime); builder.setPartition(partition); builder.setSourceCheckpoint(partitionStr + "-" + offsetStr); return builder.build(); }
Source:
public boolean upgradeCasIfRequired(Iterable<CAS> aCasIter, Project aProject) throws UIMAException, IOException { TypeSystemDescription ts = getFullProjectTypeSystem(aProject); boolean upgradePerformed = false; for (CAS cas : aCasIter) { if (cas != null && isUpgradeRequired(cas, ts)) { CasStorageSession.get().assertWritingPermitted(cas); upgradeCas(cas, ts); upgradePerformed = true; } } return upgradePerformed; }

Target:
public boolean upgradeCasIfRequired(Iterable<CAS> aCasIter, Project aProject) throws UIMAException, IOException { TypeSystemDescription ts = getFullProjectTypeSystem(aProject); boolean upgradePerformed = false; nextCas: for (CAS cas : aCasIter) { if (cas == null) { continue nextCas; } CasStorageSession.get().assertWritingPermitted(cas); if (isUpgradeRequired(cas, ts)) { upgradeCas(cas, ts); upgradePerformed = true; } } return upgradePerformed; }
Source:
public void plannerSolverFactoryTest() throws IOException { InputStream stream = this.getClass().getResourceAsStream(CLOUD_BALANCE_INCREMENTAL_CONFIG_FILE); SolverFactory solverFactory = SolverFactory .createFromXmlInputStream(stream, PlannerCloudBalanceIntegrationTest.class.getClassLoader()); stream.close(); CloudBalance cloudBalance = cloudBalanceGeneratorForFuse(10, 20, 0); Assert.assertEquals(cloudBalance.getScore().getHardScore(), Integer.MIN_VALUE); Assert.assertEquals(cloudBalance.getScore().getSoftScore(), Integer.MIN_VALUE); Solver solver = solverFactory.getSolverConfig().buildSolver(new SolverConfigContext()); solver.solve(cloudBalance); CloudBalance solution = (CloudBalance) solver.getBestSolution(); Assert.assertNotEquals(solution.getScore().getHardScore(), Integer.MIN_VALUE); Assert.assertNotEquals(solution.getScore().getSoftScore(), Integer.MIN_VALUE); }

Target:
public void plannerSolverFactoryTest() throws IOException { solveUsingSolverFactory(CLOUD_BALANCE_INCREMENTAL_CONFIG_FILE); }
Source:
private void downloadFile(URI uri, Path dst) { urlMangling.put(goGoDuckConfig.getUrlSubstitutionKey(), goGoDuckConfig.getUrlSubstitutionValue()); URLMangler.setUrlManglingMap(urlMangling); URL url = URLMangler.mangle(uri); logger.info(String.format("Downloading '%s' -> '%s'", url.toString(), dst)); try { ReadableByteChannel rbc = Channels.newChannel(url.openStream()); FileOutputStream fos = new FileOutputStream(dst.toFile()); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } catch (IOException e) { userLog.log(String.format("Failed downloading '%s'", url)); throw new GoGoDuckException(e.getMessage()); } }

Target:
private void downloadFile(URI uri, Path dst) { URL url = urlMangler.mangle(uri); logger.info(String.format("Downloading '%s' -> '%s'", url.toString(), dst)); try { ReadableByteChannel rbc = Channels.newChannel(url.openStream()); FileOutputStream fos = new FileOutputStream(dst.toFile()); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } catch (IOException e) { userLog.log(String.format("Failed downloading '%s'", url)); throw new GoGoDuckException(e.getMessage()); } }
Source:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); return false; } if (glusterVolume.getAsyncTask() == null || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }

Target:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); return false; } if (glusterVolume.getAsyncTask() == null || glusterVolume.getAsyncTask().getType() != GlusterTaskType.REBALANCE_VOLUME || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }
Source:
private void filterMilestones(String query) { currentMilestonesList.stream() .forEach(milestone -> { boolean matchQuery = Utility.containsIgnoreCase(milestone.getTitle(), query); milestone.setFaded(!matchQuery); }); if (hasExactlyOneMatchingMilestone(currentMilestonesList, query)) highlightAnyMatchingMilestone(); }

Target:
private void filterMilestones(String query) { currentMilestonesList .forEach(milestone -> { boolean matchQuery = Utility.containsIgnoreCase(milestone.getTitle(), query); if (!milestone.isMatching()) milestone.setMatching(!matchQuery); }); }
Source:
public boolean getIsUsable( final ItemStack stack, Entity holder ) { if( stack.hasTagCompound() ) { final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { boolean usable = ( this.hasPower( null, 0.5, stack ) && ToolWirelessTerminal.isLinked( stack ) ); if( usable ) { final long parsedKey = Long.parseLong( this.getEncryptionKey( stack ) ); final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy( parsedKey ); if( securityStation == null ) { usable = false; } } if( usable ) { usable = ((ToolWirelessTerminal)stack.getItem()).rangeCheck( stack, holder ); } return usable; } } return false; }

Target:
public boolean getIsUsable( final ItemStack stack, Entity holder ) { if( stack.hasTagCompound() ) { final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { boolean usable = this.hasPower( null, 0.5, stack ) && ToolWirelessTerminal.isLinked( stack ); if( usable ) { final long parsedKey = Long.parseLong( this.getEncryptionKey( stack ) ); final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy( parsedKey ); if( securityStation == null ) { usable = false; } } if( usable ) { usable = rangeCheck( stack, holder ); } return usable; } } return false; }
Source:
public Set<String> filterDistributorEntitlementIds(Iterable<String> entsIdsToFilter) { Set<String> filteredIds = new HashSet<String>(); if (entsIdsToFilter != null && entsIdsToFilter.iterator().hasNext()) { String querySql = "SELECT DISTINCT e.id " + "FROM Entitlement e JOIN e.consumer c JOIN c.type t " + "WHERE t.manifest = true AND e.id IN (:entitlement_ids)"; Query query = this.getEntityManager().createQuery(querySql); int blockSize = Math.min(this.getInBlockSize(), this.getQueryParameterLimit() / 2); for (List<String> block : Iterables.partition(entsIdsToFilter, blockSize)) { query.setParameter("entitlement_ids", block); filteredIds.addAll(query.getResultList()); } } return filteredIds; }

Target:
public Set<String> filterDistributorEntitlementIds(Iterable<String> entsIdsToFilter) { Set<String> filteredIds = new HashSet<String>(); if (entsIdsToFilter != null && entsIdsToFilter.iterator().hasNext()) { String querySql = "SELECT DISTINCT e.id " + "FROM Entitlement e JOIN e.consumer c JOIN c.type t " + "WHERE t.manifest = true AND e.id IN (:entitlement_ids)"; Query query = this.getEntityManager().createQuery(querySql); int blockSize = Math.min(this.getInBlockSize(), this.getQueryParameterLimit()); for (List<String> block : Iterables.partition(entsIdsToFilter, blockSize)) { query.setParameter("entitlement_ids", block); filteredIds.addAll(query.getResultList()); } } return filteredIds; }
Source:
private CSIIndex(final IndexFileBuffer indexFileBuffer, final String source, final SAMSequenceDictionary dictionary) { super(indexFileBuffer, dictionary); verifyCSIMagicNumber(source); readMinShiftAndBinDepth(); readAuxDataAndNRef(); setSequenceIndexes(getNumberOfReferences()); }

Target:
private CSIIndex(final IndexFileBuffer indexFileBuffer, final String source, final SAMSequenceDictionary dictionary) { super(indexFileBuffer, source, dictionary); }