auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected AbstractXmlApplicationContext createApplicationContext() { String version = Version.getCurrentVersion(); ClassPathXmlApplicationContext applicationContext = null; if (version.startsWith("2") && (version.contains("2.5") || version.contains("2.4"))) { applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml")); } else { applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml")); } emulateBeanRegistrationProgrammatically(applicationContext); return applicationContext; }

Target:
protected AbstractXmlApplicationContext createApplicationContext() { ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml")); emulateBeanRegistrationProgrammatically(applicationContext); return applicationContext; }
Source:
StoreIndexDescriptor( StoreIndexDescriptor indexDescriptor ) { super( indexDescriptor ); this.id = indexDescriptor.id; this.owningConstraintId = indexDescriptor.owningConstraintId; this.name = indexDescriptor.name; }

Target:
protected StoreIndexDescriptor( StoreIndexDescriptor indexDescriptor ) { super( indexDescriptor ); this.id = indexDescriptor.id; this.owningConstraintId = indexDescriptor.owningConstraintId; this.name = indexDescriptor.name; }
Source:
public void initHandlers(EventBus eventBus) { if (ssoTokenHandlerRegistration != null) { ssoTokenHandlerRegistration.removeHandler(); } ssoTokenHandlerRegistration = eventBus.addHandler(SSOTokenChangeEvent.getType(), new SSOTokenChangeHandler() { @Override public void onSSOTokenChange(SSOTokenChangeEvent event) { ssoToken = event.getSsoToken(); checkIfInitFinished(); } } ); }

Target:
public void initHandlers(EventBus eventBus) { if (ssoTokenHandlerRegistration != null) { ssoTokenHandlerRegistration.removeHandler(); } ssoTokenHandlerRegistration = eventBus.addHandler(SSOTokenChangeEvent.getType(), new SSOTokenChangeHandler() { @Override public void onSSOTokenChange(SSOTokenChangeEvent event) { ReportInit.this.ssoToken = event.getToken(); if (ReportInit.this.ssoToken == null) { ReportInit.this.ssoToken = ""; } checkIfInitFinished(); } } ); }
Source:
public boolean hasAccessLevel(String right, XWikiUser user, EntityReference entityRef) { return hasAccessLevel(entityRef, EAccessLevel.getAccessLevel(right).get(), user); }

Target:
public boolean hasAccessLevel(String right, XWikiUser user, EntityReference entityRef) { Optional<EAccessLevel> eAccessLevel = EAccessLevel.getAccessLevel(right); if (eAccessLevel.isPresent()) { return hasAccessLevel(entityRef, eAccessLevel.get(), user); } return false; }
Source:
public void overrideInitMainSchedulerThrowsWhenSchedulerCallableIsNull() { try { RxAndroidPlugins.initMainThreadScheduler(null); fail("Should have thrown NullPointerException"); } catch (NullPointerException npe) { assertEquals("Scheduler Callable can't be null", npe.getMessage()); } }

Target:
public void overrideInitMainSchedulerThrowsWhenSchedulerCallableIsNull() { try { RxAndroidPlugins.initMainThreadScheduler(null); fail(); } catch (NullPointerException e) { assertEquals("scheduler == null", e.getMessage()); } }
Source:
protected boolean hasNhinTargetHomeCommunityId( RespondingGatewayProvideAndRegisterDocumentSetSecuredResponseRequestType request) { if (request != null && request.getNhinTargetCommunities() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity()) && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) != null && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0).getHomeCommunity() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) .getHomeCommunity().getHomeCommunityId())) { return true; } return false; }

Target:
protected boolean hasNhinTargetHomeCommunityId( RespondingGatewayProvideAndRegisterDocumentSetSecuredResponseRequestType request) { return (request != null && request.getNhinTargetCommunities() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity()) && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) != null && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0).getHomeCommunity() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) .getHomeCommunity().getHomeCommunityId())); }
Source:
private boolean hasLombokGeneratedAnnotation(final MethodNode methodNode) { final List<AnnotationNode> list = methodNode.invisibleAnnotations; if (list != null) { for (final AnnotationNode annotation : list) { if ("Llombok/Generated;".equals(annotation.desc)) { return true; } } } return false; }

Target:
private boolean hasLombokGeneratedAnnotation(final MethodNode methodNode) { final List<AnnotationNode> runtimeInvisibleAnnotations = methodNode.invisibleAnnotations; if (runtimeInvisibleAnnotations != null) { for (final AnnotationNode annotation : runtimeInvisibleAnnotations) { if ("Llombok/Generated;".equals(annotation.desc)) { return true; } } } return false; }
Source:
public void registerMessageConsumer(String brokerName, MqttMessageConsumer mqttMessageConsumer) { mqttMessageConsumer.setEventPublisher(eventPublisher); try { MqttBrokerConnection brokerConnection = getBrokerConnection(brokerName); if (brokerConnection != null) { brokerConnection.addConsumer(mqttMessageConsumer); } } catch (MqttException e) { logger.debug("Consumer could not be activated", e); } }

Target:
public void registerMessageConsumer(String brokerName, MqttMessageConsumer mqttMessageConsumer) { try { MqttBrokerConnection brokerConnection = getBrokerConnection(brokerName); if (brokerConnection != null) { brokerConnection.addConsumer(mqttMessageConsumer); mqttMessageConsumer.setEventPublisher(eventPublisher); } } catch (MqttException e) { logger.debug("Consumer could not be activated", e); } }
Source:
private AliyunDateAdapter(DateService dateService) { super(dateService); }

Target:
AliyunDateAdapter(DateService dateService) { super(dateService); }
Source:
public void notifySuccessfullArrival(UUID player) { if (isPlayerInExitTransit(player)) { PlayerEnsuredToTransitEvent e = new PlayerEnsuredToTransitEvent(player, exitTransit.get(player)); Bukkit.getPluginManager().callEvent(e); exitTransit.remove(player); } }

Target:
public void notifySuccessfullArrival(UUID player) { if (isPlayerInArrivalTransit(player)) { arrivalTransit.remove(player); } }
Source:
public T createHosted(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "For tools, the Docker registry") @QueryParam("registry") String registry, @ApiParam(value = "name", required = true) @QueryParam("name") String name, @ApiParam(value = "Descriptor type", required = true) @QueryParam("descriptorType") String descriptorType, @ApiParam(value = "For tools, the Docker namespace") @QueryParam("namespace") String namespace) { int calculatedLimit = MoreObjects.firstNonNull(this.limitConfig.getWorkflowLimit(), Integer.MAX_VALUE); final long currentCount = getEntryDAO().countAllHosted(user.getId()); if (currentCount >= calculatedLimit) { throw new CustomWebApplicationException("You have " + currentCount + " workflows which is at the current limit of " + calculatedLimit, HttpStatus.SC_PAYMENT_REQUIRED); } descriptorType = checkType(descriptorType); T entry = getEntry(user, registry, name, descriptorType, namespace); checkForDuplicatePath(entry); long l = getEntryDAO().create(entry); T byId = getEntryDAO().findById(l); elasticManager.handleIndexUpdate(byId, ElasticMode.UPDATE); return byId; }

Target:
public T createHosted(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "For tools, the Docker registry") @QueryParam("registry") String registry, @ApiParam(value = "name", required = true) @QueryParam("name") String name, @ApiParam(value = "Descriptor type", required = true) @QueryParam("descriptorType") String descriptorType, @ApiParam(value = "For tools, the Docker namespace") @QueryParam("namespace") String namespace) { final long currentCount = getEntryDAO().countAllHosted(user.getId()); if (currentCount >= calculatedEntryLimit) { throw new CustomWebApplicationException("You have " + currentCount + " workflows which is at the current limit of " + calculatedEntryLimit, HttpStatus.SC_PAYMENT_REQUIRED); } descriptorType = checkType(descriptorType); T entry = getEntry(user, registry, name, descriptorType, namespace); checkForDuplicatePath(entry); long l = getEntryDAO().create(entry); T byId = getEntryDAO().findById(l); elasticManager.handleIndexUpdate(byId, ElasticMode.UPDATE); return byId; }
Source:
protected Tombstone resource() { final FedoraId resourceId = identifierConverter().pathToInternalId(externalPath); try { final Tombstone resource = resourceFactory.getResource(transaction(), resourceId, Tombstone.class); return resource; } catch (final PathNotFoundException e) { throw new PathNotFoundRuntimeException(e); } }

Target:
protected FedoraResource resource() { final FedoraId resourceId = identifierConverter().pathToInternalId(externalPath); try { return resourceFactory.getResource(transaction(), resourceId); } catch (final PathNotFoundException e) { throw new PathNotFoundRuntimeException(e); } }
Source:
private synchronized Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { boolean isSupported = isSupported(archCapabilitiesVerb, arch, version); archMap.put(version, isSupported); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }

Target:
private synchronized Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (archCapabilitiesVerb == null) { return null; } if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { archMap.put(version, isSupported(archCapabilitiesVerb, arch, version)); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }
Source:
public SparkStreamingPlugin(MessageBus messageBus) { super(messageBus, null); }

Target:
public SparkStreamingPlugin(MessageBus messageBus) { super(messageBus); }
Source:
SegmentIterator() { try { fileSize = writeChannel.size(); if (writeChannel.position() == 0) { LogHeader header = parseHeader(writeChannel, filePath); if (header == null) { log.warn("SegmentIterator: Couldn't find log header for {}, " + "creating new header.", filePath); writeHeader(writeChannel, logSizeQuota, VERSION, logParams.verifyChecksum); hasHeader = false; } } } catch (IOException e) { log.error("SegmentIterator: Error reading file: {}", filePath, e); throw new IllegalStateException(e); } }

Target:
SegmentIterator() { try { hasHeader = true; fileSize = writeChannel.size(); if (writeChannel.position() == 0) { LogHeader header = parseHeader(writeChannel, filePath); if (header == null) { hasHeader = false; log.warn("SegmentIterator: Couldn't find log header for {}, " + "creating new header.", filePath); writeHeader(writeChannel, logSizeQuota, VERSION, logParams.verifyChecksum); } } } catch (IOException e) { log.error("SegmentIterator: Error reading file: {}", filePath, e); throw new IllegalStateException(e); } }
Source:
private void runLongly() { double[][] data = new double[][] { { 60323, 83.0, 234289, 2356, 1590, 107608, 1947 }, { 61122, 88.5, 259426, 2325, 1456, 108632, 1948 }, { 60171, 88.2, 258054, 3682, 1616, 109773, 1949 }, { 61187, 89.5, 284599, 3351, 1650, 110929, 1950 }, { 63221, 96.2, 328975, 2099, 3099, 112075, 1951 }, { 63639, 98.1, 346999, 1932, 3594, 113270, 1952 }, { 64989, 99.0, 365385, 1870, 3547, 115094, 1953 }, { 63761, 100.0, 363112, 3578, 3350, 116219, 1954 }, { 66019, 101.2, 397469, 2904, 3048, 117388, 1955 }, { 67857, 104.6, 419180, 2822, 2857, 118734, 1956 }, { 68169, 108.4, 442769, 2936, 2798, 120445, 1957 }, { 66513, 110.8, 444546, 4681, 2637, 121950, 1958 }, { 68655, 112.6, 482704, 3813, 2552, 123366, 1959 }, { 69564, 114.2, 502601, 3931, 2514, 125368, 1960 }, { 69331, 115.7, 518173, 4806, 2572, 127852, 1961 }, { 70551, 116.9, 554894, 4007, 2827, 130081, 1962 } }; final int nobs = 16; final int nvars = 6; LinearRegressionSGDTrainer trainer = new LinearRegressionSGDTrainer(100_000, 1e-12); LinearRegressionModel model = trainer.train(new DenseLocalOnHeapMatrix(data)); }

Target:
private void runLongly() { double[][] data = new double[][] { { 60323, 83.0, 234289, 2356, 1590, 107608, 1947 }, { 61122, 88.5, 259426, 2325, 1456, 108632, 1948 }, { 60171, 88.2, 258054, 3682, 1616, 109773, 1949 }, { 61187, 89.5, 284599, 3351, 1650, 110929, 1950 }, { 63221, 96.2, 328975, 2099, 3099, 112075, 1951 }, { 63639, 98.1, 346999, 1932, 3594, 113270, 1952 }, { 64989, 99.0, 365385, 1870, 3547, 115094, 1953 }, { 63761, 100.0, 363112, 3578, 3350, 116219, 1954 }, { 66019, 101.2, 397469, 2904, 3048, 117388, 1955 }, { 67857, 104.6, 419180, 2822, 2857, 118734, 1956 }, { 68169, 108.4, 442769, 2936, 2798, 120445, 1957 }, { 66513, 110.8, 444546, 4681, 2637, 121950, 1958 }, { 68655, 112.6, 482704, 3813, 2552, 123366, 1959 }, { 69564, 114.2, 502601, 3931, 2514, 125368, 1960 }, { 69331, 115.7, 518173, 4806, 2572, 127852, 1961 }, { 70551, 116.9, 554894, 4007, 2827, 130081, 1962 } }; final int nobs = 16; final int nvars = 6; LinearRegressionQRTrainer trainer = new LinearRegressionQRTrainer(); LinearRegressionModel model = trainer.train(new DenseLocalOnHeapMatrix(data)); }
Source:
public MeasurementsService(MeasurementFetchStrategy fetchStrategy, ExpressionEngine expressionEngine, FilterEngine filterEngine) { Preconditions.checkNotNull(fetchStrategy); Preconditions.checkNotNull(expressionEngine); Preconditions.checkNotNull(filterEngine); this.fetchStrategy = fetchStrategy; this.expressionEngine = expressionEngine; this.filterEngine = filterEngine; }

Target:
public MeasurementsService(MeasurementFetchStrategy fetchStrategy, ExpressionEngine expressionEngine, FilterEngine filterEngine) { this.fetchStrategy = Preconditions.checkNotNull(fetchStrategy); this.expressionEngine = Preconditions.checkNotNull(expressionEngine); this.filterEngine = Preconditions.checkNotNull(filterEngine); }
Source:
public void setVds(VDS vds) { _vds = vds; setHost(_vds.getHostName(), _vds.getSSHPort()); setUser(_vds.getSSHUsername()); }

Target:
public void setVds(VDS vds) { _vds = vds; if (_vds != null) { setHost(_vds.getHostName(), _vds.getSSHPort()); setUser(_vds.getSSHUsername()); } }
Source:
private void stopRebalance() { if (getSelectedItem() == null) { return; } final ConfirmationModel model = new ConfirmationModel(); final GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getSelectedItem(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmStopVolumeRebalanceTitle()); model.setHashName("volume_rebalance_stop"); model.setMessage(ConstantsManager.getInstance().getMessages().confirmStopVolumeRebalance( volumeEntity.getName())); UICommand okCommand = new UICommand("onStopRebalance", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }

Target:
private void stopRebalance() { if (getSelectedItem() == null) { return; } ConfirmationModel model = new ConfirmationModel(); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getSelectedItem(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmStopVolumeRebalanceTitle()); model.setHashName("volume_rebalance_stop"); model.setMessage(ConstantsManager.getInstance().getMessages().confirmStopVolumeRebalance( volumeEntity.getName())); UICommand okCommand = new UICommand("onStopRebalance", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
public static PMMLInfo<PMMLModelInfo> from(InputStream is) throws Exception { PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(is); List<PMMLModelInfo> models = new ArrayList<>(); for (Model pm : pmml.getModels()) { MiningSchema miningSchema = pm.getMiningSchema(); Collection<String> inputFields = new ArrayList<>(); miningSchema.getMiningFields() .stream() .filter(mf -> mf.getUsageType() == UsageType.ACTIVE) .forEach(fn -> inputFields.add(fn.getName().getValue())); Collection<String> outputFields = new ArrayList<>(); pm.getOutput().getOutputFields().forEach(of -> outputFields.add(of.getName().getValue())); models.add(new PMMLModelInfo(pm.getModelName(), inputFields, outputFields)); } Map<String, String> headerExtensions = new HashMap<>(); for (Extension ex : pmml.getHeader().getExtensions()) { headerExtensions.put(ex.getName(), ex.getValue()); } PMMLInfo<PMMLModelInfo> info = new PMMLInfo<>(models, new PMMLHeaderInfo("<LINK_0>" + pmml.getBaseVersion().replace(".", "_"), headerExtensions)); return info; }

Target:
public static PMMLInfo<PMMLModelInfo> from(InputStream is) throws SAXException, JAXBException { PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(is); List<PMMLModelInfo> models = new ArrayList<>(); for (Model pm : pmml.getModels()) { MiningSchema miningSchema = pm.getMiningSchema(); Collection<String> inputFields = new ArrayList<>(); miningSchema.getMiningFields() .stream() .filter(mf -> mf.getUsageType() == UsageType.ACTIVE) .forEach(fn -> inputFields.add(fn.getName().getValue())); Collection<String> outputFields = new ArrayList<>(); pm.getOutput().getOutputFields().forEach(of -> outputFields.add(of.getName().getValue())); models.add(new PMMLModelInfo(pm.getModelName(), inputFields, outputFields)); } Map<String, String> headerExtensions = new HashMap<>(); for (Extension ex : pmml.getHeader().getExtensions()) { headerExtensions.put(ex.getName(), ex.getValue()); } PMMLInfo<PMMLModelInfo> info = new PMMLInfo<>(models, new PMMLHeaderInfo("<LINK_0>" + pmml.getBaseVersion().replace(".", "_"), headerExtensions)); return info; }
Source:
public void read(InputStream input, Schema inputSchema, InputBuilder messageBuilder) throws ReaderException { String inputJSONMessage; try { inputJSONMessage = readFromInputStream(input); messageBuilder.notifyWithResult(inputJSONMessage); } catch (IOException e) { throw new ReaderException("IO Error while reading input stream. " + e.getMessage()); } catch (JSException e) { throw new ReaderException("JSException while reading input stream. " + e.getMessage()); } catch (SchemaException e) { throw new ReaderException("SchemaException while reading input stream. " + e.getMessage()); } }

Target:
public void read(InputStream input, Schema inputSchema, InputBuilder messageBuilder) throws ReaderException { String inputJSONMessage; try { inputJSONMessage = readFromInputStream(input); messageBuilder.notifyWithResult(inputJSONMessage); } catch (IOException | JSException | SchemaException e) { throw new ReaderException("Error while reading input stream. " + e.getMessage()); } }
Source:
public void loadMetadata(AlluxioURI path, final ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); rpc(client -> { ListStatusPOptions mergedOptions = FileSystemOptions.listStatusDefaults( mFsContext.getPathConf(path)).toBuilder().mergeFrom(options).build(); client.listStatus(path, mergedOptions); return null; }); }

Target:
public void loadMetadata(AlluxioURI path, final ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); rpc(client -> { ListStatusPOptions mergedOptions = FileSystemOptions.listStatusDefaults( mFsContext.getPathConf(path)).toBuilder().mergeFrom(options) .setLoadMetadataType(LoadMetadataPType.ALWAYS).setResultsRequired(false).build(); client.listStatus(path, mergedOptions); return null; }); }
Source:
public void init( final Command callback ) { libraryService.call( new RemoteCallback<OrganizationalUnitRepositoryInfo>() { @Override public void callback( final OrganizationalUnitRepositoryInfo info ) { LibraryToolbarPresenter.this.info = info; view.init( LibraryToolbarPresenter.this ); setupOrganizationUnits( info ); setupRepositories( info ); selectedOrganizationalUnit = info.getSelectedOrganizationalUnit(); selectedRepository = info.getSelectedRepository(); callback.execute(); } } ).getDefaultOrganizationalUnitRepositoryInfo(); libraryPreferences.load( loadedLibraryPreferences -> { view.setOrganizationalUnitLabel( loadedLibraryPreferences.getOuAlias() ); }, parameter -> { } ); }

Target:
public void init( final Command callback ) { libraryService.call( ( OrganizationalUnitRepositoryInfo info ) -> { LibraryToolbarPresenter.this.info = info; view.init( LibraryToolbarPresenter.this ); setupOrganizationUnits( info ); setupRepositories( info ); selectedOrganizationalUnit = info.getSelectedOrganizationalUnit(); selectedRepository = info.getSelectedRepository(); callback.execute(); } ).getDefaultOrganizationalUnitRepositoryInfo(); libraryPreferences.load( loadedLibraryPreferences -> { view.setOrganizationalUnitLabel( loadedLibraryPreferences.getOuAlias() ); }, parameter -> { } ); }
Source:
public String receive() { Assert.isTrue(isRunning(),"Shell process is not started"); String data; try { byte[] buffer = serializer.deserialize(stdout); data = new String(buffer,"UTF-8"); } catch (IOException e) { throw new RuntimeException(e.getMessage(),e); } return data == null? null : data.trim(); }

Target:
public String receive() { Assert.isTrue(isRunning(), "Shell process is not started."); String data; try { byte[] buffer = serializer.deserialize(stdout); data = new String(buffer, charset); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } return data == null ? null : data.trim(); }
Source:
public void setFontSize(int fontSize) { setFontSize(FontUtils.FontType.general, fontSize); getConfig().setProperty(FONT_SIZE, fontSize); }

Target:
public void setFontSize(int fontSize) { setFontSize(FontUtils.FontType.general, fontSize); }
Source:
protected synchronized Date getDateFromTimestamp() { if (serverTimestamps != null) { EventTimeSlice myTimeStamp = serverTimestamps.get(serverName); if (myTimeStamp != null) { Date myDate = new Date(myTimeStamp.getTimeSlice()); logger.info("Previous alive timestamp was: {}", myDate); return myDate; } } return new Date(); }

Target:
protected synchronized Date getDateFromTimestamp() { if (serverTimestamp != null) { Date myDate = new Date(serverTimestamp.getTimeSlice()); logger.debug("Previous alive timestamp was: {}", myDate); return myDate; } return new Date(); }
Source:
Response getKeyMetadata() { CacheEntry<byte[], byte[]> ce = cache.getCacheEntry(key); if (ce != null) { long version = 0; EntryVersion entryVersion = ce.getMetadata().version(); if (entryVersion != null && entryVersion instanceof NumericVersion) { version = ((NumericVersion) entryVersion).getVersion(); } byte[] v = ce.getValue(); int lifespan = ce.getLifespan() < 0 ? -1 : (int) ce.getLifespan() / 1000; int maxIdle = ce.getMaxIdle() < 0 ? -1 : (int) ce.getMaxIdle() / 1000; if (header.op == HotRodOperation.GET_WITH_METADATA) { return new GetWithMetadataResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.Success, header.topologyId, v, version, ce.getCreated(), lifespan, ce.getLastUsed(), maxIdle); } else { int offset = ((Integer) operationDecodeContext).intValue(); return new GetStreamResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.Success, header.topologyId, v, offset, version, ce.getCreated(), lifespan, ce.getLastUsed(), maxIdle); } } else { if (header.op == HotRodOperation.GET_WITH_METADATA) { return new GetWithMetadataResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.KeyDoesNotExist, header.topologyId); } else { return new GetStreamResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.KeyDoesNotExist, header.topologyId); } } }

Target:
Response getKeyMetadata() { CacheEntry<byte[], byte[]> ce = cache.getCacheEntry(key); if (ce != null) { EntryVersion entryVersion = ce.getMetadata().version(); long version = extractVersion(entryVersion); byte[] v = ce.getValue(); int lifespan = ce.getLifespan() < 0 ? -1 : (int) ce.getLifespan() / 1000; int maxIdle = ce.getMaxIdle() < 0 ? -1 : (int) ce.getMaxIdle() / 1000; if (header.op == HotRodOperation.GET_WITH_METADATA) { return new GetWithMetadataResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.Success, header.topologyId, v, version, ce.getCreated(), lifespan, ce.getLastUsed(), maxIdle); } else { int offset = ((Integer) operationDecodeContext).intValue(); return new GetStreamResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.Success, header.topologyId, v, offset, version, ce.getCreated(), lifespan, ce.getLastUsed(), maxIdle); } } else { if (header.op == HotRodOperation.GET_WITH_METADATA) { return new GetWithMetadataResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.KeyDoesNotExist, header.topologyId); } else { return new GetStreamResponse(header.version, header.messageId, header.cacheName, header.clientIntel, header.op, OperationStatus.KeyDoesNotExist, header.topologyId); } } }
Source:
public @Nullable MemoizedMessage lastSeenQuery() { return lastSeenQuery; }

Target:
public MemoizedMessage lastSeenQuery() { assertNotNull(lastSeenQuery); return lastSeenQuery; }
Source:
AuthenticationResult(String accessToken, String refreshToken, Date expires, boolean isBroad, UserInfo userInfo, String tenantId, String idToken, Date extendedExpires) { mCode = null; mAccessToken = accessToken; mRefreshToken = refreshToken; mExpiresOn = expires; mIsMultiResourceRefreshToken = isBroad; mStatus = AuthenticationStatus.Succeeded; mUserInfo = userInfo; mTenantId = tenantId; mIdToken = idToken; if (extendedExpires != null) { mExtendedExpiresOn = extendedExpires; } }

Target:
AuthenticationResult(String accessToken, String refreshToken, Date expires, boolean isBroad, UserInfo userInfo, String tenantId, String idToken, Date extendedExpires) { mCode = null; mAccessToken = accessToken; mRefreshToken = refreshToken; mExpiresOn = expires; mIsMultiResourceRefreshToken = isBroad; mStatus = AuthenticationStatus.Succeeded; mUserInfo = userInfo; mTenantId = tenantId; mIdToken = idToken; mExtendedExpiresOn = extendedExpires; }
Source:
public Releaser increment() { if (refCount.getAndIncrement() <= 0) { refCount.decrementAndGet(); throw new ISE("Already closed!"); } return new Releaser() { boolean released = false; @Override public void close() { if (!released) { decrement(); released = true; } else { log.warn(new ISE("Already closed"), "Already closed"); } } }; }

Target:
public Releaser increment() { while (true) { int count = this.refCount.get(); if (count <= 0) { throw new ISE("Already closed!"); } if (refCount.compareAndSet(count, count + 1)) { break; } } return new Releaser() { boolean released = false; @Override public void close() { if (!released) { decrement(); released = true; } else { log.warn(new ISE("Already closed"), "Already closed"); } } }; }
Source:
public ChromeOptions setEnableDownloading(boolean enableDownloading, String downloadPath){ if (enableDownloading){ setCapability(ENABLE_DOWNLOADING, downloadPath); }else { setCapability(ENABLE_DOWNLOADING, ""); } return this; }

Target:
public ChromeOptions setEnableDownloading(boolean enableDownloading, String downloadPath){ if (enableDownloading) { setCapability(ENABLE_DOWNLOAD_TO, downloadPath); }else { setCapability(ENABLE_DOWNLOAD_TO, (Objects) null); } return this; }
Source:
private static void checkAccount2Enabled() { if (!isAccount2Enabled()) { throw new BadRequestException(Messages.INVALID_REQUEST); } }

Target:
private static void checkAccount2Enabled() { if (!Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2)) { throw new NotFoundException(); } }
Source:
private Map<String, Pair<WorkspaceMetacardImpl, Long>> executeWorkspaceTasks( List<WorkspaceTask> workspaceTasks, long timeout, TimeUnit timeoutUnit) { Map<String, Pair<WorkspaceMetacardImpl, Long>> results = new ConcurrentHashMap<>(); workspaceTasks .stream() .map(new ForkJoinPool(MAX_THREADS)::submit) .map(task -> getTaskResult(task, timeout, timeoutUnit)) .filter(Objects::nonNull) .forEach( pair -> results.put( pair.getLeft().getId(), new ImmutablePair<>(pair.getLeft(), pair.getRight()))); return results; }

Target:
private Map<String, Pair<WorkspaceMetacardImpl, Long>> executeWorkspaceTasks( List<WorkspaceTask> workspaceTasks, long timeout, TimeUnit timeoutUnit) { Map<String, Pair<WorkspaceMetacardImpl, Long>> results = new ConcurrentHashMap<>(); workspaceTasks .stream() .map(ForkJoinPoolFactory.getNewForkJoinPool(null, false)::submit) .map(task -> getTaskResult(task, timeout, timeoutUnit)) .filter(Objects::nonNull) .forEach( pair -> results.put( pair.getLeft().getId(), new ImmutablePair<>(pair.getLeft(), pair.getRight()))); return results; }
Source:
@Test public void userIdCausePrintTest() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TaskListener listener = new StreamTaskListener(baos); Cause causeA = new Cause.UserIdCause(null); causeA.print(listener); assertTrue(baos.toString().isEmpty()); baos.reset(); Cause causeB = new Cause.UserIdCause(); causeB.print(listener); assertThat(baos.toString(), containsString("SYSTEM")); baos.reset(); Cause causeC = new Cause.UserIdCause("abc123"); causeC.print(listener); assertTrue(baos.toString().isEmpty()); baos.reset(); }

Target:
@Test public void userIdCausePrintTest() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TaskListener listener = new StreamTaskListener(baos); Cause causeA = new Cause.UserIdCause(null); causeA.print(listener); assertEquals(baos.toString().trim(),"Started by user unknown or anonymous"); baos.reset(); Cause causeB = new Cause.UserIdCause(); causeB.print(listener); assertThat(baos.toString(), containsString("SYSTEM")); baos.reset(); Cause causeC = new Cause.UserIdCause("abc123"); causeC.print(listener); assertEquals(baos.toString().trim(),"Started by user unknown or anonymous"); baos.reset(); User user = User.getById("foo", true); Cause causeD = new Cause.UserIdCause(user.getId()); causeD.print(listener); assertThat(baos.toString(), containsString(user.getDisplayName())); baos.reset(); }
Source:
public static byte[] readBytes(int numBytes, ByteArrayInputStream inputStream) { byte[] data = new byte[numBytes]; inputStream.read(data, 0, numBytes); return data; }

Target:
public static byte[] readBytes(int numBytes, ByteArrayInputStream inputStream) { if (inputStream == null) throw new NullPointerException("Input stream cannot be null."); if (numBytes < 0) throw new IllegalArgumentException("Number of bytes to read must be great than 0."); byte[] data = new byte[numBytes]; inputStream.read(data, 0, numBytes); return data; }
Source:
protected FactModelTree createTopLevelFactModelTree(String factName, DMNType type, SortedMap<String, FactModelTree> hiddenFacts, FactModelTree.Type fmType) throws WrongDMNTypeException { return isToBeManagedAsCollection((BaseDMNTypeImpl) type) ? createFactModelTreeForCollection(new HashMap<>(), factName, type, hiddenFacts, fmType, new ArrayList<>()) : createFactModelTreeForNoCollection(new HashMap<>(), factName, factName, type.getName(), type, hiddenFacts, fmType, new ArrayList<>()); }

Target:
protected FactModelTree createTopLevelFactModelTree(String factName, DMNType type, SortedMap<String, FactModelTree> hiddenFacts, FactModelTree.Type fmType) throws WrongDMNTypeException { return isToBeManagedAsCollection(type) ? createFactModelTreeForCollection(new HashMap<>(), factName, type, hiddenFacts, fmType, new ArrayList<>()) : createFactModelTreeForNoCollection(new HashMap<>(), factName, factName, type.getName(), type, hiddenFacts, fmType, new ArrayList<>()); }
Source:
public static OSInAppMessageController getController() { OneSignalDbHelper dbHelper = OneSignal.getDBHelperInstance(); if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) { sharedInstance = new OSInAppMessageDummyController(dbHelper); } if (sharedInstance == null) sharedInstance = new OSInAppMessageController(dbHelper); return sharedInstance; }

Target:
public static OSInAppMessageController getController() { OneSignalDbHelper dbHelper = OneSignal.getDBHelperInstance(); if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) { sharedInstance = new OSInAppMessageDummyController(null); } if (sharedInstance == null) sharedInstance = new OSInAppMessageController(dbHelper); return sharedInstance; }
Source:
public void write(SerializedPage page) throws IOException { PageDataOutput pageDataOutput = new PageDataOutput(page); long writtenSize = pageDataOutput.size(); if (maxBufferedBytes - bufferedBytes < writtenSize) { dataSink.write(bufferedPages); addStripeOffset(bufferedBytes); bufferedPages.clear(); bufferedBytes = 0; retainedBytes = 0; } bufferedPages.add(pageDataOutput); bufferedBytes += writtenSize; retainedBytes += page.getRetainedSizeInBytes(); }

Target:
public void write(SerializedPage page) throws IOException { PageDataOutput pageDataOutput = new PageDataOutput(page); long writtenSize = pageDataOutput.size(); if (maxBufferedBytes - bufferedBytes < writtenSize) { flushStripe(); } bufferedPages.add(pageDataOutput); bufferedBytes += writtenSize; retainedBytes += page.getRetainedSizeInBytes(); }
Source:
public boolean addReplica(ReplicaId replicaId) { if (partitionToPartitionInfo.containsKey(replicaId.getPartitionId())) { logger.error("{} already exists in replication manager, rejecting adding replica request.", replicaId.getPartitionId()); return false; } List<? extends ReplicaId> peerReplicas = replicaId.getPeerReplicaIds(); List<RemoteReplicaInfo> remoteReplicaInfos = new ArrayList<>(); if (peerReplicas != null) { remoteReplicaInfos = populateRemoteReplicaAndPartitionInfos(peerReplicas, replicaId); } logger.info("Assigning thread for {}", replicaId.getPartitionId()); addRemoteReplicaInfoToReplicaThread(remoteReplicaInfos, true); logger.info("{} is successfully added into replication manager", replicaId.getPartitionId()); return true; }

Target:
public boolean addReplica(ReplicaId replicaId) { if (partitionToPartitionInfo.containsKey(replicaId.getPartitionId())) { logger.error("{} already exists in replication manager, rejecting adding replica request.", replicaId.getPartitionId()); return false; } List<? extends ReplicaId> peerReplicas = replicaId.getPeerReplicaIds(); List<RemoteReplicaInfo> remoteReplicaInfos = new ArrayList<>(); if (!peerReplicas.isEmpty()) { remoteReplicaInfos = createRemoteReplicaInfos(peerReplicas, replicaId); updatePartitionInfoMaps(remoteReplicaInfos, replicaId); } logger.info("Assigning thread for {}", replicaId.getPartitionId()); addRemoteReplicaInfoToReplicaThread(remoteReplicaInfos, true); logger.info("{} is successfully added into replication manager", replicaId.getPartitionId()); return true; }
Source:
public String toString() { return fTestClass.getName() + " '" + fName + "' with parameters " + Arrays.toString(fParameters); }

Target:
public String toString() { return fTestClass.getName() + " '" + fName + "' with parameters " + fParameters; }
Source:
protected void delete(Context context, UUID id) throws AuthorizeException { Item item = null; try { item = is.find(context, id); if (is.isInProgressSubmission(context, item)) { throw new UnprocessableEntityException("The item cannot be deleted. " + "It's part of a in-progress submission."); } if (item.getTemplateItemOf() != null) { throw new UnprocessableEntityException("The item cannot be deleted. " + "It's a template for a collection"); } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } try { is.delete(context, item); is.removeAllBundles(context, item); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } }

Target:
protected void delete(Context context, UUID id) throws AuthorizeException { Item item = null; try { item = is.find(context, id); if (is.isInProgressSubmission(context, item)) { throw new UnprocessableEntityException("The item cannot be deleted. " + "It's part of a in-progress submission."); } if (item.getTemplateItemOf() != null) { throw new UnprocessableEntityException("The item cannot be deleted. " + "It's a template for a collection"); } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } try { is.delete(context, item); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
private CMISSessionFacade getSessionFacade() throws Exception { if (sessionFacade == null) { sessionFacade = sessionFacadeFactory.create(); sessionFacade.initSession(); } LOG.info("getSessionFacade {}", sessionFacade); return sessionFacade; }

Target:
private CMISSessionFacade getSessionFacade() throws Exception { if (sessionFacade == null) { sessionFacade = sessionFacadeFactory.create(); sessionFacade.initSession(); } return sessionFacade; }
Source:
private static List<StringConstant> antMatchersPatterns(MethodInvocationTree mit) { List<StringConstant> argumentsAsString = mit.arguments().stream() .map(StringConstant::of) .collect(Collectors.toList()); return argumentsAsString.stream().allMatch(Objects::nonNull) ? argumentsAsString : Collections.emptyList(); }

Target:
private static List<StringConstant> antMatchersPatterns(MethodInvocationTree mit) { return mit.arguments().stream() .map(StringConstant::of) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
public ValueMatcher makeValueMatcher(String dimension,final String value) { Integer dimIndexObject = index.getDimensionIndex(dimension); if (dimIndexObject == null) { return new BooleanValueMatcher(Strings.isNullOrEmpty(value)); } final IncrementalIndex.DimDim dimDim = index.getDimension(dimension); if (!dimDim.contains(value)) { if (Strings.isNullOrEmpty(value)) { final int dimIndex = dimIndexObject; return new ValueMatcher() { @Override public boolean matches() { String[][] dims = holder.getKey().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { return true; } return false; } }; } return new BooleanValueMatcher(false); } final int dimIndex = dimIndexObject; final String id = dimDim.get(value); return new ValueMatcher() { @Override public boolean matches() { String[][] dims = holder.getKey().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { return false; } for (String dimVal : dims[dimIndex]) { if (dimDim.compareCannonicalValues(id, dimVal)) { return true; } } return Strings.isNullOrEmpty(value); } }; }

Target:
public ValueMatcher makeValueMatcher(String dimension, final String value) { Integer dimIndexObject = index.getDimensionIndex(dimension); if (dimIndexObject == null) { return new BooleanValueMatcher(Strings.isNullOrEmpty(value)); } final IncrementalIndex.DimDim dimDim = index.getDimension(dimension); if (!dimDim.contains(value)) { if (Strings.isNullOrEmpty(value)) { final int dimIndex = dimIndexObject; return new ValueMatcher() { @Override public boolean matches() { String[][] dims = holder.getKey().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { return true; } return false; } }; } return new BooleanValueMatcher(false); } final int dimIndex = dimIndexObject; final String id = dimDim.get(value); return new ValueMatcher() { @Override public boolean matches() { String[][] dims = holder.getKey().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { return Strings.isNullOrEmpty(value); } for (String dimVal : dims[dimIndex]) { if (dimDim.compareCannonicalValues(id, dimVal)) { return true; } } return false; } }; }
Source:
public void setUp() throws Exception { root = Files.createTempDirectory("jgit-security").toFile(); permissions.add(new RuntimePermission("*")); permissions.add(new SecurityPermission("*")); permissions.add(new AuthPermission("*")); permissions.add(new ReflectPermission("*")); permissions.add(new PropertyPermission("*", "read,write")); permissions.add(new LoggingPermission("control", null)); permissions.add(new FilePermission( System.getProperty("java.home") + "/-", "read")); String tempDir = System.getProperty("java.io.tmpdir"); permissions.add(new FilePermission(tempDir, "read,write,delete")); permissions .add(new FilePermission(tempDir + "/-", "read,write,delete")); String classPath = System.getProperty("java.class.path"); if (classPath != null) { for (String path : classPath.split(";")) { permissions.add(new FilePermission(path, "read")); } } String jgitSourcesRoot = new File(System.getProperty("user.dir")) .getParent(); permissions.add(new FilePermission(jgitSourcesRoot + "/-", "read")); permissions.add( new FilePermission(root.getPath() + "/-", "read,write,delete")); permissions.add(new FilePermission( System.getProperty("user.home") + "/.gitconfig", "read,write")); originalSecurityManager = System.getSecurityManager(); System.setSecurityManager(new SecurityManager() { @Override public void checkPermission(Permission requested) { for (Permission permission : permissions) { if (permission.implies(requested)) { return; } } super.checkPermission(requested); } }); }

Target:
public void setUp() throws Exception { root = Files.createTempDirectory("jgit-security").toFile(); permissions.add(new RuntimePermission("*")); permissions.add(new SecurityPermission("*")); permissions.add(new AuthPermission("*")); permissions.add(new ReflectPermission("*")); permissions.add(new PropertyPermission("*", "read,write")); permissions.add(new LoggingPermission("control", null)); permissions.add(new FilePermission( System.getProperty("java.home") + "/-", "read")); String tempDir = System.getProperty("java.io.tmpdir"); permissions.add(new FilePermission(tempDir, "read,write,delete")); permissions .add(new FilePermission(tempDir + "/-", "read,write,delete")); String classPath = System.getProperty("java.class.path"); if (classPath != null) { for (String path : classPath.split(File.pathSeparator)) { permissions.add(new FilePermission(path, "read")); } } String jgitSourcesRoot = new File(System.getProperty("user.dir")) .getParent(); permissions.add(new FilePermission(jgitSourcesRoot + "/-", "read")); permissions.add( new FilePermission(root.getPath() + "/-", "read,write,delete")); permissions.add(new FilePermission( System.getProperty("user.home") + "/.gitconfig", "read,write")); originalSecurityManager = System.getSecurityManager(); System.setSecurityManager(new SecurityManager() { @Override public void checkPermission(Permission requested) { for (Permission permission : permissions) { if (permission.implies(requested)) { return; } } super.checkPermission(requested); } }); }
Source:
private void configure(Builder<Class<?>> builder) { builder.add( AtlasModule.class, AtlasLoggingModule.class, AtlasWebModule.class, SearchModule.class, QueryModule.class, MongoContentPersistenceModule.class, CassandraPersistenceModule.class, AtlasFetchModule.class, RemoteSiteModule.class, HealthModule.class, RadioPlayerModule.class, XmlTvModule.class, RemoteSiteHealthModule.class, EquivModule.class, ChildRefUpdateModule.class ); if(runProcessingOnly()) { builder.add( ManualScheduleRebuildModule.class, InterlinkingDeltaModule.class, EquivTaskModule.class ); if (Configurer.get("youview.upload.enabled").toBoolean()) { builder.add(YouViewUploadModule.class); } builder.addAll(new RemoteSiteModuleConfigurer().enabledModules()); } else { builder.add( AtlasFeedsModule.class, QueryWebModule.class, ApplicationModule.class ); } }

Target:
private void configure(Builder<Class<?>> builder) { builder.add( AtlasModule.class, AtlasLoggingModule.class, AtlasWebModule.class, SearchModule.class, QueryModule.class, MongoContentPersistenceModule.class, CassandraPersistenceModule.class, AtlasFetchModule.class, RemoteSiteModule.class, HealthModule.class, RadioPlayerModule.class, XmlTvModule.class, RemoteSiteHealthModule.class, EquivModule.class ); if(runProcessingOnly()) { builder.add( ManualScheduleRebuildModule.class, InterlinkingDeltaModule.class, EquivTaskModule.class, ChildRefUpdateModule.class ); if (Configurer.get("youview.upload.enabled").toBoolean()) { builder.add(YouViewUploadModule.class); } builder.addAll(new RemoteSiteModuleConfigurer().enabledModules()); } else { builder.add( AtlasFeedsModule.class, QueryWebModule.class, ApplicationModule.class ); } }
Source:
void stopRegularScan(ScanClient client) { if (client == null) { return; } for (ScanClient c : mRegularScanClients) { if (c.scannerId == client.scannerId) { client = c; int deliveryMode = getDeliveryMode(client); if (deliveryMode == DELIVERY_MODE_ON_FOUND_LOST) { for (ScanFilter filter : client.filters) { int entriesToFree = getNumOfTrackingAdvertisements(client.settings); if (!manageAllocationOfTrackingAdvertisement(entriesToFree, false)) { Log.e(TAG, "Error freeing for onfound/onlost filter resources " + entriesToFree); try { mService.onScanManagerErrorCallback(client.scannerId, ScanCallback.SCAN_FAILED_INTERNAL_ERROR); } catch (RemoteException e) { Log.e(TAG, "failed on onScanManagerCallback at freeing", e); } } } } break; } } mRegularScanClients.remove(client); if (numRegularScanClients() == 0) { if (DBG) { Log.d(TAG, "stop scan"); } gattClientScanNative(false); } removeScanFilters(client.scannerId); }

Target:
void stopRegularScan(ScanClient client) { if (client == null) { return; } for (ScanClient c : mRegularScanClients) { if (c.scannerId != client.scannerId) { continue; } client = c; int deliveryMode = getDeliveryMode(client); if (deliveryMode == DELIVERY_MODE_ON_FOUND_LOST) { for (ScanFilter filter : client.filters) { int entriesToFree = getNumOfTrackingAdvertisements(client.settings); if (!manageAllocationOfTrackingAdvertisement(entriesToFree, false)) { Log.e(TAG, "Error freeing for onfound/onlost filter resources " + entriesToFree); try { mService.onScanManagerErrorCallback(client.scannerId, ScanCallback.SCAN_FAILED_INTERNAL_ERROR); } catch (RemoteException e) { Log.e(TAG, "failed on onScanManagerCallback at freeing", e); } } } } break; } mRegularScanClients.remove(client); if (numRegularScanClients() == 0) { if (DBG) { Log.d(TAG, "stop scan"); } gattClientScanNative(false); } removeScanFilters(client.scannerId); }
Source:
public static List<JavaTypeDefinition> getMethodExplicitTypeArugments(Node node) { List<JavaTypeDefinition> result = new ArrayList<>(); ASTMemberSelector memberSelector = node.getFirstChildOfType(ASTMemberSelector.class); if (memberSelector == null) { return result; } ASTTypeArguments typeArguments = memberSelector.getFirstChildOfType(ASTTypeArguments.class); if (typeArguments == null) { return result; } for (int childIndex = 0; childIndex < typeArguments.jjtGetNumChildren(); ++childIndex) { result.add(((TypeNode) typeArguments.jjtGetChild(childIndex)).getTypeDefinition()); } return result; }

Target:
public static List<JavaTypeDefinition> getMethodExplicitTypeArugments(Node node) { ASTMemberSelector memberSelector = node.getFirstChildOfType(ASTMemberSelector.class); if (memberSelector == null) { return Collections.emptyList(); } ASTTypeArguments typeArguments = memberSelector.getFirstChildOfType(ASTTypeArguments.class); if (typeArguments == null) { return Collections.emptyList(); } List<JavaTypeDefinition> result = new ArrayList<>(); for (int childIndex = 0; childIndex < typeArguments.jjtGetNumChildren(); ++childIndex) { result.add(((TypeNode) typeArguments.jjtGetChild(childIndex)).getTypeDefinition()); } return result; }