auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void loadPlugins() { File[] pluginFiles = pluginDirectory.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isFile() && (pathname.getName().toLowerCase().endsWith(".jar") || pathname.getName().toLowerCase().endsWith(".zip")); } }); if (pluginFiles != null) { List<File> pluginFileList = new ArrayList<>(); ProductBodyguard productBodyguard = new ProductBodyguard(); for (File f:pluginFiles) { if (!productBodyguard.isKnown(f)) { SoapUI.log.warn("Plugin '" + f.getName() + "' is not loaded since it's not approved by SmartBear Software."); } else { pluginFileList.add(f); } } resolver = null; try { resolver = new PluginDependencyResolver(pluginLoader, pluginFileList); pluginFileList = resolver.determineLoadOrder(); } catch (Exception e) { log.error("Couldn't resolve plugin dependency order. This may impair plugin functionality.", e); } long startTime = System.currentTimeMillis(); getForkJoinPool().invoke(new LoadPluginsTask(pluginFileList)); long timeTaken = System.currentTimeMillis() - startTime; log.info(pluginFileList.size() + " plugins loaded in " + timeTaken + " ms"); } }

Target:
public void loadPlugins() { File[] pluginFiles = pluginDirectory.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isFile() && (pathname.getName().toLowerCase().endsWith(".jar") || pathname.getName().toLowerCase().endsWith(".zip")); } }); if (pluginFiles != null) { List<File> pluginFileList = new ArrayList<>(); ProductBodyguard productBodyguard = new ProductBodyguard(); for (File f:pluginFiles) { if (!productBodyguard.isKnown(f)) { SoapUI.log.warn("Plugin '" + f.getName() + "' is not loaded because it hasn't been signed by SmartBear Software."); } else { pluginFileList.add(f); } } resolver = null; try { resolver = new PluginDependencyResolver(pluginLoader, pluginFileList); pluginFileList = resolver.determineLoadOrder(); } catch (Exception e) { log.error("Couldn't resolve plugin dependency order. This may impair plugin functionality.", e); } long startTime = System.currentTimeMillis(); getForkJoinPool().invoke(new LoadPluginsTask(pluginFileList)); long timeTaken = System.currentTimeMillis() - startTime; log.info(pluginFileList.size() + " plugins loaded in " + timeTaken + " ms"); } }
Source:
private static void warningMessage (String message, String[] args, boolean strict) { if (strict) { String f = message.replace("{}", "%s"); String result = String.format(f, args[0], args[1], args[2]); throw new RuntimeException(result); } else { log.warn(message, args); } }

Target:
private static void warningMessage(String message, String[] args, boolean strict) { if (strict) { String f = message.replace("{}", "%s"); String result = String.format(f, args); throw new SystemException(result); } else { log.warn(message, args); } }
Source:
public Map<String, RestStatusDto> deleteSurveyById( @PathVariable("id") Long surveyId) { final Map<String, RestStatusDto> response = new HashMap<String, RestStatusDto>(); Survey survey = surveyDao.getByKey(surveyId); RestStatusDto statusDto = null; statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (survey != null) { try { qDao.delete(qDao.listQuestionsBySurvey(surveyId)); qgDao.delete(qgDao.listQuestionGroupBySurvey(surveyId)); surveyDao.delete(survey); statusDto.setStatus("ok"); } catch (IllegalDeletionException e) { statusDto.setStatus("failed"); statusDto.setMessage(e.getMessage()); } } response.put("meta", statusDto); return response; }

Target:
public Map<String, RestStatusDto> deleteSurveyById( @PathVariable("id") Long surveyId) { final Map<String, RestStatusDto> response = new HashMap<String, RestStatusDto>(); Survey survey = surveyDao.getByKey(surveyId); RestStatusDto statusDto = null; statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (survey != null) { try { TaskOptions deleteSurveyTask = TaskOptions.Builder.withUrl("/app_worker/surveytask") .param(SurveyTaskRequest.ACTION_PARAM, SurveyTaskRequest.DELETE_SURVEY_ACTION) .param(SurveyTaskRequest.ID_PARAM, surveyId.toString()); QueueFactory.getQueue("deletequeue").add(deleteSurveyTask); statusDto.setStatus("ok"); statusDto.setMessage("deleted"); } catch (Exception e) { statusDto.setStatus("failed"); statusDto.setMessage(e.getMessage()); } } response.put("meta", statusDto); return response; }
Source:
private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration:\n{}", ovfEntityData.getOvfData()); log.error("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }

Target:
private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: '{}':\n{}", ovfEntityData.getOvfData(), e.getMessage()); log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }
Source:
public void updateNextScheduleTime(int schedId, ScheduleTime nextTime) throws ResourceNotFoundException { int n = dao.updateNextScheduleTime(schedId, nextTime.getRunTime().getEpochSecond(), nextTime.getTime().getEpochSecond()); if (n <= 0) { throw new ResourceNotFoundException("schedule id=" + schedId); } }

Target:
public void updateNextScheduleTime(int schedId, ScheduleTime nextTime) throws ResourceNotFoundException { int n = dao.updateNextScheduleTime(schedId, nextTime.getRunTime().getEpochSecond(), nextTime.getTime().getEpochSecond()); assert n >= 0; if (n <= 0) { throw new ResourceNotFoundException("schedule id=" + schedId); } }
Source:
public void handleFailure() { log.error("Failed child command status for step '{}'", getParameters().getCommandStep()); }

Target:
public void handleFailure() { log.error("Command id: '{} failed child command status for step '{}'", getCommandId(), getParameters().getCommandStep()); }
Source:
private void doShareWith(String shareeName, String dataAuthority) { int lastPointIndex = dataAuthority.lastIndexOf("."); String type = dataAuthority.substring(lastPointIndex + 1); ShareType shareType = null; switch (type) { case UsersAndGroupsSearchProvider.USER: shareType = ShareType.USER; break; case UsersAndGroupsSearchProvider.GROUP: shareType = ShareType.GROUP; break; case UsersAndGroupsSearchProvider.REMOTE: shareType = ShareType.FEDERATED; break; } getFileOperationsHelper().shareFileWithSharee( getFile(), shareeName, shareType, getAppropiatePermissions(shareType.equals(ShareType.FEDERATED)) ); }

Target:
private void doShareWith(String shareeName, String dataAuthority) { ShareType shareType = UsersAndGroupsSearchProvider.getShareType(dataAuthority); getFileOperationsHelper().shareFileWithSharee( getFile(), shareeName, shareType, getAppropiatePermissions(shareType) ); }
Source:
public P getItemByBranchName(@NonNull String branchName) { BranchProjectFactory<P, R> factory = getProjectFactory(); for (P p: getItems()) { if (factory.isProject(p) && branchName.equals(factory.getBranch(p).getName())) { return p; } } return null; }

Target:
public P getItemByBranchName(@NonNull String branchName) { BranchProjectFactory<P, R> factory = getProjectFactory(); P item = getItem(NameMangler.apply(branchName)); if (item != null && factory.isProject(item) && branchName.equals(factory.getBranch(item).getName())) { return item; } for (P p: getItems()) { if (factory.isProject(p) && branchName.equals(factory.getBranch(p).getName())) { return p; } } return null; }
Source:
public LogOffset commit(LogPartition partition) { TopicPartition topicPartition = new TopicPartition(prefix + partition.name(), partition.partition()); Long offset = lastOffsets.get(topicPartition); if (offset == null) { log.debug("unchanged partition, nothing to commit: " + partition); return null; } offset += 1; consumer.commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(offset))); LogOffset ret = new LogOffsetImpl(partition, offset); if (log.isDebugEnabled()) { log.info("Committed: " + offset + "/" + group); } return ret; }

Target:
public LogOffset commit(LogPartition partition) { TopicPartition topicPartition = new TopicPartition(prefix + partition.name(), partition.partition()); Long offset = lastOffsets.get(topicPartition); if (offset == null) { if (log.isDebugEnabled()) { log.debug("unchanged partition, nothing to commit: " + partition); } return null; } offset += 1; consumer.commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(offset))); LogOffset ret = new LogOffsetImpl(partition, offset); if (log.isInfoEnabled()) { log.info("Committed: " + offset + "/" + group); } return ret; }
Source:
private boolean monitor() { if (!monitoring_) return false; if (BrowseCap.isWindowsDesktop()) { double ratio = WindowEx.get().getDevicePixelRatio(); editor_.setScrollSpeed(ACE_EDITOR_DEFAULT_SCROLL_SPEED / ratio); } return true; }

Target:
private boolean monitor() { if (!monitoring_) return false; if (BrowseCap.isWindowsDesktop()) { double ratio = WindowEx.get().getDevicePixelRatio(); if (devicePixelRatio_ != ratio) { devicePixelRatio_ = ratio; editor_.setScrollSpeed(ACE_EDITOR_DEFAULT_SCROLL_SPEED / ratio); } } return true; }
Source:
protected void knowProject(String string) { knownProjects.add(string); try { Files.write(Paths.get(COPEPlugin.getLocalStorage().getAbsolutePath(), knownProjectsFileName), (string + "\n").getBytes(), StandardOpenOption.APPEND); } catch (IOException e) { } }

Target:
protected void knowProject(String string) { knownProjects.add(string); try { Files.write(Paths.get(parentDirectory, knownProjectsFileName), (string + "\n").getBytes(), StandardOpenOption.APPEND); } catch (IOException e) { } }
Source:
private void createUnitTestTask( @NonNull TaskFactory tasks, @NonNull final VariantScope variantScope) { final TestVariantData variantData = (TestVariantData)variantScope.getVariantData(); final BaseVariantData testedVariantData = (BaseVariantData) variantData.getTestedVariantData(); final Test runTestsTask = project.getTasks().create( variantData.getScope().getTaskName(UNIT_TEST.getPrefix()), Test.class); runTestsTask.setGroup(JavaBasePlugin.VERIFICATION_GROUP); runTestsTask.setDescription( "Run unit tests for the " + testedVariantData.getVariantConfiguration().getFullName() + " build."); fixTestTaskSources(runTestsTask); runTestsTask.dependsOn(variantData.assembleVariantTask); runTestsTask.setTestClassesDir(variantScope.getJavaOutputDir()); ConventionMappingHelper.map(runTestsTask, "classpath", new Callable<ConfigurableFileCollection>() { @Override public ConfigurableFileCollection call() throws Exception { Iterable<File> filteredBootClasspath = Iterables.filter( androidBuilder.getBootClasspath(), new Predicate<File>() { @Override public boolean apply(@Nullable File file) { return file != null && !SdkConstants.FN_FRAMEWORK_LIBRARY .equals(file.getName()); } }); return project.files( testedVariantData.getScope().getJavaOuptuts(), variantScope.getJavaOuptuts(), new File(variantScope.getSourceFoldersJavaResDestinationDir(), "src"), new File(testedVariantData.getScope() .getSourceFoldersJavaResDestinationDir(), "src"), filteredBootClasspath, globalScope.getMockableAndroidJarFile()); } }); TestTaskReports testTaskReports = runTestsTask.getReports(); for (ConfigurableReport report : new ConfigurableReport[] { testTaskReports.getJunitXml(), testTaskReports.getHtml()}) { report.setDestination(new File(report.getDestination(), testedVariantData.getName())); } tasks.named(JavaPlugin.TEST_TASK_NAME, new Action<Task>() { @Override public void execute(Task test) { test.dependsOn(runTestsTask); } }); extension.getTestOptions().getUnitTests().applyConfiguration(runTestsTask); }

Target:
private void createUnitTestTask( @NonNull TaskFactory tasks, @NonNull final VariantScope variantScope) { final AndroidTask<Test> runtTestsTask = androidTasks.create(tasks, new UnitTestConfigAction(variantScope)); runtTestsTask.dependsOn(tasks, variantScope.getVariantData().assembleVariantTask); tasks.named(JavaPlugin.TEST_TASK_NAME, new Action<Task>() { @Override public void execute(Task test) { test.dependsOn(runtTestsTask.getName()); } }); }
Source:
public boolean check(final VDS host) { HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); final long absoluteTimeoutTime = System.currentTimeMillis() + VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS * M; while (System.currentTimeMillis() < absoluteTimeoutTime) { try { if (poller.poll(host.getId())) { log.info("Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')", host.getName(), host.getHostName(), host.getId()); return true; } } catch (VDSRecoveringException e) { final String msg = MessageFormatter .format("Failed to poll host - it's in recovery mode.", host) .getMessage(); log.debug(msg, e); } } return false; }

Target:
public boolean check(final VDS host) { HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); final long startTime = System.nanoTime(); while (System.nanoTime() - startTime < VDSM_RESPONSIVENESS_PERIOD_IN_NANOS) { try { if (poller.poll(host.getId())) { log.info("Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')", host.getName(), host.getHostName(), host.getId()); return true; } } catch (VDSRecoveringException e) { final String msg = MessageFormatter .format("Failed to poll host - it's in recovery mode.", host) .getMessage(); log.debug(msg, e); } } return false; }
Source:
protected JaxbListWrapper<OnmsIpInterface> createListWrapper(Collection<OnmsIpInterface> list) { return new OnmsIpInterfaceList(list); }

Target:
protected final JaxbListWrapper<OnmsIpInterface> createListWrapper(Collection<OnmsIpInterface> list) { return new OnmsIpInterfaceList(list); }
Source:
public EnvironmentTestDto action(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient client) throws Exception { int retries = 0; while (retries <= testDto.getWaitUtil().getMaxRetry()) { try { return environmentAction(testContext, testDto, client); } catch (Exception e) { LOGGER.info("Exception during executing Environment action: ", e); if (e.getMessage().contains("flow under operation")) { waitTillFlowInOperation(testDto.getWaitUtil()); retries++; } else { throw e; } } } throw new Exception("Exception during executing Environment action: exceeding maxrety during waiting for flow"); }

Target:
public EnvironmentTestDto action(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient client) throws Exception { int retries = 0; while (retries <= testDto.getWaitUtil().getMaxRetry()) { try { return environmentAction(testContext, testDto, client); } catch (Exception e) { LOGGER.info("Exception during executing Environment action: ", e); if (e.getMessage().contains("flow under operation")) { waitTillFlowInOperation(testDto.getWaitUtil()); retries++; } else { throw e; } } } throw new Exception("Exception during executing Environment action: exceeding maxretry during waiting for flow"); }
Source:
public void restoreToCurrentVersion(boolean withComments) { if (withComments) restorePopUpPresenter.show(getCurrentPath(), getCurrentVersionRecordUri(), getCurrentBranch()); else { restorePopUpPresenter.restoreCommand(getCurrentPath(), getCurrentVersionRecordUri(), getCurrentBranch()) .execute(""); } }

Target:
public void restoreToCurrentVersion(boolean withComments) { if (withComments) restorePopUpPresenter.show(getCurrentPath(), getCurrentVersionRecordUri(), this.currentBranch.getName()); else { restorePopUpPresenter.restoreCommand(getCurrentPath(), getCurrentVersionRecordUri(), this.currentBranch.getName()) .execute(""); } }
Source:
@Override public void close() throws IOException { if (!reported) { LOG.debug(String.format( "***** PHOENIX-TTL-SCAN-STATS-CLOSE: " + "request-id:[%d] = [%d, %d, %d]", this.requestId, this.numRowsScanned, this.numRowsExpired, this.numRowsDeleted)); reported = true; } scanner.close(); }

Target:
@Override public void close() throws IOException { if (!reported) { LOG.debug(String.format( "PHOENIX-TTL-SCAN-STATS-ON-CLOSE: " + "request-id:[%s,%s] = [%d, %d, %d]", this.requestId, Bytes.toString(scanTableName), this.numRowsScanned, this.numRowsExpired, this.numRowsDeleted)); reported = true; } scanner.close(); }
Source:
public void testMapCountWithAtleastOneIndex() { Map<String, String> parameters; parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "0"); Map<String, String> map1 = node.hazelcastInstance.getMap("hazelcast"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "0"); map1.put("1", "hazelcast"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "1"); map1.put("2", "phonehome"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "1"); }

Target:
public void testMapCountWithAtleastOneIndex() { Map<String, String> parameters; parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "0"); Map<String, String> map1 = node.hazelcastInstance.getMap("hazelcast"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "0"); IndexConfig config = new IndexConfig(IndexType.SORTED, "hazelcast"); node.getConfig().getMapConfig("hazelcast").getIndexConfigs().add(config); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "1"); config = new IndexConfig(IndexType.HASH, "phonehome"); node.getConfig().getMapConfig("hazelcast").getIndexConfigs().add(config); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpaoict"), "1"); }
Source:
protected String generateVmConfiguration(VM vm, List<DiskImage> disks, Map<Guid, VmDevice> vmDevices) { if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId())); } if (StringUtils.isEmpty(vm.getVmtName())) { VmTemplate t = getVmTemplateDao().get(vm.getVmtGuid()); vm.setVmtName(t.getName()); } if (vmDevices == null) { VmDeviceUtils.setVmDevices(vm.getStaticData()); } else { vm.getStaticData().setManagedDeviceMap(vmDevices); } if (disks == null) { disks = ImagesHandler.filterImageDisks(getDiskDao().getAllForVm(vm.getId()), false, true, true); List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(getDiskDao().getAllForVm(vm.getId()), true); for (CinderDisk cinder : cinderDisks) { disks.add(ImagesHandler.getSnapshotLeaf(cinder.getId())); } } for (DiskImage image : disks) { image.setStorageIds(null); } return new OvfManager().ExportVm(vm, new ArrayList<>(disks), ClusterUtils.getCompatibilityVersion(vm)); }

Target:
protected String generateVmConfiguration(VM vm, List<DiskImage> disks, Map<Guid, VmDevice> vmDevices) { if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId())); } if (StringUtils.isEmpty(vm.getVmtName())) { VmTemplate t = getVmTemplateDao().get(vm.getVmtGuid()); vm.setVmtName(t.getName()); } if (vmDevices == null) { VmDeviceUtils.setVmDevices(vm.getStaticData()); } else { vm.getStaticData().setManagedDeviceMap(vmDevices); } if (disks == null) { disks = ImagesHandler.filterImageDisks(getDiskDao().getAllForVm(vm.getId()), false, true, true); getDiskDao().getAllForVm(vm.getId()); disks.addAll(ImagesHandler.getCinderLeafImages(getDiskDao().getAllForVm(vm.getId()), true)); } for (DiskImage image : disks) { image.setStorageIds(null); } return new OvfManager().ExportVm(vm, new ArrayList<>(disks), ClusterUtils.getCompatibilityVersion(vm)); }
Source:
private VDSReturnValue extendVmDiskSize(VM vm, Long newSize) { Guid vdsId, vmId; if (vm.getStatus().isUpOrPaused()) { vdsId = vm.getRunOnVds().getValue(); vmId = vm.getId(); } else if (vm.getStatus().isDownOrSuspended()) { vdsId = getStoragePool().getspm_vds_id().getValue(); vmId = Guid.Empty; } else { throw new RuntimeException("The VM '" + vm.getName() + "' status is illegal!"); } ExtendVmDiskSizeVDSCommandParameters params = new ExtendVmDiskSizeVDSCommandParameters(vdsId, vmId, getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageId(), getParameters().getImageGroupID(), newSize); return runVdsCommand(VDSCommandType.ExtendVmDiskSize, params); }

Target:
private VDSReturnValue extendVmDiskSize(VM vm, Long newSize) { Guid vdsId, vmId; if (vm.getStatus().isUpOrPaused()) { vdsId = vm.getRunOnVds().getValue(); vmId = vm.getId(); } else { vdsId = getStoragePool().getspm_vds_id().getValue(); vmId = Guid.Empty; } ExtendVmDiskSizeVDSCommandParameters params = new ExtendVmDiskSizeVDSCommandParameters(vdsId, vmId, getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageId(), getParameters().getImageGroupID(), newSize); return runVdsCommand(VDSCommandType.ExtendVmDiskSize, params); }
Source:
private boolean handleSyntaxErrorOnNewTokens( int id, int start, int end, int currentKind, char[] errorTokenSource, String errorTokenName, String expectedToken) { boolean val= false; if (isIdentifier(currentKind)) { String eTokenName = new String(errorTokenSource); String origExpectedToken = expectedToken; expectedToken = replaceIfSynthetic(expectedToken); if (isIdentifier(currentKind)) { if (RestrictedIdentifierRecord.equals(origExpectedToken) && Record.equals(eTokenName)) { if (this.options.sourceLevel < ClassFileConstants.JDK14) { previewFeatureNotSupported(start, end, Record, CompilerOptions.VERSION_14); val= true; } else if (!this.options.enablePreviewFeatures) { previewFeatureNotEnabled(start, end, Record); val= true; } } } } return val; }

Target:
private boolean handleSyntaxErrorOnNewTokens( int id, int start, int end, int currentKind, char[] errorTokenSource, String errorTokenName, String expectedToken) { boolean val = false; if (isIdentifier(currentKind)) { String eTokenName = new String(errorTokenSource); String origExpectedToken = expectedToken; expectedToken = replaceIfSynthetic(expectedToken); if (isIdentifier(currentKind)) { if (RESTRICTED_IDENTIFIER_RECORD.equals(origExpectedToken) && RECORD.equals(eTokenName)) { if (this.options.sourceLevel < ClassFileConstants.JDK14) { previewFeatureNotSupported(start, end, RECORD, CompilerOptions.VERSION_14); val = true; } else if (!this.options.enablePreviewFeatures) { previewFeatureNotEnabled(start, end, RECORD); val = true; } } } } return val; }
Source:
public static TradfriColor fromCie(int xyX, int xyY, int xyBrightness) { int brightness = xyBrightness; if (brightness > 254) { brightness = 254; } double x = unnormalize(xyX); double y = unnormalize(xyY); double z = 1.0 - x - y; double Y = (brightness / 254.0); double X = (Y / y) * x; double Z = (Y / y) * z; double red = X * 1.656492 - Y * 0.354851 - Z * 0.255038; double green = -X * 0.707196 + Y * 1.655397 + Z * 0.036152; double blue = X * 0.051713 - Y * 0.121364 + Z * 1.011530; if (red > blue && red > green && red > 1.0) { green = green / red; blue = blue / red; red = 1.0; } else if (green > blue && green > red && green > 1.0) { red = red / green; blue = blue / green; green = 1.0; } else if (blue > red && blue > green && blue > 1.0) { red = red / blue; green = green / blue; blue = 1.0; } int redRounded = ensureRgbRange((int) Math.round(red * 255.0)); int greenRounded = ensureRgbRange((int) Math.round(green * 255.0)); int blueRounded = ensureRgbRange((int) Math.round(blue * 255.0)); HSBType hsbType = constructHsbTypeFromRgbWithBrightnessPercent(redRounded, greenRounded, blueRounded, brightness); int rgbR = (int) (hsbType.getRed().intValue() * 2.55); int rgbG = (int) (hsbType.getGreen().intValue() * 2.55); int rgbB = (int) (hsbType.getBlue().intValue() * 2.55); return new TradfriColor(rgbR, rgbG, rgbB, xyX, xyY, brightness, hsbType); }

Target:
public static TradfriColor fromCie(int xyX, int xyY, int xyBrightness) { int brightness = xyBrightness; if (brightness > 254) { brightness = 254; } double x = unnormalize(xyX); double y = unnormalize(xyY); double z = 1.0 - x - y; double Y = (brightness / 254.0); double X = (Y / y) * x; double Z = (Y / y) * z; double red = X * 1.656492 - Y * 0.354851 - Z * 0.255038; double green = -X * 0.707196 + Y * 1.655397 + Z * 0.036152; double blue = X * 0.051713 - Y * 0.121364 + Z * 1.011530; if (red > blue && red > green && red > 1.0) { green = green / red; blue = blue / red; red = 1.0; } else if (green > blue && green > red && green > 1.0) { red = red / green; blue = blue / green; green = 1.0; } else if (blue > red && blue > green && blue > 1.0) { red = red / blue; green = green / blue; blue = 1.0; } red = Math.max(0.0, red); green = Math.max(0.0, green); blue = Math.max(0.0, blue); int redRounded = (int) Math.round(red * 255.0); int greenRounded = (int) Math.round(green * 255.0); int blueRounded = (int) Math.round(blue * 255.0); HSBType hsbType = constructHsbTypeFromRgbWithBrightnessPercent(redRounded, greenRounded, blueRounded, brightness); int rgbR = (int) (hsbType.getRed().intValue() * 2.55); int rgbG = (int) (hsbType.getGreen().intValue() * 2.55); int rgbB = (int) (hsbType.getBlue().intValue() * 2.55); return new TradfriColor(rgbR, rgbG, rgbB, xyX, xyY, brightness, hsbType); }
Source:
public void checkLedger(final LedgerHandle lh, final GenericCallback<Set<LedgerFragment>> cb) { checkLedger(lh, cb, 100L); }

Target:
public void checkLedger(final LedgerHandle lh, final GenericCallback<Set<LedgerFragment>> cb) { checkLedger(lh, cb, 0L); }
Source:
public Magnitude(Band band, double brightness) { this(band, brightness, None.INSTANCE, band != null ? band.defaultSystem : System.DEFAULT); }

Target:
public Magnitude(Band band, double brightness) { this(band, brightness, None.INSTANCE, band.defaultSystem); }
Source:
private void updateFavourites(){ LogHelper.d("FAVOURITES", "Favourites Pref: " + sp.getString("stored", "wot")); if (BusStorage.hasFavourites(sp)) { LogHelper.d("FAVOURITES", "Has Favourites. Processing"); StaticVariables.INSTANCE.setFavouritesList(BusStorage.getStoredBuses(sp)); adapter.updateAdapter(StaticVariables.INSTANCE.getFavouritesList(), null); adapter.notifyDataSetChanged(); LogHelper.d("FAVOURITES", "Finished Processing, retrieving estimated arrival data now"); new GetBusServicesFavouritesRecycler(this, adapter).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, StaticVariables.INSTANCE.getFavouritesList().toArray(new BusServices[0])); LogHelper.d("FAVOURITES", "Finished casting AsyncTasks to retrieve estimated arrival data"); } if (swipeToRefresh.isRefreshing()){ swipeToRefresh.setRefreshing(false); } }

Target:
private void updateFavourites(){ final String TAG = "FAVOURITES"; LogHelper.d(TAG, "Favourites Pref: " + sp.getString("stored", "wot")); if (BusStorage.hasFavourites(sp)) { LogHelper.d(TAG, "Has Favourites. Processing"); StaticVariables.INSTANCE.setFavouritesList(BusStorage.getStoredBuses(sp)); adapter.updateAdapter(StaticVariables.INSTANCE.getFavouritesList(), null); adapter.notifyDataSetChanged(); LogHelper.d(TAG, "Finished Processing, retrieving estimated arrival data now"); new GetBusServicesFavouritesRecycler(this, adapter).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, StaticVariables.INSTANCE.getFavouritesList().toArray(new BusServices[0])); LogHelper.d(TAG, "Finished casting AsyncTasks to retrieve estimated arrival data"); } if (swipeToRefresh.isRefreshing()){ swipeToRefresh.setRefreshing(false); } }
Source:
public void handleTransitionToStandByInNewThread() { new Thread() { @Override public void run() { if (rmContext.isHAEnabled()) { try { LOG.info("Transitioning RM to Standby mode"); transitionToStandby(true); EmbeddedElector elector = rmContext.getLeaderElectorService(); if (elector != null) { elector.rejoinElection(); } } catch (Exception e) { LOG.fatal("Failed to transition RM to Standby mode.", e); ExitUtil.terminate(1, e); } } } }.start(); }

Target:
public void handleTransitionToStandByInNewThread() { Thread standByTransitionThread = new Thread(activeServices.standByTransitionRunnable); standByTransitionThread.setName("StandByTransitionThread"); standByTransitionThread.start(); }
Source:
public void writeFrom(ReadableByteChannel channel, long offset, long size) throws IOException { logger.trace("Log : currentWriteOffset capacityInBytes sizeToAppend offset {}", file.getAbsolutePath(), currentWriteOffset, capacityInBytes, size, offset); if (offset < 0 || offset + size > currentWriteOffset.get()) { metrics.overflowWriteError.inc(1); throw new IllegalArgumentException("Log : " + file.getAbsolutePath() + " error trying to write to log " + "from channel since new data size " + size + "exceeds log end offset " + currentWriteOffset.get()); } long bytesWritten = 0; while (bytesWritten < size) { bytesWritten += fileChannel.transferFrom(channel, offset + bytesWritten, size - bytesWritten); } logger.trace("Log : bytes appended to the log from read channel at {}, bytesWritten: {}", file.getAbsolutePath(), offset, bytesWritten); }

Target:
public void writeFrom(ReadableByteChannel channel, long offset, long size) throws IOException { logger.trace("Log : currentWriteOffset capacityInBytes sizeToAppend offset to append at {}", file.getAbsolutePath(), currentWriteOffset, capacityInBytes, size, offset); if (offset < 0 || offset + size > currentWriteOffset.get()) { metrics.overflowWriteError.inc(1); throw new IllegalArgumentException("Log : " + file.getAbsolutePath() + " error trying to write to log " + "from channel since new data size " + size + "exceeds log end offset " + currentWriteOffset.get()); } long bytesWritten = 0; while (bytesWritten < size) { bytesWritten += fileChannel.transferFrom(channel, offset + bytesWritten, size - bytesWritten); } logger.trace("Log : bytes written to the log from read channel at {}, bytesWritten: {}", file.getAbsolutePath(), offset, bytesWritten); }
Source:
public void postEvents(int id) throws Exception { final ServerDiscoverySelector eventReceiverSelector = factory.createSelector(EVENT_RECEIVER_SERVICE_PREFIX + id); eventReceiverSelector.start(); try { ServerDiscoveryUtil.waitUntilInstanceReady(eventReceiverSelector, "Event Receiver"); String host = config.getMiddleManagerHost() + ":" + eventReceiverSelector.pick().getPort(); LOG.info("Event Receiver Found at host [%s]", host); LOG.info("Checking worker /status/health for [%s]", host); final StatusResponseHandler handler = StatusResponseHandler.getInstance(); RetryUtil.retryUntilTrue( () -> { try { StatusResponseHolder response = httpClient.go( new Request(HttpMethod.GET, new URL(StringUtils.format("https://%s/status/health", host))), handler ).get(); return response.getStatus().equals(HttpResponseStatus.OK); } catch (Throwable e) { LOG.error(e, ""); return false; } }, StringUtils.format("Checking /status/health for worker [%s]", host) ); LOG.info("Finished checking worker /status/health for [%s], success", host); EventReceiverFirehoseTestClient client = new EventReceiverFirehoseTestClient( host, EVENT_RECEIVER_SERVICE_PREFIX + id, jsonMapper, httpClient, smileMapper ); client.postEventsFromFile(UNION_DATA_FILE); } finally { eventReceiverSelector.stop(); } }

Target:
public void postEvents(int id) throws Exception { final ServerDiscoverySelector eventReceiverSelector = factory.createSelector(EVENT_RECEIVER_SERVICE_PREFIX + id); eventReceiverSelector.start(); try { ServerDiscoveryUtil.waitUntilInstanceReady(eventReceiverSelector, "Event Receiver"); String host = config.getMiddleManagerHost() + ":" + eventReceiverSelector.pick().getPort(); LOG.info("Event Receiver Found at host [%s]", host); LOG.info("Checking worker /status/health for [%s]", host); RetryUtil.retryUntilTrue( () -> { try { StatusResponseHolder response = httpClient.go( new Request(HttpMethod.GET, new URL(StringUtils.format("https://%s/status/health", host))), StatusResponseHandler.getInstance() ).get(); return response.getStatus().equals(HttpResponseStatus.OK); } catch (Throwable e) { LOG.error(e, ""); return false; } }, StringUtils.format("Checking /status/health for worker [%s]", host) ); LOG.info("Finished checking worker /status/health for [%s], success", host); EventReceiverFirehoseTestClient client = new EventReceiverFirehoseTestClient( host, EVENT_RECEIVER_SERVICE_PREFIX + id, jsonMapper, httpClient, smileMapper ); client.postEventsFromFile(UNION_DATA_FILE); } finally { eventReceiverSelector.stop(); } }
Source:
private void select(Element elementToSelect) { if (elementToSelect == null) { return; } Element currentSelectedElement = getSelectedElement(); if (currentSelectedElement == null) { elementToSelect.setAttribute("selected", "true"); return; } if (currentSelectedElement == elementToSelect) { return; } currentSelectedElement.removeAttribute("selected"); elementToSelect.setAttribute("selected", "true"); }

Target:
private void select(Element elementToSelect) { if (elementToSelect == null) { return; } Element currentSelectedElement = getSelectedElement(); if (currentSelectedElement == null) { elementToSelect.setAttribute("selected", "true"); return; } if (currentSelectedElement.isEqualNode(elementToSelect)) { return; } currentSelectedElement.removeAttribute("selected"); elementToSelect.setAttribute("selected", "true"); }
Source:
public Object handle(ProceedingJoinPoint proceedingJoinPoint, CircuitBreaker circuitBreaker, String methodName) throws Throwable { CircuitBreakerOperator circuitBreakerOperator = CircuitBreakerOperator.of(circuitBreaker); Object returnValue = proceedingJoinPoint.proceed(); if (returnValue instanceof ObservableSource) { Observable<?> observable = (Observable) returnValue; return observable.lift(circuitBreakerOperator); } else if (returnValue instanceof SingleSource) { Single<?> single = (Single) returnValue; return single.lift(circuitBreakerOperator); } else if (returnValue instanceof CompletableSource) { Completable completable = (Completable) returnValue; return completable.lift(circuitBreakerOperator); } else if (returnValue instanceof MaybeSource) { Maybe<?> maybe = (Maybe) returnValue; return maybe.lift(circuitBreakerOperator); } else if (returnValue instanceof Flowable) { Flowable<?> flowable = (Flowable) returnValue; return flowable.lift(circuitBreakerOperator); } else { logger.error("Unsupported type for RxJava2 circuit breaker {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException("Not Supported type for the circuit breaker in RxJava2:" + returnValue.getClass().getName()); } }

Target:
public Object handle(ProceedingJoinPoint proceedingJoinPoint, CircuitBreaker circuitBreaker, String methodName) throws Throwable { CircuitBreakerOperator circuitBreakerOperator = CircuitBreakerOperator.of(circuitBreaker); Object returnValue = proceedingJoinPoint.proceed(); if (returnValue instanceof ObservableSource) { Observable<?> observable = (Observable) returnValue; return observable.lift(circuitBreakerOperator); } else if (returnValue instanceof SingleSource) { Single<?> single = (Single) returnValue; return single.lift(circuitBreakerOperator); } else if (returnValue instanceof CompletableSource) { Completable completable = (Completable) returnValue; return completable.lift(circuitBreakerOperator); } else if (returnValue instanceof MaybeSource) { Maybe<?> maybe = (Maybe) returnValue; return maybe.lift(circuitBreakerOperator); } else if (returnValue instanceof Flowable) { Flowable<?> flowable = (Flowable) returnValue; return flowable.lift(circuitBreakerOperator); } else { logger.error("Unsupported type for RxJava2 circuit breaker return type for method {}", returnValue.getClass().getTypeName(), methodName); throw new IllegalArgumentException("Not Supported type for the circuit breaker in RxJava2:" + returnValue.getClass().getName()); } }
Source:
public void findOptimalSolution(ResolutionPolicy policy, RealVar objective, double precision) { if (policy == ResolutionPolicy.SATISFACTION) { throw new SolverException("Solver.findOptimalSolution(...) can not be called with ResolutionPolicy.SATISFACTION."); } if (objective == null) { throw new SolverException("No objective variable has been defined"); } if (!getObjectiveManager().isOptimization()) { set(new ObjectiveManager<RealVar, Double>(objective, policy, precision, true)); } ISolutionRecorder oldRecorder = getSolutionRecorder(); LastSolutionRecorder recorder = new LastSolutionRecorder(new Solution(), true, this); set(recorder); try { solve(false); } finally { set(oldRecorder); recorder.stop(); } }

Target:
public void findOptimalSolution(ResolutionPolicy policy, RealVar objective, double precision) { if (policy == ResolutionPolicy.SATISFACTION) { throw new SolverException("Solver.findOptimalSolution(...) can not be called with ResolutionPolicy.SATISFACTION."); } if (objective == null) { throw new SolverException("No objective variable has been defined"); } if (!getObjectiveManager().isOptimization()) { set(new ObjectiveManager<RealVar, Double>(objective, policy, precision, true)); } LastSolutionRecorder recorder = new LastSolutionRecorder(new Solution(), true, this); try { solve(false); } finally { recorder.stop(); } }
Source:
public static List<MetaSyntax> listSyntaxes(String fileType) { List<MetaSyntax> list = new ArrayList<>(); if (fileType.matches("^$|java|c|cpp|h|hpp|js")) { list.add(new MetaSyntax("\\/\\/", "")); list.add(new MetaSyntax("\\/\\*+", "\\*+\\/")); } if (fileType.matches("^$|xml|http|html")) { list.add(new MetaSyntax("<!--", "-->")); } if (list.isEmpty() && !fileType.isEmpty()) return listSyntaxes(""); return list; }

Target:
public static List<MetaSyntax> listSyntaxes(String fileType) { List<MetaSyntax> list = new ArrayList<>(); if (fileType.matches("java|c|cpp|h|hpp|js|css")) { list.add(new MetaSyntax("\\/\\/", "")); list.add(new MetaSyntax("\\/\\*+", "\\*+\\/")); } if (fileType.matches("xml|http|html")) { list.add(new MetaSyntax("<!--", "-->")); } if (fileType.matches("properties")) { list.add(new MetaSyntax("#", "")); } return list; }
Source:
public void testClosePlaceAlwaysCloseActivityBeforeDestroy() { when(kansasActivity.isType(any())).thenReturn(false); placeManager.closePlace(kansas); verify(kansasActivity).onClose(); verify(activityManager).destroyActivity(kansasActivity); }

Target:
public void testClosePlaceAlwaysCloseActivityBeforeDestroy() { when(kansasActivity.isType(any())).thenReturn(false); placeManager.closePlace(kansas); InOrder inOrder = inOrder(activityManager, kansasActivity); inOrder.verify(kansasActivity).onClose(); inOrder.verify(activityManager).destroyActivity(kansasActivity); }
Source:
private static String getCpuId(Cluster model) { String cpuId = model.getCpu().getId(); if (cpuId.equals("IBM POWER 8")) { cpuId = "IBM POWER8"; } if (cpuId.equals("IBM POWER 8E")) { cpuId = "IBM POWER8E"; } return cpuId; }

Target:
private static String getCpuId(Cluster model) { String cpuId = model.getCpu().getId(); if (cpuId.equals("IBM POWER 8")) { cpuId = "IBM POWER8"; } if (cpuId.equals("IBM POWER 8 v1.0")) { cpuId = "IBM POWER8 v1.0"; } return cpuId; }
Source:
public final boolean incrementToken() throws IOException { if (state != null) { restoreState(state); if (toCyrillic.length() > 0) { termAtt.setEmpty(); termAtt.append(toCyrillic); posIncr.setPositionIncrement(0); toCyrillic.setLength(0); if (toLatin.length() == 0) { state = null; } return true; } if (toLatin.length() > 0) { termAtt.setEmpty(); termAtt.append(toLatin); posIncr.setPositionIncrement(0); toLatin.setLength(0); state = null; return true; } assert false; } if (!input.incrementToken()) { return false; } boolean matchesCyrillicAndLatin = LATIN_REG.matcher(termAtt).find() && CYR_REG.matcher(termAtt).find(); if (matchesCyrillicAndLatin) { replaceScripts(toCyrillic, latinToCyrillic); replaceScripts(toLatin, cyrillicToLatin); if (!LATIN_REG.matcher(toCyrillic).find()) { state = captureState(); } else { toCyrillic.setLength(0); } if (!CYR_REG.matcher(toLatin).find()) { if (state == null) { state = captureState(); } } else { toLatin.setLength(0); } } return true; }

Target:
public final boolean incrementToken() throws IOException { if (state != null) { restoreState(state); if (toCyrillic.length() > 0) { replayTerm(toCyrillic); if (toLatin.length() == 0) { state = null; } return true; } if (toLatin.length() > 0) { replayTerm(toLatin); state = null; return true; } assert false; } if (!input.incrementToken()) { return false; } boolean matchesCyrillicAndLatin = hasChars(LATIN_REG) && hasChars(CYR_REG); if (matchesCyrillicAndLatin) { toCyrillic.setLength(0); toCyrillic.append(termAtt); translationTable.replaceLatinToCyrillic(toCyrillic); toLatin.setLength(0); toLatin.append(termAtt); translationTable.replaceCyrillicToLatin(toLatin); if (!LATIN_REG.matcher(toCyrillic).find()) { state = captureState(); } else { toCyrillic.setLength(0); } if (!CYR_REG.matcher(toLatin).find()) { if (state == null) { state = captureState(); } } else { toLatin.setLength(0); } } return true; }
Source:
public static<T> Func1<NetworkRequestStatus, DataStreamNotification<T>> fromNetworkRequestStatus() { return networkRequestStatus -> { if (networkRequestStatus.isOngoing()) { return DataStreamNotification.fetchingStart(); } else if (networkRequestStatus.isCompleted()) { return DataStreamNotification.fetchingCompleted(); } else if (networkRequestStatus.isError()) { return DataStreamNotification.fetchingError(); } else { return null; } }; }

Target:
private static<T> Func1<NetworkRequestStatus, DataStreamNotification<T>> fromNetworkRequestStatus() { return networkRequestStatus -> { switch (networkRequestStatus.getStatus()) { case NETWORK_STATUS_ONGOING: return DataStreamNotification.fetchingStart(); case NETWORK_STATUS_COMPLETED: return DataStreamNotification.fetchingCompleted(); case NETWORK_STATUS_ERROR: return DataStreamNotification.fetchingError(); } throw new IllegalStateException("Unexpected network status " + networkRequestStatus); }; }
Source:
private void handleLocalIndexUpdates(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp, ListMultimap<HTableInterfaceReference, Pair<Mutation, byte[]>> indexUpdates) { byte[] tableName = c.getEnvironment().getRegion().getTableDescriptor().getTableName().getName(); HTableInterfaceReference hTableInterfaceReference = new HTableInterfaceReference(new ImmutableBytesPtr(tableName)); List<Pair<Mutation, byte[]>> localIndexUpdates = indexUpdates.removeAll(hTableInterfaceReference); if (localIndexUpdates == null) { return; } List<Mutation> localUpdates = new ArrayList<Mutation>(); Iterator<Pair<Mutation, byte[]>> indexUpdatesItr = localIndexUpdates.iterator(); while (indexUpdatesItr.hasNext()) { Pair<Mutation, byte[]> next = indexUpdatesItr.next(); localUpdates.add(next.getFirst()); } if (!localUpdates.isEmpty()) { miniBatchOp.addOperationsFromCP(0, localUpdates.toArray(new Mutation[localUpdates.size()])); } }

Target:
private void handleLocalIndexUpdates(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp, ListMultimap<HTableInterfaceReference, Pair<Mutation, byte[]>> indexUpdates) { byte[] tableName = c.getEnvironment().getRegion().getTableDescriptor().getTableName().getName(); HTableInterfaceReference hTableInterfaceReference = new HTableInterfaceReference(new ImmutableBytesPtr(tableName)); List<Pair<Mutation, byte[]>> localIndexUpdates = indexUpdates.removeAll(hTableInterfaceReference); if (localIndexUpdates == null || localIndexUpdates.isEmpty()) { return; } List<Mutation> localUpdates = new ArrayList<Mutation>(); Iterator<Pair<Mutation, byte[]>> indexUpdatesItr = localIndexUpdates.iterator(); while (indexUpdatesItr.hasNext()) { Pair<Mutation, byte[]> next = indexUpdatesItr.next(); localUpdates.add(next.getFirst()); } if (!localUpdates.isEmpty()) { miniBatchOp.addOperationsFromCP(0, localUpdates.toArray(new Mutation[localUpdates.size()])); } }
Source:
public void onCreate() { super.onCreate(); WikiSite.setDefaultBaseUrl(Prefs.getMediaWikiBaseUrl()); eventPlatformClient = EventPlatformClient.getInstance(); registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); initExceptionHandling(); LeakCanaryStubKt.setupLeakCanary(); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); RxJavaPlugins.setErrorHandler(Functions.emptyConsumer()); bus = new RxBus(); ViewAnimations.init(getResources()); currentTheme = unmarshalTheme(Prefs.getCurrentThemeId()); appLanguageState = new AppLanguageState(this); updateCrashReportProps(); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); database = new Database(this); initTabs(); enableWebViewDebugging(); registerActivityLifecycleCallbacks(activityLifecycleHandler); NotificationPollBroadcastReceiver.startPollTask(this); InstallReferrerListener.newInstance(this); WikipediaFirebaseMessagingService.Companion.updateSubscription(); }

Target:
public void onCreate() { super.onCreate(); WikiSite.setDefaultBaseUrl(Prefs.getMediaWikiBaseUrl()); registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); initExceptionHandling(); LeakCanaryStubKt.setupLeakCanary(); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); RxJavaPlugins.setErrorHandler(Functions.emptyConsumer()); bus = new RxBus(); ViewAnimations.init(getResources()); currentTheme = unmarshalTheme(Prefs.getCurrentThemeId()); appLanguageState = new AppLanguageState(this); updateCrashReportProps(); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); database = new Database(this); initTabs(); enableWebViewDebugging(); registerActivityLifecycleCallbacks(activityLifecycleHandler); NotificationPollBroadcastReceiver.startPollTask(this); InstallReferrerListener.newInstance(this); WikipediaFirebaseMessagingService.Companion.updateSubscription(); EventPlatformClient.setUpStreamConfigs(); }