auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void reconnectDuringDestroyTest() throws Exception { Connection client = CLUSTER.newConnection(); VoltronReadWriteLock voltronReadWriteLock = new VoltronReadWriteLock(client, "crud-cm"); try (VoltronReadWriteLock.Hold localMaintenance = voltronReadWriteLock.tryWriteLock()) { if (localMaintenance == null) { throw new EntityBusyException("Unable to obtain maintenance lease for "); } EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(client); try { ClusterTierManagerClientEntity entity = ref.fetchEntity(null); entity.prepareForDestroy(); entity.close(); } catch (EntityNotFoundException e) { Assert.fail(); } setDelay(6000, proxies); Thread.sleep(6000); setDelay(0L, proxies); } voltronReadWriteLock = new VoltronReadWriteLock(client, "crud-cm"); try (VoltronReadWriteLock.Hold localMaintenance = voltronReadWriteLock.tryWriteLock()) { if (localMaintenance == null) { throw new EntityBusyException("Unable to obtain maintenance lease for "); } EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(client); try { ClusterTierManagerClientEntity entity = ref.fetchEntity(null); entity.prepareForDestroy(); entity.close(); } catch (EntityNotFoundException e) { Assert.fail(); } if (!ref.destroy()) { Assert.fail(); } } client.close(); }

Target:
public void reconnectDuringDestroyTest() throws Exception { cacheManager.close(); Connection client = null; try { client = LeasedConnectionFactory.connect(connectionURI, new Properties()); VoltronReadWriteLock voltronReadWriteLock = new VoltronReadWriteLock(client, "crud-cm"); try (VoltronReadWriteLock.Hold localMaintenance = voltronReadWriteLock.tryWriteLock()) { if (localMaintenance == null) { throw new EntityBusyException("Unable to obtain maintenance lease for " + "crud-cm"); } EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(client); try { ClusterTierManagerClientEntity entity = ref.fetchEntity(null); entity.prepareForDestroy(); entity.close(); } catch (EntityNotFoundException e) { Assert.fail(); } } setDelay(6000, proxies); Thread.sleep(6000); setDelay(0L, proxies); client = LeasedConnectionFactory.connect(connectionURI, new Properties()); voltronReadWriteLock = new VoltronReadWriteLock(client, "crud-cm"); try (VoltronReadWriteLock.Hold localMaintenance = voltronReadWriteLock.tryWriteLock()) { if (localMaintenance == null) { throw new EntityBusyException("Unable to obtain maintenance lease for " + "crud-cm"); } EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(client); try { ClusterTierManagerClientEntity entity = ref.fetchEntity(null); entity.prepareForDestroy(); entity.close(); } catch (EntityNotFoundException e) { Assert.fail("Unexpected exception " + e.getMessage()); } if (!ref.destroy()) { Assert.fail("Unexpected exception while trying to destroy cache manager"); } } } finally { client.close(); } }
Source:
public void init(Map<String, String> paramMap) { constantDelay = Utils.getLong(paramMap.get("constantDelay")); randomDelay = Utils.getLong(paramMap.get("randomDelay")); networkLoad = Utils.splitString(paramMap.get("networkLoad")); cpuLoadList = Utils.splitString(paramMap.get("cpuLoad")); memLoad = Utils.splitString(paramMap.get("memLoad")); storageDelay = Utils.splitString(paramMap.get("storageDelay")); networkBridgeName = paramMap.get("networkBridgeName"); cacheDir = paramMap.get("cacheDir"); logDir = paramMap.get("logDir") + "/" + System.currentTimeMillis(); forwardVdsmServer = paramMap.get("forwardVdsmServer"); vdsmPort = paramMap.get("vdsmPort"); vmConfAndStatsConstants = paramMap.get("vmConfAndStatsConstants"); vmConfAndStatsUpdateIntervals = paramMap.get("vmConfAndStatsUpdateIntervals"); jsonHandlersThreadsPool = Integer.valueOf(paramMap.get("jsonHandlersThreadsPool")); architectureType = paramMap.get("architectureType"); final String notLoggedMethods = paramMap.get("notLoggedMethods"); if (notLoggedMethods != null && notLoggedMethods.trim().length() > 0) { final String[] methodNames = notLoggedMethods.split(","); for (String methodName : methodNames) { notLoggedMethodSet.add(methodName.trim()); } } makeDir(cacheDir); makeDir(logDir); if (isProxyActive()) { targetServerUrl = getForwardVdsmServer() + ":" + getVdsmPort() + "/"; } }

Target:
public void init(Map<String, String> paramMap) { constantDelay = Utils.getLong(paramMap.get("constantDelay")); randomDelay = Utils.getLong(paramMap.get("randomDelay")); networkLoad = Utils.splitString(paramMap.get("networkLoad")); cpuLoadList = Utils.splitString(paramMap.get("cpuLoad")); memLoad = Utils.splitString(paramMap.get("memLoad")); storageDelay = Utils.splitString(paramMap.get("storageDelay")); networkBridgeName = paramMap.get("networkBridgeName"); cacheDir = paramMap.get("cacheDir"); logDir = paramMap.get("logDir") + "/" + System.currentTimeMillis(); forwardVdsmServer = paramMap.get("forwardVdsmServer"); vdsmPort = paramMap.get("vdsmPort"); vmConfAndStatsConstants = paramMap.get("vmConfAndStatsConstants"); vmConfAndStatsUpdateIntervals = paramMap.get("vmConfAndStatsUpdateIntervals"); jsonHandlersThreadsPool = Integer.valueOf(paramMap.get("jsonHandlersThreadsPool")); architectureType = ArchitectureType.valueOf(paramMap.get("architectureType").toUpperCase()); final String notLoggedMethods = paramMap.get("notLoggedMethods"); if (notLoggedMethods != null && notLoggedMethods.trim().length() > 0) { final String[] methodNames = notLoggedMethods.split(","); for (String methodName : methodNames) { notLoggedMethodSet.add(methodName.trim()); } } makeDir(cacheDir); makeDir(logDir); if (isProxyActive()) { targetServerUrl = getForwardVdsmServer() + ":" + getVdsmPort() + "/"; } }
Source:
protected void handlePublishUnpublish(String entryPath, String newName, boolean unpublishRequest) { if (unpublishRequest) { publish(false, entryPath); } else { if (newName == null) { publish(true, entryPath); } else { try { DockstoreTool container = containersApi.getContainerByToolPath(entryPath); DockstoreTool newContainer = new DockstoreTool(); newContainer.setMode(container.getMode()); newContainer.setName(container.getName()); newContainer.setNamespace(container.getNamespace()); newContainer.setRegistry(container.getRegistry()); newContainer.setDefaultDockerfilePath(container.getDefaultDockerfilePath()); newContainer.setDefaultCwlPath(container.getDefaultCwlPath()); newContainer.setDefaultWdlPath(container.getDefaultWdlPath()); newContainer.setDefaultCWLTestParameterFile(container.getDefaultCWLTestParameterFile()); newContainer.setDefaultWDLTestParameterFile(container.getDefaultWDLTestParameterFile()); newContainer.setIsPublished(false); newContainer.setGitUrl(container.getGitUrl()); newContainer.setToolname(newName); newContainer.setCustomdockerregistrypath(container.getCustomdockerregistrypath()); newContainer = containersApi.registerManual(newContainer); if (newContainer != null) { out("Successfully registered " + entryPath + "/" + newName); containersApi.refresh(newContainer.getId()); publish(true, newContainer.getToolPath()); } else { errorMessage("Unable to publish " + newName, Client.COMMAND_ERROR); } } catch (ApiException ex) { exceptionMessage(ex, "Unable to publish " + newName, Client.API_ERROR); } } } }

Target:
protected void handlePublishUnpublish(String entryPath, String newName, boolean unpublishRequest) { if (unpublishRequest) { publish(false, entryPath); } else { if (newName == null) { publish(true, entryPath); } else { try { DockstoreTool container = containersApi.getContainerByToolPath(entryPath); DockstoreTool newContainer = new DockstoreTool(); newContainer.setMode(container.getMode()); newContainer.setName(container.getName()); newContainer.setNamespace(container.getNamespace()); newContainer.setRegistry(container.getRegistry()); newContainer.setDefaultDockerfilePath(container.getDefaultDockerfilePath()); newContainer.setDefaultCwlPath(container.getDefaultCwlPath()); newContainer.setDefaultWdlPath(container.getDefaultWdlPath()); newContainer.setDefaultCWLTestParameterFile(container.getDefaultCWLTestParameterFile()); newContainer.setDefaultWDLTestParameterFile(container.getDefaultWDLTestParameterFile()); newContainer.setIsPublished(false); newContainer.setGitUrl(container.getGitUrl()); newContainer.setToolname(newName); newContainer.setCustomDockerRegistryPath(container.getCustomDockerRegistryPath()); newContainer = containersApi.registerManual(newContainer); if (newContainer != null) { out("Successfully registered " + entryPath + "/" + newName); containersApi.refresh(newContainer.getId()); publish(true, newContainer.getToolPath()); } else { errorMessage("Unable to publish " + newName, Client.COMMAND_ERROR); } } catch (ApiException ex) { exceptionMessage(ex, "Unable to publish " + newName, Client.API_ERROR); } } } }
Source:
public void notifyParentItemChanged(int parentPosition) { ParentListItem parentListItem = mParentItemList.get(parentPosition); int wrapperIndex = getParentWrapperIndex(parentPosition); ParentWrapper parentWrapper = (ParentWrapper) mItemList.get(wrapperIndex); parentWrapper.setParentListItem(parentListItem); int sizeChanged = 1; if (parentWrapper.isExpanded()) { List<?> childItems = parentWrapper.getChildItemList(); int childListSize = childItems.size(); for (int i = 0; i < childListSize; i++) { Object child = childItems.get(i); mItemList.set(wrapperIndex + i + 1, child); sizeChanged++; } } notifyItemRangeChanged(wrapperIndex, sizeChanged); }

Target:
public void notifyParentItemChanged(int parentPosition) { ParentListItem parentListItem = mParentItemList.get(parentPosition); int wrapperIndex = getParentWrapperIndex(parentPosition); ParentWrapper parentWrapper = (ParentWrapper) mItemList.get(wrapperIndex); parentWrapper.setParentListItem(parentListItem); int sizeChanged = 1; if (parentWrapper.isExpanded()) { List<?> childItems = parentWrapper.getChildItemList(); int childListSize = childItems.size(); Object child; for (int i = 0; i < childListSize; i++) { child = childItems.get(i); mItemList.set(wrapperIndex + i + 1, child); sizeChanged++; } } notifyItemRangeChanged(wrapperIndex, sizeChanged); }
Source:
private boolean determineIfIsObjectFactory(ExecutableElement executable) { return executable.getAnnotation(ObjectFactory.class) != null || getTargetTypeParameter() != null || parameters.isEmpty(); }

Target:
private boolean determineIfIsObjectFactory(ExecutableElement executable) { boolean hasFactoryAnnotation = ObjectFactoryPrism.getInstanceOn( executable ) != null; boolean isFactoryWithTargeTypeAnnotation = getTargetTypeParameter() != null && getSourceParameters().isEmpty(); return !returnType.isVoid() && ( hasFactoryAnnotation || isFactoryWithTargeTypeAnnotation || parameters.isEmpty() ); }
Source:
private long logStoreFiles( Logger logger, String prefix, File dir ) { if ( !dir.isDirectory() ) { return 0; } File[] files = dir.listFiles(); if ( files == null ) { logger.log( prefix + "<INACCESSIBLE>" ); return 0; } long total = 0; List<File> fileList = Arrays.asList( files ); if ( fileList.size() > MAX_DIRECTORY_LISTING_THRESHOLD ) { Collections.sort( fileList, ( o1, o2 ) -> Long.compare( totalSize( o1 ), totalSize( o2 ) ) ); } else { Collections.sort( fileList, new Comparator<File>() { @Override public int compare( File o1, File o2 ) { return o1.getName().compareTo( o2.getName() ); } } ); } int count = 0; for ( File file : fileList ) { long size; String filename = file.getName(); if ( file.isDirectory() ) { logger.log( prefix + filename + ":" ); size = logStoreFiles( logger, prefix + " ", file ); filename = "- Total"; } else { size = file.length(); } String fileModificationDate = getFileModificationDate( file ); String bytes = Format.bytes( size ); String fileInformation = String.format( "%s%s: %s - %s", prefix, filename, fileModificationDate, bytes ); logger.log( fileInformation ); total += size; if ( ++count == MAX_DIRECTORY_LISTING_THRESHOLD ) { logger.log( "%s%d smaller files or directories left out for brevity...", prefix, fileList.size() - count ); logger = NullLogger.getInstance(); } } return total; }

Target:
private long logStoreFiles( Logger logger, String prefix, File dir ) { if ( !dir.isDirectory() ) { return 0; } File[] files = dir.listFiles(); if ( files == null ) { logger.log( prefix + "<INACCESSIBLE>" ); return 0; } long total = 0; List<File> fileList = Arrays.asList( files ); Collections.sort( fileList, new Comparator<File>() { @Override public int compare( File o1, File o2 ) { return o1.getName().compareTo( o2.getName() ); } } ); for ( File file : fileList ) { long size; String filename = file.getName(); if ( file.isDirectory() ) { logger.log( prefix + filename + ":" ); size = logStoreFiles( logger, prefix + " ", file ); filename = "- Total"; } else { size = file.length(); } String fileModificationDate = getFileModificationDate( file ); String bytes = Format.bytes( size ); String fileInformation = String.format( "%s%s: %s - %s", prefix, filename, fileModificationDate, bytes ); logger.log( fileInformation ); total += size; } return total; }
Source:
public void showDocument(String url) { if (url.startsWith(IRC_JOIN_PROTOCOL)) { eventBus.post(new JoinChannelEvent(url.substring(IRC_JOIN_PROTOCOL.length() + 3))); return; } hostServices.showDocument(url); }

Target:
public void showDocument(String url) { hostServices.showDocument(url); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof EncodingMapping)) return false; EncodingMapping that = (EncodingMapping) o; return getName().equals(that.getName()); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof EncodingMapping)) return false; EncodingMapping that = (EncodingMapping) o; return this.compareTo(that) == 0; }
Source:
public Collection<DSemanticDecorator> getSelection(DialectEditor editor) { Collection<DSemanticDecorator> selection = Sets.newLinkedHashSet(); if (editor instanceof DTableEditor) { DTableEditor dEditor = (DTableEditor) editor; ISelection sel = dEditor.getSite().getSelectionProvider().getSelection(); if (sel instanceof IStructuredSelection) { Iterables.addAll(selection, Iterables.filter(((IStructuredSelection) sel).toList(), DSemanticDecorator.class)); } } return selection; }

Target:
public Collection<DSemanticDecorator> getSelection(DialectEditor editor) { Collection<DSemanticDecorator> selection = Sets.newLinkedHashSet(); if (editor instanceof DTableEditor) { DTableEditor dEditor = (DTableEditor) editor; if (editor.getSite() != null && editor.getSite().getSelectionProvider() != null) { ISelection sel = dEditor.getSite().getSelectionProvider().getSelection(); if (sel instanceof IStructuredSelection) { Iterables.addAll(selection, Iterables.filter(((IStructuredSelection) sel).toList(), DSemanticDecorator.class)); } } } return selection; }
Source:
public int hashCode() { return 31 * getResource().hashCode(); }

Target:
public int hashCode() { return getResource().hashCode(); }
Source:
public BucketNodeMap(ToIntFunction<Split> splitToBucket) { this.splitToBucket = splitToBucket; }

Target:
public BucketNodeMap(ToIntFunction<Split> splitToBucket) { this.splitToBucket = requireNonNull(splitToBucket, "splitToBucket is null"); }
Source:
private static final int getFreePort() { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } catch (IOException e) { throw new AssertionError("Can not find free port.", e); } }

Target:
private static int getFreePort() { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } catch (IOException e) { throw new AssertionError("Can not find free port.", e); } }
Source:
public void replication_conflict() throws Exception { String docId = generateUUID(); Foo foodb1 = new Foo(docId, "title"); Foo foodb2 = null; foodb1 = new Foo(docId, "titleX"); db1.save(foodb1); Response response = account.replicator().source(db1URI) .target(db2URI).replicatorDocId(docId) .save(); Utils.waitForReplicatorToComplete(account, response); foodb2 = db2.find(Foo.class, docId); foodb2.setTitle("titleY"); db2.update(foodb2); foodb1 = db1.find(Foo.class, docId); foodb1.setTitle("titleZ"); db1.update(foodb1); Response secondResponse = account.replicator().source(db1URI) .target(db2URI).save(); Utils.waitForReplicatorToComplete(account, response); ViewResult<String[], String, Foo> conflicts = db2.view("conflicts/conflict") .includeDocs(true).queryView(String[].class, String.class, Foo.class); assertThat(conflicts.getRows().size(), is(not(0))); Utils.removeReplicatorTestDoc(account, response); Utils.removeReplicatorTestDoc(account, secondResponse); }

Target:
public void replication_conflict() throws Exception { String docId = Utils.generateUUID(); Foo foodb1 = new Foo(docId, "title"); Foo foodb2 = null; foodb1 = new Foo(docId, "titleX"); db1.save(foodb1); Response response = account.replicator().source(db1URI) .target(db2URI).replicatorDocId(docId) .save(); Utils.waitForReplicatorToComplete(account, response.getId()); foodb2 = db2.find(Foo.class, docId); foodb2.setTitle("titleY"); db2.update(foodb2); foodb1 = db1.find(Foo.class, docId); foodb1.setTitle("titleZ"); db1.update(foodb1); Response secondResponse = account.replicator().source(db1URI) .target(db2URI).save(); Utils.waitForReplicatorToComplete(account, secondResponse.getId()); ViewResult<String[], String, Foo> conflicts = db2.view("conflicts/conflict") .includeDocs(true).queryView(String[].class, String.class, Foo.class); assertThat(conflicts.getRows().size(), is(not(0))); Utils.removeReplicatorTestDoc(account, response.getId()); Utils.removeReplicatorTestDoc(account, secondResponse.getId()); }
Source:
protected void initialize () { super.initialize(); writeEnters = true; linesBreak = new IntArray(); cursorLine = 0; firstLineShowing = 0; moveOffset = -1; linesShowing = 0; focusTraversal = false; }

Target:
protected void initialize () { super.initialize(); writeEnters = true; linesBreak = new IntArray(); cursorLine = 0; firstLineShowing = 0; moveOffset = -1; linesShowing = 0; }
Source:
public void start() { long startupBeginTime = System.currentTimeMillis(); try { if (!isRunning()) { if (requestWorkersCount > 0 && blobStorageService == null) { throw new IllegalStateException("BlobStorageService has not been set"); } logger.info("Starting AsyncRequestResponseHandler with request workers", requestWorkersCount); for (int i = 0; i < requestWorkersCount; i++) { long workerStartupBeginTime = System.currentTimeMillis(); AsyncRequestWorker asyncRequestWorker = new AsyncRequestWorker(restServerMetrics, blobStorageService); asyncRequestWorkers.add(asyncRequestWorker); Thread workerThread = new Thread(asyncRequestWorker); requestWorkerThreads.add(workerThread); workerThread.start(); long workerStartupTime = System.currentTimeMillis() - workerStartupBeginTime; restServerMetrics.requestWorkerStartTimeInMs.update(workerStartupTime); logger.info("AsyncRequestWorker startup took ms", workerStartupTime); } asyncResponseHandler = new AsyncResponseHandler(restServerMetrics); isRunning = true; } } finally { long startupTime = System.currentTimeMillis() - startupBeginTime; restServerMetrics.requestResponseHandlerStartTimeInMs.update(startupTime); logger.info("AsyncRequestResponseHandler start took ms", startupTime); } }

Target:
public void start() { long startupBeginTime = System.currentTimeMillis(); try { if (!isRunning()) { logger.info("Starting AsyncRequestResponseHandler with request workers", requestWorkersCount); for (int i = 0; i < requestWorkersCount; i++) { long workerStartupBeginTime = System.currentTimeMillis(); AsyncRequestWorker asyncRequestWorker = new AsyncRequestWorker(restServerMetrics, blobStorageService); asyncRequestWorkers.add(asyncRequestWorker); Utils.newThread("RequestWorker-" + i, asyncRequestWorker, false).start(); long workerStartupTime = System.currentTimeMillis() - workerStartupBeginTime; restServerMetrics.requestWorkerStartTimeInMs.update(workerStartupTime); logger.info("AsyncRequestWorker startup took ms", workerStartupTime); } asyncResponseHandler = new AsyncResponseHandler(restServerMetrics); isRunning = true; } } finally { long startupTime = System.currentTimeMillis() - startupBeginTime; restServerMetrics.requestResponseHandlerStartTimeInMs.update(startupTime); logger.info("AsyncRequestResponseHandler start took ms", startupTime); } }
Source:
private void requestLocationUpdates() { setRefreshingState(true); if (!locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) && !locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setMessage(getString(R.string.nearby_dialog_goto_settings)); alert.setPositiveButton(getString(R.string.nearby_dialog_goto_settings_ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent myIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(myIntent); } }); alert.setNegativeButton(getString(R.string.nearby_dialog_goto_settings_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { finish(); } }); alert.setCancelable(false); AlertDialog ad = alert.create(); ad.show(); } successes = 0; requestLocation(LocationManager.NETWORK_PROVIDER); requestLocation(LocationManager.GPS_PROVIDER); if (successes == 0) { Crouton.makeText(NearbyActivity.this, R.string.nearby_no_location, Style.ALERT).show(); setRefreshingState(false); } }

Target:
private void requestLocationUpdates() { setRefreshingState(true); boolean atLeastOneEnabled = false; if (!locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) { locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_MILLIS, MIN_DISTANCE_METERS, locationListener); atLeastOneEnabled = true; } if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME_MILLIS, MIN_DISTANCE_METERS, locationListener); atLeastOneEnabled = true; } if (!atLeastOneEnabled) { showDialogForSettings(); } }
Source:
public PrefixProvider getPrefixProvider(String prefix) { if (StringUtils.isBlank(prefix)) { return null; } if (prefix.startsWith(CONFIGURATION_PREFIX)) { String prefixProviderBean = ""; try { prefixProviderBean = prefix.substring(prefix.indexOf(":") + 1).trim(); return Context.getRegisteredComponent(prefixProviderBean, PrefixProvider.class); } catch (IndexOutOfBoundsException e) { log.error("Invalid Prefix Configuration. PrefixProvider bean name not provided", e); } catch (APIException e) { log.error("Failed to retrieve PrefixProvider:" + prefixProviderBean, e); } } return null; }

Target:
public PrefixProvider getPrefixProvider(String prefix) throws APIException { if (StringUtils.isBlank(prefix)) { return new ConstantPrefixProvider(""); } if (prefix.startsWith(CONFIGURATION_PREFIX)) { String beanName = StringUtils.substringAfter(prefix, ":"); try { return Context.getRegisteredComponent(beanName, PrefixProvider.class); } catch (Exception e) { throw new APIException( "Invalid prefix configuration. The " + PrefixProvider.class.getSimpleName() + " bean name ('" + beanName + "') could not be resolved.", e); } } return new ConstantPrefixProvider(prefix); }
Source:
public FileMailQueue(MailQueueItemDecoratorFactory mailQueueItemDecoratorFactory, File parentDir, String queuename, boolean sync) throws IOException { this.mailQueueItemDecoratorFactory = mailQueueItemDecoratorFactory; this.sync = sync; this.queueName = queuename; this.queueDir = new File(parentDir, queueName); this.queueDirName = queueDir.getAbsolutePath(); StandardAnalyzer analyzer = new StandardAnalyzer(); this.indexWriter = new IndexWriter(FSDirectory.open(new File(queueDir, "index").toPath()), new IndexWriterConfig(analyzer)); init(); }

Target:
public FileMailQueue(MailQueueItemDecoratorFactory mailQueueItemDecoratorFactory, File parentDir, String queuename, boolean sync) throws IOException { this.mailQueueItemDecoratorFactory = mailQueueItemDecoratorFactory; this.sync = sync; this.queueName = queuename; this.queueDir = new File(parentDir, queueName); this.queueDirName = queueDir.getAbsolutePath(); this.mailQueueIndex = new MailQueueIndex(new File(queueDir, "index")); init(); }
Source:
void setupBuilder() throws IOException { final int numReads = 10000; final String flowCellBarcode = "TESTBARCODE"; final int maxX = 10000; final int maxY = 20000; final int minX = 1000; final int minY = 2000; final String separator = ":"; final int lane = 1; final int tile = 2203; final Random rg = new Random(31); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true); for (int i = 0; i < numReads; i++) { final int x = rg.nextInt(maxX) + minX; final int y = rg.nextInt(maxY) + minY; final String readName = flowCellBarcode + separator + lane + separator + tile + separator + x + separator + y; setBuilder.addPair(readName, 1, 1, 100); } tempDir = IOUtil.createTempDir("pds_test", "PositionalDownsampling"); tempSamFile = File.createTempFile("PositionalDownsampleSam", ".bam", tempDir); BufferedLineReader bufferedLineReader = null; try { bufferedLineReader = new BufferedLineReader(new FileInputStream(dict)); } catch (FileNotFoundException e) { e.printStackTrace(); } final SAMTextHeaderCodec codec = new SAMTextHeaderCodec(); final SAMFileHeader header = codec.decode(bufferedLineReader, dict.toString()); readGroupRecord.setSample(sample); readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addReadGroup(readGroupRecord); setBuilder.setHeader(header); final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(true).makeBAMWriter(header, false, tempSamFile); for (final SAMRecord record : setBuilder) { writer.addAlignment(record); } writer.close(); }

Target:
void setupBuilder() throws IOException { final int numReads = 10000; final String flowCellBarcode = "TESTBARCODE"; final String separator = ":"; final int lane = 1; final int tile = 2203; final Random rg = new Random(31); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true); for (int i = 0; i < numReads; i++) { final String readName = flowCellBarcode + separator + lane + separator + tile + separator + i; setBuilder.addPair(readName, 1, 1, 100); } tempDir = IOUtil.createTempDir("ds_test", "Downsampling"); tempSamFile = File.createTempFile("DownsampleSam", ".bam", tempDir); BufferedLineReader bufferedLineReader = null; try { bufferedLineReader = new BufferedLineReader(new FileInputStream(dict)); } catch (FileNotFoundException e) { e.printStackTrace(); } final SAMTextHeaderCodec codec = new SAMTextHeaderCodec(); final SAMFileHeader header = codec.decode(bufferedLineReader, dict.toString()); readGroupRecord.setSample(sample); readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addReadGroup(readGroupRecord); setBuilder.setHeader(header); final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(true).makeBAMWriter(header, false, tempSamFile); for (final SAMRecord record : setBuilder) { writer.addAlignment(record); } writer.close(); }
Source:
public void start(AbstractProject project, boolean newInstance) { logger.debug("Start project: {}", project); super.start(project, newInstance); initializeTriggerOnEvents(); this.myProject = project; try { if (PluginImpl.getInstance() != null) { PluginImpl.getInstance().getServer(serverName).addListener(this); } else { logger.warn("The server instance could not be found! Project will not be triggered!", project.getFullDisplayName()); } } catch (IllegalStateException e) { logger.error("I am too early!", e); } if (dynamicTriggerConfiguration) { gerritTriggerTimerTask = new GerritTriggerTimerTask(this); } }

Target:
public void start(AbstractProject project, boolean newInstance) { logger.debug("Start project: {}", project); super.start(project, newInstance); initializeTriggerOnEvents(); this.myProject = project; try { if (PluginImpl.getInstance() != null && PluginImpl.getInstance().getServer(serverName) != null) { PluginImpl.getInstance().getServer(serverName).addListener(this); } else { logger.warn("The server could not be found! Project will not be triggered!", serverName, project.getFullDisplayName()); } } catch (IllegalStateException e) { logger.error("I am too early!", e); } if (dynamicTriggerConfiguration) { gerritTriggerTimerTask = new GerritTriggerTimerTask(this); } GerritProjectList.removeTriggerFromProjectList(this); if (allowTriggeringUnreviewedPatches) { for (GerritProject p : gerritProjects) { GerritProjectList.addProject(p, this); } } }
Source:
protected void rotateOutputFile () throws IOException { synchronized (lock) { cleanup(); rotation++; Path path = new Path(this.path, this.name + "-" + rotation); this.out = this.fileSystem.create(path); } }

Target:
protected void rotateOutputFile () throws IOException { cleanup(); rotation++; Path path = new Path(this.path, this.name + "-" + rotation); this.out = this.fileSystem.create(path); }
Source:
public static <TResult> Task<TResult> callInBackground(Callable<TResult> callable) { return callInBackground(callable, null); }

Target:
public static <TResult> Task<TResult> callInBackground(Callable<TResult> callable) { return call(callable, BACKGROUND_EXECUTOR, null); }
Source:
public void testWithNoParameterProvidedInRequest() throws Exception { servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); LOG.info("output = {}",output); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob","charly","admin","anonymous"); }

Target:
public void testWithNoParameterProvidedInRequest() throws Exception { servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob","charly","admin","anonymous"); }
Source:
public static void process(@Nonnull Options options) { File binaryFile = options.getBinaryFile(); JavaTransformer jt = new JavaTransformer(getVersion().getVersion(), options); if (binaryFile.isFile()) { if (FileUtils.isJavaBinaryFile(binaryFile)) { List<File> javaBinaryFiles = new ArrayList<File>(); javaBinaryFiles.add(binaryFile); jt.transform(javaBinaryFiles); } else if (FileUtils.isJarFile(binaryFile)) { JarFile jarFile = null; try { jarFile = new JarFile(binaryFile); jt.transform(jarFile); } catch (IOException e) { throw new JillException("Failed to create jar file " + binaryFile.getName(), e); } finally { if (jarFile != null) { try { jarFile.close(); } catch (IOException e) { throw new JillException("Error closing jar " + binaryFile.getName(), e); } } } } else { throw new JillException("Unsupported file type: " + binaryFile.getName()); } } else { List<File> javaBinaryFiles = new ArrayList<File>(); try { FileUtils.getJavaBinaryFiles(binaryFile, javaBinaryFiles); } catch (ListDirException e) { throw new JillException(e); } jt.transform(javaBinaryFiles); } }

Target:
public static void process(@Nonnull Options options) { File binaryFile = options.getBinaryFile(); JavaTransformer jt = new JavaTransformer(getVersion().getVersion(), options); if (binaryFile.isFile()) { if (FileUtils.isJavaBinaryFile(binaryFile)) { List<File> javaBinaryFiles = new ArrayList<File>(); javaBinaryFiles.add(binaryFile); jt.transform(javaBinaryFiles); } else if (FileUtils.isJarFile(binaryFile)) { JarFile jarFile = null; try { jarFile = new JarFile(binaryFile); jt.transform(jarFile); } catch (IOException e) { throw new JillException("Failed to create jar file " + binaryFile.getName(), e); } finally { if (jarFile != null) { try { jarFile.close(); } catch (IOException e) { } } } } else { throw new JillException("Unsupported file type: " + binaryFile.getName()); } } else { List<File> javaBinaryFiles = new ArrayList<File>(); try { FileUtils.getJavaBinaryFiles(binaryFile, javaBinaryFiles); } catch (ListDirException e) { throw new JillException(e); } jt.transform(javaBinaryFiles); } }
Source:
public boolean execute(BuildCommand command, BuildSession buildSession) { File workingDir = buildSession.resolveRelativeDir(command.getWorkingDirectory()); if (!workingDir.isDirectory()) { String message = "Working directory \"" + workingDir.getAbsolutePath() + "\" is not a directory!"; LOG.error(message); buildSession.println(message); return false; } String cmd = command.getStringArg("command"); String[] args = command.getArrayArg("args"); Map<String, String> secrets = buildSession.getSecretSubstitutions(); Set<String> leftSecrets = new HashSet<>(secrets.keySet()); CommandLine commandLine = createCommandLine(cmd); for (String arg : args) { if(secrets.containsKey(arg)) { leftSecrets.remove(arg); commandLine.withArg(new SubstitutableCommandArgument(arg, secrets.get(arg))); } else { commandLine.withArg(arg); } } for (String secret: leftSecrets) { commandLine.withNonArgSecret(new SecretSubstitution(secret, secrets.get(secret))); } commandLine.withWorkingDir(workingDir); commandLine.withEnv(buildSession.getEnvs()); if (command.getExecInput() == null) { return executeCommandLine(buildSession, commandLine) == 0; } else { return executeCommandLine(buildSession, commandLine, command.getExecInput()) == 0; } }

Target:
public boolean execute(BuildCommand command, BuildSession buildSession) { File workingDir = buildSession.resolveRelativeDir(command.getWorkingDirectory()); if (!workingDir.isDirectory()) { String message = "Working directory \"" + workingDir.getAbsolutePath() + "\" is not a directory!"; LOG.error(message); buildSession.println(message); return false; } String cmd = command.getStringArg("command"); String[] args = command.getArrayArg("args"); Map<String, String> secrets = buildSession.getSecretSubstitutions(); Set<String> leftSecrets = new HashSet<>(secrets.keySet()); CommandLine commandLine = createCommandLine(cmd); for (String arg : args) { if(secrets.containsKey(arg)) { leftSecrets.remove(arg); commandLine.withArg(new SubstitutableCommandArgument(arg, secrets.get(arg))); } else { commandLine.withArg(arg); } } for (String secret: leftSecrets) { commandLine.withNonArgSecret(new SecretSubstitution(secret, secrets.get(secret))); } commandLine.withWorkingDir(workingDir); commandLine.withEnv(buildSession.getEnvs()); commandLine.withEnv(command.getCommandEnvVars()); return executeCommandLine(buildSession, commandLine, command.getExecInput()) == 0; }
Source:
public NavigationResult getPrerequisiteCommands(UIContext context) { NavigationResultBuilder builder = NavigationResultBuilder.create(); Project project = getSelectedProject(context); if (project != null) { if (!project.hasFacet(CDIFacet.class)) { builder.add(CDISetupCommandImpl.class); } } return builder.build(); }

Target:
public NavigationResult getPrerequisiteCommands(UIContext context) { NavigationResultBuilder builder = NavigationResultBuilder.create(); Project project = getSelectedProject(context); if (project != null) { if (!project.hasFacet(CDIFacet.class)) { builder.add(CDISetupCommand.class); } } return builder.build(); }
Source:
public Set<Seat> getSeatsByTeamName(String teamName) { Set<Seat> seats = new HashSet<>(); Team team = teamService.getTeamByTeamname(teamName).orElseThrow(() -> new TeamNotFoundException(teamName)); for (User user : team.getMembers()) { Optional<Seat> seat = seatRespository.findByTicketOwnerUsername(user.getUsername()); if (seat.isPresent()) { seats.add(seat.get()); } } return seats; }

Target:
public List<Seat> getSeatsByTeamName(String teamName) { Team team = teamService.getTeamByTeamname(teamName).orElseThrow(() -> new TeamNotFoundException(teamName)); return team.getMembers().stream(). map(User::getUsername). map(seatRepository::findByTicketOwnerUsername). flatMap(Collection::stream). collect(Collectors.toList()); }
Source:
private void sendMessage(String registrationToken, UUID deviceAnonymizedId, Message firebaseMessage) { try { if (yonaProperties.getFirebase().isEnabled()) { logger.info("Sending Firebase message"); firebaseMessaging.send(firebaseMessage); } else { logger.info("Firebase message not sent because Firebase is disabled"); lastMessageByRegistrationToken.put(registrationToken, MessageData.createInstance(MDC.getCopyOfContextMap(), firebaseMessage)); } } catch (FirebaseMessagingException e) { if (FIREBASE_ID_NOT_REGISTERED.equals(e.getErrorCode())) { handleNotRegisteredDevice(deviceAnonymizedId); return; } throw FirebaseServiceException.couldNotSendMessage(e); } }

Target:
private void sendMessage(String registrationToken, UUID deviceAnonymizedId, Message firebaseMessage) { try { if (yonaProperties.getFirebase().isEnabled()) { logger.info("Sending Firebase message"); firebaseMessaging.send(firebaseMessage); } else { logger.info("Firebase message not sent because Firebase is disabled"); storeForTestability(registrationToken, firebaseMessage); } } catch (FirebaseMessagingException e) { if (FIREBASE_ID_NOT_REGISTERED.equals(e.getErrorCode())) { handleNotRegisteredDevice(deviceAnonymizedId); return; } throw FirebaseServiceException.couldNotSendMessage(e); } }
Source:
private String convertToMgdl(String bg) { int i; String new_bg = new String[bg.length]; for (i=0; i < bg.length; i++) { new_bg[i] = Float.toString(18 * Float.parseFloat(bg[i])); } return new_bg; }

Target:
private String convertToMgdl(String bg) { String new_bg = new String[bg.length]; for (int i = 0; i < bg.length; i++) { new_bg[i] = Float.toString(18 * Float.parseFloat(bg[i])); } return new_bg; }
Source:
private void createMultipleValuedReferenceWidget(EEFWidgetFactory widgetFactory) { ScrolledComposite scrolledComposite = widgetFactory.createScrolledComposite(reference, SWT.NONE); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; scrolledComposite.setLayoutData(gridData); final int clientWidth = scrolledComposite.getClientArea().width; this.tableViewer = new TableViewer(scrolledComposite, SWT.READ_ONLY | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI); this.table = tableViewer.getTable(); this.table.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); this.tableViewer.setContentProvider(ArrayContentProvider.getInstance()); this.tableViewer.setLabelProvider(new EEFTableReferencesLabelProvider()); scrolledComposite.setContent(table); int defaultHeight = DEFAULT_HEIGHT; List<EEFWidgetAction> actions = description.getActions(); if (actions != null && actions.size() > 0) { defaultHeight = defaultHeight * (actions.size() + 1); } table.setSize(clientWidth, defaultHeight); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setAlwaysShowScrollBars(true); }

Target:
private void createMultipleValuedReferenceWidget(EEFWidgetFactory widgetFactory) { ScrolledComposite scrolledComposite = widgetFactory.createScrolledComposite(reference, SWT.NONE); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; scrolledComposite.setLayoutData(gridData); final int clientWidth = scrolledComposite.getClientArea().width; this.tableViewer = new TableViewer(scrolledComposite, SWT.READ_ONLY | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI); this.table = tableViewer.getTable(); this.table.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); this.tableViewer.setContentProvider(ArrayContentProvider.getInstance()); this.tableViewer.setLabelProvider(new EEFTableReferencesLabelProvider()); scrolledComposite.setContent(table); List<EEFWidgetAction> actions = description.getActions(); if (actions != null && actions.size() > 0) { widgetHeight = widgetHeight * (actions.size() + 1); } table.setSize(clientWidth, widgetHeight); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setAlwaysShowScrollBars(true); }
Source:
public void onItemDeleteClick(int position, String listName) { String dialogContent = getString(R.string.confirm_deletion_message) + " \"" + listName + "\"?"; deleteListDialog.dialog.setContent(dialogContent); deleteListDialog.show(position); }

Target:
public void onItemDeleteClick(int position, String listName) { deleteListDialog.presentForList(position, listName); }
Source:
private DnsSRVResult validateLdapServers(String domainName) throws ManageDomainsResult { LdapSRVLocator locator = new LdapSRVLocator(); DnsSRVResult ldapDnsResult = null; boolean foundServers = true; try { ldapDnsResult = locator.getLdapServers(domainName); if (ldapDnsResult.getNumOfValidAddresses() == 0) { foundServers = false; } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate LDAP servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_LDAP_SERVERS_FOR_DOMAIN, domainName); } return ldapDnsResult; }

Target:
private DnsSRVResult validateLdapServers(String domainName) throws ManageDomainsResult { LdapSRVLocator locator = new LdapSRVLocator(); DnsSRVResult ldapDnsResult = null; boolean foundServers = true; try { ldapDnsResult = locator.getLdapServers(domainName); if (ldapDnsResult == null || ldapDnsResult.getNumOfValidAddresses() == 0) { foundServers = false; } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate LDAP servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_LDAP_SERVERS_FOR_DOMAIN, domainName); } return ldapDnsResult; }
Source:
public String getModifiedIndex() { Calendar cal= Calendar.getInstance(); Objects.requireNonNull(eventIndexName, "null value"); if(!eventIndexName.equals("opennms")) { return String.format("%s-%s" , eventIndexName,INDEX_PREFIX) ; } return INDEX_PREFIX; }

Target:
private String getModifiedIndex() { if (!eventIndexName.isEmpty()) { return String.format("%s-%s", eventIndexName, INDEX_PREFIX); } return INDEX_PREFIX; }
Source:
public void testRunBulkOperation() throws Exception { DocumentModel model = session.getDocument(new PathRef("/default-domain/workspaces/test")); String nxql = String.format("SELECT * from Document where ecm:parentId='%s'", model.getId()); BulkStatus status = service.runOperation(new BulkCommand().withQuery(nxql).withOperation("count")); assertNotNull(status); assertEquals(SCHEDULED, status.getState()); LogManager manager = Framework.getService(StreamService.class).getLogManager("bulk"); LogTailer<Record> tailer = manager.createTailer("counter", "output"); for (int i = 1; i <= 10; i++) { LogRecord<Record> logRecord = tailer.read(Duration.ofSeconds(1)); assertEquals(i, new BigInteger(logRecord.message().data).intValue()); } status = service.getStatus(status.getUUID()); assertNotNull(status); assertEquals(COMPLETED, status.getState()); assertNotNull(status.getScrolledDocumentCount()); assertEquals(10, status.getScrolledDocumentCount().longValue()); }

Target:
public void testRunBulkOperation() throws Exception { DocumentModel model = session.getDocument(new PathRef("/default-domain/workspaces/test")); String nxql = String.format("SELECT * from Document where ecm:parentId='%s'", model.getId()); BulkStatus status = service.runOperation(new BulkCommand().withQuery(nxql).withOperation("count")); assertNotNull(status); assertEquals(SCHEDULED, status.getState()); LogManager manager = Framework.getService(StreamService.class).getLogManager("bulk"); try (LogTailer<Record> tailer = manager.createTailer("counter", "output")) { for (int i = 1; i <= 10; i++) { LogRecord<Record> logRecord = tailer.read(Duration.ofSeconds(1)); assertEquals(i, new BigInteger(logRecord.message().data).intValue()); } } status = service.getStatus(status.getUUID()); assertNotNull(status); assertEquals(COMPLETED, status.getState()); assertNotNull(status.getScrolledDocumentCount()); assertEquals(10, status.getScrolledDocumentCount().longValue()); }
Source:
public String translate(List<SourceFile> closureSource) throws Exception { final CompilerOptions options = new CompilerOptions(); options.setRenamingPolicy( VariableRenamingPolicy.OFF, PropertyRenamingPolicy.OFF); for (Class<? extends CompilerPass> pass : new Class[] { ConvertToTypedES6.class, ConvertToES6Classes.class, MoveMembersOutOfConstructor.class, RemoveFunctionBodies.class, }) { options.addCustomPass(BEFORE_CHECKS, pass.getConstructor(AbstractCompiler.class).newInstance(compiler)); } options.setTranspileOnly(true); options.setPrettyPrint(true); Result result = compiler.compile(Collections.<SourceFile>emptyList(), closureSource, options); if (!result.success) { throw new RuntimeException("Compile failed: " + Arrays.toString(result.errors)); } Node scriptNode = Iterables.getOnlyElement(compiler.getJsRoot().children()); final CodePrinter.Builder builder = new CodePrinter.Builder(scriptNode); builder.setCompilerOptions(options); builder.setCodeGeneratorFactory(new CodeGeneratorFactory() { @Override public CodeGenerator getCodeGenerator(Format outputFormat, CodeConsumer mcp) { return new DTSCodeGenerator(mcp, options); } }); return builder.build(); }

Target:
public String translate(List<SourceFile> closureSource) throws Exception { final CompilerOptions options = buildOptions(); Result result = compiler.compile(Collections.<SourceFile>emptyList(), closureSource, options); if (!result.success) { throw new RuntimeException("Compile failed: " + Arrays.toString(result.errors)); } Node scriptNode = Iterables.getOnlyElement(compiler.getJsRoot().children()); final CodePrinter.Builder builder = new CodePrinter.Builder(scriptNode); builder.setCompilerOptions(options); builder.setCodeGeneratorFactory(new CodeGeneratorFactory() { @Override public CodeGenerator getCodeGenerator(Format outputFormat, CodeConsumer mcp) { return new DTSCodeGenerator(mcp, options); } }); return builder.build(); }
Source:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; }else if (parent instanceof CASTIdExpression) { IASTNode grandparent = parent.getParent(); if ( grandparent instanceof CASTArraySubscriptExpression){ return super.rwAnyNode(parent, 1); }else if ( grandparent instanceof CASTUnaryExpression && ((CASTUnaryExpression)grandparent).getOperator() == IASTUnaryExpression.op_star) { return WRITE; } } return super.rwAnyNode(node, indirection); }

Target:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; } else if (parent instanceof IASTIdExpression) { IASTNode grandparent = parent.getParent(); if (grandparent instanceof IASTArraySubscriptExpression) { return super.rwAnyNode(parent, 1); } else if (grandparent instanceof IASTUnaryExpression && ((CASTUnaryExpression) grandparent).getOperator() == IASTUnaryExpression.op_star) { return WRITE; } } return super.rwAnyNode(node, indirection); }
Source:
public void notifyRcsAutoConfigurationReceived(int subId, @NonNull byte[] config, boolean isCompressed) { try { IImsConfig configBinder = getImsConfig(getSlotIndex(subId), ImsFeature.FEATURE_RCS); if (configBinder == null) { Rlog.e(LOG_TAG, "null result for getImsConfig"); } else { configBinder.notifyRcsAutoConfigurationReceived(config, isCompressed); } } catch (RemoteException e) { Rlog.e(LOG_TAG, "fail to getImsConfig " + e.getMessage()); } }

Target:
public void notifyRcsAutoConfigurationReceived(int subId, @NonNull byte[] config, boolean isCompressed) { TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege( mApp, subId, "notifyRcsAutoConfigurationReceived"); try { IImsConfig configBinder = getImsConfig(getSlotIndex(subId), ImsFeature.FEATURE_RCS); if (configBinder == null) { Rlog.e(LOG_TAG, "null result for getImsConfig"); } else { configBinder.notifyRcsAutoConfigurationReceived(config, isCompressed); } } catch (RemoteException e) { Rlog.e(LOG_TAG, "fail to getImsConfig " + e.getMessage()); } }