auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void connect() { Controller[] controllers; while (true) { controllers = Joysticks.availableControllers(); for (Controller c : controllers) { if (Pattern.matches(NAME, c.getName())) { this.jsController.onNext(new LogitechExtremeJoystick( createEvents(c), createAxes(c), createButtons(c))); return; } } } }

Target:
private Controller connect() { final Controller[] controllers = Joysticks.availableControllers(); for (Controller c : controllers) { if (Pattern.matches(NAME, c.getName())) { return c; } } return null; }
Source:
public void testOvfDataUpdaterPartOfVmsAndTemplatesAreLocked() { int size = ITEMS_COUNT_PER_UPDATE; List<Guid> vmGuids = generateGuidList(size); List<Guid> removedGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); addVms(vmGuids, 2, VMStatus.ImageLocked, ImageStatus.OK); addTemplates(templatesGuids, 2, VmTemplateStatus.Locked, ImageStatus.OK); List<Guid> vmGuidsUnlocked = generateGuidList(size); List<Guid> templatesGuidsUnlocked = generateGuidList(size); addVms(vmGuidsUnlocked, 2, VMStatus.Down, ImageStatus.OK); addTemplates(templatesGuidsUnlocked, 2, VmTemplateStatus.OK, ImageStatus.OK); vmGuids.addAll(vmGuidsUnlocked); templatesGuids.addAll(templatesGuidsUnlocked); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); updater.ovfUpdate_timer(); List<Guid> neededToBeUpdated = new LinkedList<Guid>(vmGuidsUnlocked); neededToBeUpdated.addAll(templatesGuidsUnlocked); verify(updater, times(numberOfTimesToBeCalled(size, true))).performOvfUpdate(any(Guid.class), any(Map.class)); verify(updater, times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); verifyCorrectOvfDataUpdaterRun(pool1.getId(), neededToBeUpdated, removedGuids); }

Target:
public void testOvfDataUpdaterPartOfVmsAndTemplatesAreLocked() { int size = ITEMS_COUNT_PER_UPDATE; List<Guid> vmGuids = generateGuidList(size); List<Guid> removedGuids = generateGuidList(size); List<Guid> templatesGuids = generateGuidList(size); addVms(vmGuids, 2, VMStatus.ImageLocked, ImageStatus.OK); addTemplates(templatesGuids, 2, VmTemplateStatus.Locked, ImageStatus.OK); List<Guid> vmGuidsUnlocked = generateGuidList(size); List<Guid> templatesGuidsUnlocked = generateGuidList(size); addVms(vmGuidsUnlocked, 2, VMStatus.Down, ImageStatus.OK); addTemplates(templatesGuidsUnlocked, 2, VmTemplateStatus.OK, ImageStatus.OK); vmGuids.addAll(vmGuidsUnlocked); templatesGuids.addAll(templatesGuidsUnlocked); initTestForPool(pool1.getId(), vmGuids, templatesGuids, removedGuids); updater.ovfUpdate_timer(); List<Guid> neededToBeUpdated = new LinkedList<Guid>(vmGuidsUnlocked); neededToBeUpdated.addAll(templatesGuidsUnlocked); verify(updater, times(numberOfTimesToBeCalled(size, true))).performOvfUpdate(any(Guid.class), anyMap()); verify(updater, times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), any(Guid.class)); verifyCorrectOvfDataUpdaterRun(pool1.getId(), neededToBeUpdated, removedGuids); }
Source:
HermesConsumers(HooksHandler hooksHandler, List<Binder> binders, MultiMap<String, Function<ServiceLocator, ProtocolMessageSenderProvider>> messageSenderProvidersSuppliers, List<Function<ServiceLocator, LogRepository>> logRepositories, boolean flushLogsShutdownHookEnabled) { this.hooksHandler = hooksHandler; this.messageSenderProvidersSuppliers = messageSenderProvidersSuppliers; this.logRepositories = logRepositories; serviceLocator = createDIContainer(binders); trackers = serviceLocator.getService(Trackers.class); consumerHttpServer = serviceLocator.getService(ConsumerHttpServer.class); messageSenderFactory = serviceLocator.getService(MessageSenderFactory.class); supervisorController = serviceLocator.getService(SupervisorController.class); maxRateSupervisor = serviceLocator.getService(MaxRateSupervisor.class); assignmentCache = serviceLocator.getService(SubscriptionAssignmentCache.class); oAuthHttpClient = serviceLocator.getService(OAuthClient.class); HttpClientsWorkloadReporter httpClientsWorkloadReporter = serviceLocator.getService(HttpClientsWorkloadReporter.class); httpClientsWorkloadReporter.registerMetrics(); hooksHandler.addShutdownHook((s) -> { try { consumerHttpServer.stop(); maxRateSupervisor.stop(); assignmentCache.stop(); oAuthHttpClient.stop(); supervisorController.shutdown(); s.shutdown(); } catch (Exception e) { logger.error("Exception while shutdown Hermes Consumers", e); } }); if (flushLogsShutdownHookEnabled) { hooksHandler.addShutdownHook(new FlushLogsShutdownHook()); } }

Target:
HermesConsumers(HooksHandler hooksHandler, List<Binder> binders, MultiMap<String, Function<ServiceLocator, ProtocolMessageSenderProvider>> messageSenderProvidersSuppliers, List<Function<ServiceLocator, LogRepository>> logRepositories, boolean flushLogsShutdownHookEnabled) { this.hooksHandler = hooksHandler; this.messageSenderProvidersSuppliers = messageSenderProvidersSuppliers; this.logRepositories = logRepositories; serviceLocator = createDIContainer(binders); trackers = serviceLocator.getService(Trackers.class); consumerHttpServer = serviceLocator.getService(ConsumerHttpServer.class); messageSenderFactory = serviceLocator.getService(MessageSenderFactory.class); consumerNodesRegistry = serviceLocator.getService(ConsumerNodesRegistry.class); supervisorController = serviceLocator.getService(SupervisorController.class); maxRateSupervisor = serviceLocator.getService(MaxRateSupervisor.class); assignmentCache = serviceLocator.getService(ConsumerAssignmentCache.class); oAuthHttpClient = serviceLocator.getService(OAuthClient.class); httpClientsWorkloadReporter = serviceLocator.getService(HttpClientsWorkloadReporter.class); hooksHandler.addShutdownHook((s) -> { try { consumerHttpServer.stop(); maxRateSupervisor.stop(); assignmentCache.stop(); oAuthHttpClient.stop(); consumerNodesRegistry.stop(); supervisorController.shutdown(); s.shutdown(); } catch (Exception e) { logger.error("Exception while shutdown Hermes Consumers", e); } }); if (flushLogsShutdownHookEnabled) { hooksHandler.addShutdownHook(new FlushLogsShutdownHook()); } }
Source:
public void addBasedir(File basedir) throws IOException { if (!basedir.exists()) { log.info("Project does not exist at " + basedir); return; } if (basedir.isFile()) { if (!MutablePomFile.POM_XML.equals(basedir.getName())) { log.info("Custom pom.xml file name is not supported at " + basedir); return; } basedir = basedir.getParentFile(); } if (projects.containsKey(basedir)) { return; } ProjectMetadata project = new ProjectMetadata(basedir); projects.put(basedir, project); File pomFile = new File(basedir, MutablePomFile.POM_XML); if (!pomFile.exists()) { pomFile = new File(basedir, ".polyglot.build.properties"); } if (!pomFile.exists()) { log.info("No pom file found at " + basedir); return; } MutablePomFile pom = MutablePomFile.read(pomFile); project.putMetadata(pom); String packaging = pom.getPackaging(); if (PACKAGING_POM.equals(packaging)) { for (File child : getChildren(basedir, pom)) { addBasedir(child); } } }

Target:
public void addBasedir(File basedir) throws IOException { if (!basedir.exists()) { log.info("Project does not exist at " + basedir); return; } if (basedir.isFile()) { if (!PomFile.POM_XML.equals(basedir.getName())) { log.info("Custom pom.xml file name is not supported at " + basedir); return; } basedir = basedir.getParentFile(); } if (projects.containsKey(basedir)) { return; } ProjectMetadata project = new ProjectMetadata(basedir); projects.put(basedir, project); File pomFile = new File(basedir, PomFile.POM_XML); if (!pomFile.exists()) { pomFile = new File(basedir, PomFile.POLYGLOT_POM_XML); } if (!pomFile.exists()) { log.info("No pom file found at " + basedir); return; } PomFile pom = PomFile.read(pomFile, PomFile.POM_XML.equals(pomFile.getName())); project.putMetadata(pom); String packaging = pom.getPackaging(); if (PACKAGING_POM.equals(packaging)) { for (File child : getChildren(basedir, pom)) { addBasedir(child); } } }
Source:
RSocketServer( DuplexConnection connection, RSocket requestHandler, Function<Frame, ? extends Payload> frameDecoder, Consumer<Throwable> errorConsumer, long tickPeriod, long ackTimeout) { if (requestHandler instanceof RequestHandler) { this.optimizedRequestHandler = (RequestHandler) requestHandler; this.hasOptimizedRequestHandler = true; this.requestHandler = null; } else { this.hasOptimizedRequestHandler = false; this.requestHandler = requestHandler; this.optimizedRequestHandler = null; } this.connection = connection; this.frameDecoder = frameDecoder; this.errorConsumer = errorConsumer; this.sendingSubscriptions = Collections.synchronizedMap(new IntObjectHashMap<>()); this.channelProcessors = Collections.synchronizedMap(new IntObjectHashMap<>()); this.sendProcessor = new UnboundedProcessor<>(); connection .send(sendProcessor) .doFinally(this::handleSendProcessorCancel) .subscribe(null, this::handleSendProcessorError); Disposable receiveDisposable = connection.receive().subscribe(this::handleFrame, errorConsumer); this.connection .onClose() .doFinally( s -> { cleanup(); receiveDisposable.dispose(); }) .subscribe(null, errorConsumer); if (tickPeriod != 0) { keepAliveHandler = KeepAliveHandler.ofServer(new KeepAliveHandler.KeepAlive(tickPeriod, ackTimeout)); keepAliveHandler .timeout() .subscribe( keepAlive -> { String message = String.format("No keep-alive acks for %d ms", keepAlive.getTimeoutMillis()); errorConsumer.accept(new ConnectionErrorException(message)); connection.dispose(); }); keepAliveHandler.send().subscribe(sendProcessor::onNext); } else { keepAliveHandler = null; } }

Target:
RSocketServer( DuplexConnection connection, RSocket requestHandler, Function<Frame, ? extends Payload> frameDecoder, Consumer<Throwable> errorConsumer, long tickPeriod, long ackTimeout) { this.requestHandler = requestHandler; this.responderRSocket = (requestHandler instanceof ResponderRSocket) ? (ResponderRSocket) requestHandler : null; this.connection = connection; this.frameDecoder = frameDecoder; this.errorConsumer = errorConsumer; this.sendingSubscriptions = Collections.synchronizedMap(new IntObjectHashMap<>()); this.channelProcessors = Collections.synchronizedMap(new IntObjectHashMap<>()); this.sendProcessor = new UnboundedProcessor<>(); connection .send(sendProcessor) .doFinally(this::handleSendProcessorCancel) .subscribe(null, this::handleSendProcessorError); Disposable receiveDisposable = connection.receive().subscribe(this::handleFrame, errorConsumer); this.connection .onClose() .doFinally( s -> { cleanup(); receiveDisposable.dispose(); }) .subscribe(null, errorConsumer); if (tickPeriod != 0) { keepAliveHandler = KeepAliveHandler.ofServer(new KeepAliveHandler.KeepAlive(tickPeriod, ackTimeout)); keepAliveHandler .timeout() .subscribe( keepAlive -> { String message = String.format("No keep-alive acks for %d ms", keepAlive.getTimeoutMillis()); errorConsumer.accept(new ConnectionErrorException(message)); connection.dispose(); }); keepAliveHandler.send().subscribe(sendProcessor::onNext); } else { keepAliveHandler = null; } }
Source:
public static boolean shouldAnimateFormSubmitButton() { SharedPreferences properties = CommCareApplication._().getCurrentApp().getAppPreferences(); return properties.getString(ANIMATE_FORM_SUBMIT_BUTTON, CommCarePreferences.YES).equals(CommCarePreferences.YES); }

Target:
public static boolean shouldAnimateFormSubmitButton() { SharedPreferences properties = CommCareApplication._().getCurrentApp().getAppPreferences(); return properties.getString(ANIMATE_FORM_SUBMIT_BUTTON, CommCarePreferences.NO).equals(CommCarePreferences.YES); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ParseUser.logOut(); if (ParseUser.getCurrentUser() == null) { startActivity(new Intent(this, SignUpOrLogInActivity.class)); } else { startActivity(new Intent(this, PersistToCloudActivity.class)); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if (ParseUser.getCurrentUser() == null) { startActivity(new Intent(this, SignUpOrLogInActivity.class)); } else { startActivity(new Intent(this, PersistToCloudActivity.class)); } }
Source:
public InfluxDB enableBatch(final int flushActions, final int flushIntervalMin, final int flushIntervalMax, final TimeUnit flushIntervalTimeUnit) { enableBatch(0, flushActions, flushIntervalMin, flushIntervalMax, flushIntervalTimeUnit, BufferFailBehaviour.THROW_EXCEPTION, true, flushActions); return this; }

Target:
public InfluxDB enableBatch(final int flushActions, final int flushIntervalMin, final int flushIntervalMax, final TimeUnit flushIntervalTimeUnit) { enableBatch(null, flushActions, flushIntervalMin, flushIntervalMax, flushIntervalTimeUnit, BufferFailBehaviour.THROW_EXCEPTION, true, flushActions); return this; }
Source:
public double getArmorRemainingPercent() { if (getPosition() == null) { return 1.0; } Building occupiedStructure = getGame().getBoard().getBuildingAt(getPosition()); if ((occupiedStructure == null) || (initialBuildingCF + initialBuildingArmor == 0)) { return 1.0; } return (1.0 * (occupiedStructure.getCurrentCF(getPosition()) + occupiedStructure.getArmor(getPosition()))) / (initialBuildingCF + initialBuildingArmor); }

Target:
public double getArmorRemainingPercent() { if (getPosition() == null) { return 1.0; } Building occupiedStructure = getGame().getBoard().getBuildingAt(getPosition()); if ((occupiedStructure == null) || (initialBuildingCF + initialBuildingArmor == 0)) { return 1.0; } return (occupiedStructure.getCurrentCF(getPosition()) + occupiedStructure.getArmor(getPosition())) / ((double) (initialBuildingCF + initialBuildingArmor)); }
Source:
private void checkReportsWebAppStatus() { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, "/" + BaseContextPathData.getInstance().getRelativePath() + "services/reports-status"); try { requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { if (response.getStatusCode() == Response.SC_OK && response.getText().trim().equals(REPORTS_WEBAPP_DEPLOYED_MSG)) { reportsWebappDeployed = true; parseReportsXML(); } } }); } catch (RequestException e) { setXmlInitialized(); } }

Target:
private void checkReportsWebAppStatus() { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, "/" + BaseContextPathData.getInstance().getRelativePath() + "services/reports-status"); try { requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { if (response.getStatusCode() == Response.SC_OK) { reportsWebappDeployed = true; parseReportsXML(); } } }); } catch (RequestException e) { setXmlInitialized(); } }
Source:
private Results analyzeRawContext(final WebDriver webDriver, final Object rawContextArg, boolean injectAxe) { validateNotNullParameter(webDriver); String rawOptionsArg = getOptions().equals("{}") ? AxeReporter.serialize(runOptions) : getOptions(); Object[] rawArgs = new Object[] {rawContextArg, rawOptionsArg}; if (injectAxe) { try { WebDriverInjectorExtensions.inject( webDriver, builderOptions.getScriptProvider()); } catch (IOException e) { throw new RuntimeException("Unable to inject axe script", e); } catch (OperationNotSupportedException e) { throw new RuntimeException("Unable to inject axe script", e); } } webDriver.manage().timeouts() .setScriptTimeout(timeout, TimeUnit.SECONDS); Object response = ((JavascriptExecutor) webDriver) .executeAsyncScript(axeRunScript, rawArgs); Results results = objectMapper.convertValue(response, Results.class); return results; }

Target:
private Results analyzeRawContext(final WebDriver webDriver, final Object rawContextArg, boolean injectAxe) { validateNotNullParameter(webDriver); String rawOptionsArg = getOptions().equals("{}") ? AxeReporter.serialize(runOptions) : getOptions(); Object[] rawArgs = new Object[] {rawContextArg, rawOptionsArg}; if (injectAxe) { try { WebDriverInjectorExtensions.inject( webDriver, builderOptions.getScriptProvider()); } catch (Exception e) { throw new RuntimeException("Unable to inject axe script", e); } } webDriver.manage().timeouts() .setScriptTimeout(timeout, TimeUnit.SECONDS); Object response = ((JavascriptExecutor) webDriver) .executeAsyncScript(axeRunScript, rawArgs); Results results = objectMapper.convertValue(response, Results.class); return results; }
Source:
public void run() throws Exception { String cdnURL = pickCDN(); if (!cdnURL.isEmpty()) { info("####################################"); info(" Distcp"); info("####################################"); info("Using CDN: " + cdnURL); try { String username = props.getString("env.USER", "unknownClient"); String pathPrefix = props.getString(VoldemortBuildAndPushJob.PUSH_CDN_PREFIX, "/tmp/VoldemortBnP/"); pathPrefix = pathPrefix.endsWith("/") ? pathPrefix : pathPrefix + "/"; String cdnDir = source.replaceAll(".*://.*?(?=/)", cdnURL + pathPrefix + username); FileSystem cdnRootFS = getRootFS(cdnDir); Path from = new Path(source); Path to = new Path(cdnDir); if (!prereqSatisfied(cdnURL)) { warn("\"other_namenodes\" does not contain the CDN cluster address " + cdnURL); warn("The following steps will fail soon, and distcp will be skipped!"); warn("Please add/append \"" + cdnURL + "\" to the \"other_namenodes\" attribute in your job specification."); } deleteDir(cdnRootFS, cdnDir); runDistcp(from, to); deleteDirOnExit(cdnRootFS, cdnDir); addPermissionsToParents(cdnRootFS, cdnDir); source = cdnDir; info("Use CDN HDFS cluster: " + source); } catch (Exception e) { warn("An exception occurred during distcp: " + e.getMessage()); warn("Use original HDFS cluster: " + source); } info("####################################"); info(" End of Distcp"); info("####################################"); } }

Target:
public void run() throws Exception { info("############### Distcp ###############"); long startTime = System.currentTimeMillis(); try { String cdnURL = pickCDN(); if (!cdnURL.isEmpty()) { info("CDN: " + cdnURL); String storeName = props.getString(VoldemortBuildAndPushJob.PUSH_STORE_NAME).trim(); String pathPrefix = props.getString(VoldemortBuildAndPushJob.PUSH_CDN_PREFIX).trim(); if (!pathPrefix.startsWith("/")) { throw new RuntimeException(VoldemortBuildAndPushJob.PUSH_CDN_PREFIX + " must start with '/': " + pathPrefix); } pathPrefix = removeTrailingSlash(pathPrefix); String cdnDir = cdnURL + pathPrefix + "/" + storeName + extractPathFromUrl(source); cdnTargetFS = getTargetFS(cdnDir); Path from = new Path(source); Path to = new Path(cdnDir); if (!prereqSatisfied(cdnURL)) { warn("Please add/append \"" + cdnURL + "\" to the \"" + OTHER_NAMENODES + "\" attribute in your job specification."); throw new RuntimeException("\"" + OTHER_NAMENODES + "\" does not contain the CDN cluster address " + cdnURL); } deleteDir(cdnTargetFS, cdnDir); runDistcp(from, to); deleteDirOnExit(cdnTargetFS, cdnDir); addPermissionsToParentDirs(cdnTargetFS, cdnDir, pathPrefix); source = cdnDir; info("Will use data on CDN HDFS cluster: " + source); } } catch (Exception e) { warn("An exception occurred during distcp: ", e); warn("Will use data on original HDFS cluster: " + source); long duration = System.currentTimeMillis() - startTime; info("############# End of Distcp (FAILED) ############ (duration: " + duration/1000 + "s)"); throw new RuntimeException("An exception occurred during distcp", e); } long duration = System.currentTimeMillis() - startTime; info("############# End of Distcp ########### (duration: " + duration/1000 + "s)"); }
Source:
public Department() { this.lastModification = ZonedDateTime.now(UTC).toLocalDate(); }

Target:
public Department() { this.lastModification = LocalDate.now(UTC); }
Source:
public void verify(SparkContext sparkContext, Session session) { verify(!isDistributedSortEnabled(session), "distributed sort is not supported"); verify(getExchangeMaterializationStrategy(session) == NONE, "exchange materialization is not supported"); verify(getPartitioningProviderCatalog(session).equals(GlobalSystemConnector.NAME), "partitioning provider other that system is not supported"); verify(!isGroupedExecutionForEligibleTableScansEnabled(session) && !isGroupedExecutionForAggregationEnabled(session) && !isRecoverableGroupedExecutionEnabled(session) && !isDynamicScheduleForGroupedExecution(session) && !isColocatedJoinEnabled(session), "grouped execution is not supported"); verify(!isRedistributeWrites(session), "redistribute writes is not supported"); verify(!isScaleWriters(session), "scale writes is not supported"); verify(!isPreferDistributedUnion(session), "prefer distributed union is expected to be disabled"); }

Target:
public void verify(SparkContext sparkContext, Session session) { verify(!isDistributedSortEnabled(session), "distributed sort is not supported"); verify(getExchangeMaterializationStrategy(session) == NONE, "exchange materialization is not supported"); verify(getPartitioningProviderCatalog(session).equals(GlobalSystemConnector.NAME), "partitioning provider other that system is not supported"); verify(!isGroupedExecutionForEligibleTableScansEnabled(session) && !isGroupedExecutionForAggregationEnabled(session) && !isRecoverableGroupedExecutionEnabled(session) && !isDynamicScheduleForGroupedExecution(session) && !isColocatedJoinEnabled(session), "grouped execution is not supported"); verify(!isRedistributeWrites(session), "redistribute writes is not supported"); verify(!isScaleWriters(session), "scale writes is not supported"); }
Source:
public Command getSetStringValueCommand( final TransactionalEditingDomain domain, Object columnElement, Object rowElement, String newValue, AbstractStringValueConverter valueSolver, INattableModelManager tableManager) { if (columnElement instanceof EStructuralFeatureAxis) { final EStructuralFeature structuralFeature = (EStructuralFeature) ((EStructuralFeatureAxis) columnElement) .getElement(); if (structuralFeature.getEType().equals( UMLPackage.Literals.VALUE_SPECIFICATION)) { final EObject element = ((EObjectAxis) rowElement).getElement(); CompositeCommand result = ValueSpecificationSetCommand .getInstance().createSetCommand(getInjector(), element, structuralFeature, newValue); return result.isEmpty() ? null : new GMFtoEMFCommandWrapper( result); } } return null; }

Target:
public Command getSetStringValueCommand( final TransactionalEditingDomain domain, Object columnElement, Object rowElement, String newValue, AbstractStringValueConverter valueSolver, INattableModelManager tableManager) { if (columnElement instanceof EStructuralFeatureAxis) { final EStructuralFeature structuralFeature = (EStructuralFeature) ((EStructuralFeatureAxis) columnElement) .getElement(); if (UMLPackage.Literals.VALUE_SPECIFICATION == structuralFeature .getEType()) { final EObject element = ((EObjectAxis) rowElement).getElement(); CompositeCommand result = ValueSpecificationSetCommand .getInstance().createSetCommand(getInjector(), element, structuralFeature, newValue); return result.isEmpty() ? null : new GMFtoEMFCommandWrapper( result); } } return null; }
Source:
public void populateDAG(DAG dag, Configuration conf) { FileSplitterInput fileSplitter = dag.addOperator("FileSplitter", createFileSplitter()); FSSliceReader blockReader = dag.addOperator("BlockReader", createBlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); if (sequencialFileRead) { dag.setInputPortAttribute(blockReader.blocksMetadataInput, Context.PortContext.STREAM_CODEC, new SequentialFileBlockMetadataCodec()); } if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } FileSplitterInput.TimeBasedDirectoryScanner fileScanner = fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } blockReader.setBasePath(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<FSSliceReader>(readersCount)); fileSplitter.setBlocksThreshold(readersCount); } if (blocksThreshold != 0) { fileSplitter.setBlocksThreshold(blocksThreshold); } }

Target:
public void populateDAG(DAG dag, Configuration conf) { FileSplitterInput fileSplitter = dag.addOperator("FileSplitter", createFileSplitter()); FSSliceReader blockReader = dag.addOperator("BlockReader", createBlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); if (sequencialFileRead) { dag.setInputPortAttribute(blockReader.blocksMetadataInput, Context.PortContext.STREAM_CODEC, new SequentialFileBlockMetadataCodec()); } if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } FileSplitterInput.TimeBasedDirectoryScanner fileScanner = fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } blockReader.setBasePath(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<FSSliceReader>(readersCount)); } if (blocksThreshold != 0) { fileSplitter.setBlocksThreshold(blocksThreshold); } }
Source:
public void testRouterRequestTimeoutAllFailure() throws Exception { doPut(); operationsCount.incrementAndGet(); GetBlobOperation op = new GetBlobOperation(routerConfig, routerMetrics, mockClusterMap, responseHandler, blobIdStr, operationFuture, null, operationCompleteCallback, time); requestRegistrationCallback.requestListToFill = new ArrayList<>(); op.poll(requestRegistrationCallback); while (!op.isOperationComplete()) { time.sleep(routerConfig.routerRequestTimeoutMs + 1); op.poll(requestRegistrationCallback); } Assert.assertEquals("Must have attempted sending requests to all replicas", replicasCount, correlationIdToGetOperation.size()); RouterException routerException = (RouterException) op.getOperationException(); Assert.assertEquals(RouterErrorCode.OperationTimedOut, routerException.getErrorCode()); }

Target:
public void testRouterRequestTimeoutAllFailure() throws Exception { doPut(); operationsCount.incrementAndGet(); GetBlobOperation op = new GetBlobOperation(routerConfig, routerMetrics, mockClusterMap, responseHandler, blobIdStr, operationFuture, null, operationCompleteCallback, blobIdFactory, time); requestRegistrationCallback.requestListToFill = new ArrayList<>(); op.poll(requestRegistrationCallback); while (!op.isOperationComplete()) { time.sleep(routerConfig.routerRequestTimeoutMs + 1); op.poll(requestRegistrationCallback); } Assert.assertEquals("Must have attempted sending requests to all replicas", replicasCount, correlationIdToGetOperation.size()); RouterException routerException = (RouterException) op.getOperationException(); Assert.assertEquals(RouterErrorCode.OperationTimedOut, routerException.getErrorCode()); }
Source:
public Handle<?> upload(LogFilePath localPath) throws Exception { String prefix = FileUtil.getPrefix(localPath.getTopic(), mConfig); LogFilePath path = localPath.withPrefix(prefix); final String localLogFilename = localPath.getLogFilePath(); final String logFileName; if (FileUtil.s3PathPrefixIsAltered(path.getLogFilePath(), mConfig)) { logFileName = localPath.withPrefix(FileUtil.getS3AlternativePrefix(mConfig)).getLogFilePath(); LOG.info("Will upload file to alternative s3 prefix path {}", logFileName); } else { logFileName = path.getLogFilePath(); } LOG.info("uploading file to {}", localLogFilename, logFileName); final Future<?> f = executor.submit(new Runnable() { final int totalRetries = Integer.parseInt(mConfig.getUploaderRetries()); @Override public void run() { int retriesLeft = totalRetries; boolean success = false; while (retriesLeft > 0 && !success) { try { FileUtil.moveToCloud(localLogFilename, logFileName); success = true; } catch (IOException e) { success = false; retriesLeft--; if (retriesLeft > 0) LOG.warn("Error uploading files to s3. Will retry times. Exception {}", retriesLeft, e); else Throwables.propagate(e); } } } }); return new FutureHandle(f); }

Target:
public Handle<?> upload(LogFilePath localPath) throws Exception { String prefix = FileUtil.getPrefix(localPath.getTopic(), mConfig); LogFilePath path = localPath.withPrefix(prefix); final String localLogFilename = localPath.getLogFilePath(); final String logFileName; if (FileUtil.s3PathPrefixIsAltered(path.getLogFilePath(), mConfig)) { logFileName = localPath.withPrefix(FileUtil.getS3AlternativePrefix(mConfig)).getLogFilePath(); LOG.info("Will upload file to alternative s3 prefix path {}", logFileName); } else { logFileName = path.getLogFilePath(); } LOG.info("uploading file to {}", localLogFilename, logFileName); final Future<?> f = executor.submit(new Runnable() { final int totalRetries = Integer.parseInt(mConfig.getUploaderRetries()); final long backoffMillis = Long.parseLong(mConfig.getUploaderRetryBackoffMillis()); @Override public void run() { IOException uploadException = null; long millisToSleep = backoffMillis; int retriesLeft = totalRetries; boolean success = false; while (retriesLeft >= 0 && !success) { try { FileUtil.moveToCloud(localLogFilename, logFileName); success = true; } catch (IOException e) { success = false; retriesLeft--; uploadException = e; LOG.warn("Error uploading files to s3. Will retry times. Exception {}", retriesLeft, e); try { LOG.info("Sleeping millis, will retry upload after sleep", millisToSleep); Thread.sleep(millisToSleep); millisToSleep = millisToSleep*2; } catch(InterruptedException ie) { LOG.info("Interrupted when sleeping for retry."); } } } if (!success) throw new RuntimeException(uploadException); } }); return new FutureHandle(f); }
Source:
public void deleteScheme(final WorkflowScheme scheme, final User user) throws DotDataException, DotSecurityException, AlreadyExistException { if (null == scheme || SYSTEM_WORKFLOW_ID.equals(scheme.getId()) || !scheme.isArchived()) { Logger.warn(this, "Can not delete workflow Id:" + scheme.getId()); throw new DotWorkflowException("Can not delete workflow Id:" + scheme.getId()); } this.submitter.execute(() -> deleteSchemeTask(scheme, user)); }

Target:
public void deleteScheme(final WorkflowScheme scheme, final User user) throws DotDataException, DotSecurityException, AlreadyExistException { this.isUserAllowToModifiedWorkflow(user); if (null == scheme){ Logger.warn(this, "Can not delete a null workflow"); throw new DotWorkflowException("Can not delete a null workflow"); } if( SYSTEM_WORKFLOW_ID.equals(scheme.getId()) || !scheme.isArchived()) { Logger.warn(this, "Can not delete workflow Id:" + scheme.getId()); throw new DotWorkflowException("Can not delete workflow Id:" + scheme.getId()); } this.submitter.execute(() -> deleteSchemeTask(scheme, user)); }
Source:
public void boundaryOpenCloseDisposedOnComplete() { PublishProcessor<Integer> pp0 = PublishProcessor.create(); PublishProcessor<Integer> pp1 = PublishProcessor.create(); PublishProcessor<Integer> pp2 = PublishProcessor.create(); TestSubscriber<List<Integer>> ts = pp0 .buffer(pp1, Functions.justFunction(pp2)) .test(); assertTrue(pp0.hasSubscribers()); assertTrue(pp1.hasSubscribers()); assertFalse(pp2.hasSubscribers()); pp1.onNext(1); assertTrue(pp1.hasSubscribers()); assertTrue(pp2.hasSubscribers()); pp0.onComplete(); ts.assertResult(Collections.<Integer>emptyList()); assertFalse(pp1.hasSubscribers()); assertFalse(pp2.hasSubscribers()); }

Target:
public void boundaryOpenCloseDisposedOnComplete() { PublishProcessor<Integer> source = PublishProcessor.create(); PublishProcessor<Integer> openIndicator = PublishProcessor.create(); PublishProcessor<Integer> closeIndicator = PublishProcessor.create(); TestSubscriber<List<Integer>> ts = source .buffer(openIndicator, Functions.justFunction(closeIndicator)) .test(); assertTrue(source.hasSubscribers()); assertTrue(openIndicator.hasSubscribers()); assertFalse(closeIndicator.hasSubscribers()); openIndicator.onNext(1); assertTrue(openIndicator.hasSubscribers()); assertTrue(closeIndicator.hasSubscribers()); source.onComplete(); ts.assertResult(Collections.<Integer>emptyList()); assertFalse(openIndicator.hasSubscribers()); assertFalse(closeIndicator.hasSubscribers()); }
Source:
public void click() { waitUntilIsDisplayed(); scrollIntoScreenIfNeeded(); final View view = getView(); final int[] xy = new int[2]; if (Build.VERSION.SDK_INT < 19 || view.isLaidOut()) { if (Build.VERSION.SDK_INT < 19) { try { Thread.sleep(300); } catch (InterruptedException e) } view.getLocationOnScreen(xy); clickOnScreen(xy[0] + view.getWidth() / 2.0f, xy[1] + view.getHeight() / 2.0f); return; } final AndroidWait wait = instrumentation.getAndroidWait(); final BooleanWrapper isLaidOut = new BooleanWrapper(); final ViewTreeObserver observer = view.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { try { isLaidOut.value = true; } finally { if (observer.isAlive()) { removeOnGlobalLayoutListener(observer, this); } else { removeOnGlobalLayoutListener(view.getViewTreeObserver(), this); } } } }); try { wait.until(new Function<Void, Boolean>() { @Override public Boolean apply(Void input) { return isLaidOut.value; } }); } catch (TimeoutException e) { throw new SelendroidException("View was never laid out", e); } view.getLocationOnScreen(xy); clickOnScreen(xy[0] + view.getWidth() / 2.0f, xy[1] + view.getHeight() / 2.0f); }

Target:
public void click() { waitUntilIsDisplayed(); scrollIntoScreenIfNeeded(); final View view = getView(); if (Build.VERSION.SDK_INT < 19 || view.isLaidOut()) { if (Build.VERSION.SDK_INT < 19) { try { Thread.sleep(300); } catch (InterruptedException e) } doClick(); return; } final AndroidWait wait = instrumentation.getAndroidWait(); final AtomicBoolean isLaidOut = new AtomicBoolean(false); final ViewTreeObserver observer = view.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { try { isLaidOut.set(true); } finally { if (observer.isAlive()) { removeOnGlobalLayoutListener(observer, this); } else { removeOnGlobalLayoutListener(view.getViewTreeObserver(), this); } } } }); try { wait.until(new Function<Void, Boolean>() { @Override public Boolean apply(Void input) { return isLaidOut.get(); } }); } catch (TimeoutException e) { throw new SelendroidException("View was never laid out", e); } doClick(); }
Source:
protected Set<String> getMdcTags(Dsn dsn) { String val = Lookup.lookup(MDCTAGS_OPTION, dsn); if (Util.isNullOrEmpty(val)) { val = Lookup.lookup(EXTRATAGS_OPTION, dsn); } return Util.parseMdcTags(val); }

Target:
protected Set<String> getMdcTags(Dsn dsn) { String val = Lookup.lookup(MDCTAGS_OPTION, dsn); if (Util.isNullOrEmpty(val)) { val = Lookup.lookup(EXTRATAGS_OPTION, dsn); if (!Util.isNullOrEmpty(val)) { logger.warn("The '" + EXTRATAGS_OPTION + "' option is deprecated, please use" + " the '" + MDCTAGS_OPTION + "' option instead."); } } return Util.parseMdcTags(val); }
Source:
private static void parseTtsElements(Element element, List<LocalisedText> textsToRead) { if ("tts".equalsIgnoreCase(1element.tagName()) && "android".equalsIgnoreCase(element.attr("service"))) { textsToRead.add(new LocalisedText(element.text(), element.attr("voice"))); return; } for (Element child : element.children()) { parseTtsElements(child, textsToRead); } }

Target:
private static void parseTtsElements(Element element, List<LocalisedText> textsToRead) { if ("tts".equalsIgnoreCase(element.tagName()) && "android".equalsIgnoreCase(element.attr("service"))) { textsToRead.add(new LocalisedText(element.text(), element.attr("voice"))); return; } for (Element child : element.children()) { parseTtsElements(child, textsToRead); } }
Source:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (getStoragePoolDAO().get(quota.getStoragePoolId()).getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED && quota.getIsDefaultQuota()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_CAN_NOT_HAVE_DEFAULT_INDICATION); return false; } List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(quota.getStoragePoolId()); if (quotaList.size() <= 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_MUST_HAVE_AT_LEAST_ONE_QUOTA); return false; } if (getVmDAO().getAllVmsRelatedToQuotaId(quota.getId()) != null && !getVmDAO().getAllVmsRelatedToQuotaId(quota.getId()).isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); } return true; }

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (getStoragePoolDAO().get(quota.getStoragePoolId()).getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED && quota.getIsDefaultQuota()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_CAN_NOT_HAVE_DEFAULT_INDICATION); return false; } List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(quota.getStoragePoolId()); if (quotaList.size() <= 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_MUST_HAVE_AT_LEAST_ONE_QUOTA); return false; } if (getVmDAO().getAllVmsRelatedToQuotaId(quota.getId()) != null && !getVmDAO().getAllVmsRelatedToQuotaId(quota.getId()).isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); return false; } return true; }
Source:
private double calcTimeoutToFence(int vmCount, VdsSpmStatus spmStatus) { int spmIndicator = 0; if (spmStatus != VdsSpmStatus.None) { spmIndicator = 1; } return TimeUnit.SECONDS.toMillis((int)( Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds) + (Config.<Double> GetValue(ConfigValues.DelayResetForSpmInSeconds) * spmIndicator) + (Config.<Double> GetValue(ConfigValues.DelayResetPerVmInSeconds) * vmCount))); }

Target:
private long calcTimeoutToFence(int vmCount, VdsSpmStatus spmStatus) { int spmIndicator = 0; if (spmStatus != VdsSpmStatus.None) { spmIndicator = 1; } return TimeUnit.SECONDS.toMillis((int)( Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds) + (Config.<Double> GetValue(ConfigValues.DelayResetForSpmInSeconds) * spmIndicator) + (Config.<Double> GetValue(ConfigValues.DelayResetPerVmInSeconds) * vmCount))); }
Source:
public void testRenameWithNestedSnapshottableDirs() throws Exception { final Path sdir1 = new Path("/dir1"); final Path sdir2 = new Path("/dir2"); final Path foo = new Path(sdir1, "foo"); final Path bar = new Path(sdir2, "bar"); hdfs.mkdirs(foo); hdfs.mkdirs(bar); hdfs.allowSnapshot(foo); hdfs.allowSnapshot(sdir2); try { hdfs.rename(foo, bar, Rename.OVERWRITE); } catch (IOException e) { GenericTestUtils.assertExceptionContains("Unable to rename because " + foo.toString() + " has snapshottable descendant directories and " + sdir2.toString() + " is a descent of a snapshottable directory, " + "and HDFS does not support nested snapshottable directory.", e); } hdfs.disallowSnapshot(foo); hdfs.rename(foo, bar, Rename.OVERWRITE); SnapshottableDirectoryStatus[] dirs = fsn.getSnapshottableDirListing(); assertEquals(1, dirs.length); assertEquals(sdir2, dirs[0].getFullPath()); }

Target:
public void testRenameWithNestedSnapshottableDirs() throws Exception { final Path sdir1 = new Path("/dir1"); final Path sdir2 = new Path("/dir2"); final Path foo = new Path(sdir1, "foo"); final Path bar = new Path(sdir2, "bar"); hdfs.mkdirs(foo); hdfs.mkdirs(bar); hdfs.allowSnapshot(foo); hdfs.allowSnapshot(sdir2); try { hdfs.rename(foo, bar, Rename.OVERWRITE); fail("Except exception since " + "Unable to rename because " + foo.toString() + " has snapshottable descendant directories and " + sdir2.toString() + " is a descent of a snapshottable directory, " + "and HDFS does not support nested snapshottable directory."); } catch (IOException e) { GenericTestUtils.assertExceptionContains("Unable to rename because " + foo.toString() + " has snapshottable descendant directories and " + sdir2.toString() + " is a descent of a snapshottable directory, " + "and HDFS does not support nested snapshottable directory.", e); } hdfs.disallowSnapshot(foo); hdfs.rename(foo, bar, Rename.OVERWRITE); SnapshottableDirectoryStatus[] dirs = fsn.getSnapshottableDirListing(); assertEquals(1, dirs.length); assertEquals(sdir2, dirs[0].getFullPath()); }
Source:
private static Icon generateThemedIcon(Context context, int iconId, int foregroundColor, int backgroundColor) { Drawable vectorDrawable = Util.getTintedVectorDrawable(context, iconId, foregroundColor); Drawable backgroundDrawable = Util.getTintedVectorDrawable(context, R.drawable.ic_app_shortcut_background, backgroundColor); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ AdaptiveIconDrawable adaptiveIconDrawable = new AdaptiveIconDrawable(backgroundDrawable, vectorDrawable); return Icon.createWithAdaptiveBitmap(drawableToBitmap(adaptiveIconDrawable)); } else { LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{backgroundDrawable, vectorDrawable}); return Icon.createWithBitmap(drawableToBitmap(layerDrawable)); } }

Target:
private static IconCompat generateThemedIcon(Context context, int iconId, int foregroundColor, int backgroundColor) { Drawable vectorDrawable = Util.getTintedVectorDrawable(context, iconId, foregroundColor); Drawable backgroundDrawable = Util.getTintedVectorDrawable(context, R.drawable.ic_app_shortcut_background, backgroundColor); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ AdaptiveIconDrawable adaptiveIconDrawable = new AdaptiveIconDrawable(backgroundDrawable, vectorDrawable); return IconCompat.createWithAdaptiveBitmap(drawableToBitmap(adaptiveIconDrawable)); } else { LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{backgroundDrawable, vectorDrawable}); return IconCompat.createWithBitmap(drawableToBitmap(layerDrawable)); } }
Source:
public void testIt() { PropertyInfo pc = TypeCompat.GetProperty(this.getClass(), "someValue"); String result = (String) pc.GetValue(this, "JarJar"); assertEquals("Standard", "Anakin", result); this.someValue = null; result = (String) pc.GetValue(this, "JarJar"); assertEquals("Null Value", "JarJar", result); }

Target:
public void testIt() { PropertyInfo propInfo = TypeCompat.GetProperty(this.getClass(), "someValue"); String result = (String) propInfo.GetValue(this, "JarJar"); assertEquals("Standard", "Anakin", result); this.someValue = null; result = (String) propInfo.GetValue(this, "JarJar"); assertEquals("Null Value", "JarJar", result); }
Source:
public List<Method> visibleMethods() { if (fVisibleMethods != null) { return fVisibleMethods; } Set<String> namesAndSignatures = new HashSet<>(); List<Method> visibleMethods = new ArrayList<>(); for (Method method2 : methods()) { MethodImpl method = (MethodImpl) method2; namesAndSignatures.add(method.name() + method.signature()); visibleMethods.add(method); } Iterator<InterfaceType> interfaces = interfaces().iterator(); InterfaceType inter; while (interfaces.hasNext()) { inter = interfaces.next(); addVisibleMethods(inter.visibleMethods(), namesAndSignatures, visibleMethods); } if (this instanceof ClassType) { ClassType superclass = ((ClassType) this).superclass(); if (superclass != null) { addVisibleMethods(superclass.visibleMethods(), namesAndSignatures, visibleMethods); } } fVisibleMethods = visibleMethods; return fVisibleMethods; }

Target:
public List<Method> visibleMethods() { if (fVisibleMethods != null) { return fVisibleMethods; } Set<String> namesAndSignatures = new HashSet<>(); List<Method> visibleMethods = new ArrayList<>(); for (Method m : methods()) { MethodImpl method = (MethodImpl) m; namesAndSignatures.add(method.name() + method.signature()); visibleMethods.add(method); } Iterator<InterfaceType> interfaces = interfaces().iterator(); InterfaceType inter; while (interfaces.hasNext()) { inter = interfaces.next(); addVisibleMethods(inter.visibleMethods(), namesAndSignatures, visibleMethods); } if (this instanceof ClassType) { ClassType superclass = ((ClassType) this).superclass(); if (superclass != null) { addVisibleMethods(superclass.visibleMethods(), namesAndSignatures, visibleMethods); } } fVisibleMethods = visibleMethods; return fVisibleMethods; }
Source:
public void notB(final org.apache.datasketches.theta.Sketch skB) { if (empty_) { return; } if ((skB == null) || skB.isEmpty()) { return; } final long thetaLongB = skB.getThetaLong(); thetaLong_ = Math.min(thetaLong_, thetaLongB); final int countB = skB.getRetainedEntries(); final long[] hashTableKeysB = convertToHashTable(extractThetaHashArray(skB, countB), countB, thetaLong_); final long[] tmpKeysA = new long[count_]; final S[] tmpSummariesA = (S[]) Array.newInstance(summaries_.getClass().getComponentType(), count_); int nonMatches = 0; for (int i = 0; i < count_; i++) { final long key = keys_[i]; if ((key != 0) && (key < thetaLong_)) { final int index = HashOperations.hashSearch(hashTableKeysB, simpleIntLog2(hashTableKeysB.length), key); if (index == -1) { tmpKeysA[nonMatches] = key; tmpSummariesA[nonMatches] = summaries_[i]; nonMatches++; } } } keys_ = Arrays.copyOfRange(tmpKeysA, 0, nonMatches); summaries_ = Arrays.copyOfRange(tmpSummariesA, 0, nonMatches); count_ = nonMatches; }

Target:
public void notB(final org.apache.datasketches.theta.Sketch skB) { if (empty_ || (skB == null) || skB.isEmpty()) { return; } final long thetaLongB = skB.getThetaLong(); thetaLong_ = Math.min(thetaLong_, thetaLongB); final int countB = skB.getRetainedEntries(); final long[] hashTableKeysB = convertToHashTable(extractThetaHashArray(skB, countB), countB, thetaLong_); final long[] tmpKeysA = new long[count_]; final S[] tmpSummariesA = (S[]) Array.newInstance(summaries_.getClass().getComponentType(), count_); int nonMatches = 0; for (int i = 0; i < count_; i++) { final long key = keys_[i]; if ((key > 0) && (key < thetaLong_)) { final int index = HashOperations.hashSearch(hashTableKeysB, simpleIntLog2(hashTableKeysB.length), key); if (index == -1) { tmpKeysA[nonMatches] = key; tmpSummariesA[nonMatches] = summaries_[i]; nonMatches++; } } } keys_ = Arrays.copyOfRange(tmpKeysA, 0, nonMatches); summaries_ = Arrays.copyOfRange(tmpSummariesA, 0, nonMatches); count_ = nonMatches; }