auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<Permission> getPermissions(Role role) throws DataAccessException { List<Permission> rolePermissions = new ArrayList<Permission>(); String getRolePermissionsQuery = String.format("SELECT `permissionid` FROM `rolepermission` WHERE `roleid`=%d", role.id.longValue()); Connection roleConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeRole.toString()); try { roleConnection.connect(); roleConnection.executeQuery(getRolePermissionsQuery); while (roleConnection.fetchNextRow()) { Long id = roleConnection.getCurrentRowLong("permissionid"); Permission p = PermissionServiceProvider.provide().getPermission(id); if (p != null) { rolePermissions.add(p); } } } finally { if (roleConnection != null) { roleConnection.disconnect(); } } return rolePermissions; }

Target:
public List<Permission> getPermissions(Role role) throws DataAccessException { List<Permission> rolePermissions = new ArrayList<Permission>(); String getRolePermissionsQuery = String.format("SELECT `permissionid` FROM `rolepermission` WHERE `roleid`=%d", role.id.longValue()); Connection roleConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeRole.toString()); try { roleConnection.connect(); roleConnection.executeQuery(getRolePermissionsQuery); while (roleConnection.fetchNextRow()) { Permission p = new Permission(); p.id = roleConnection.getCurrentRowLong("permissionid"); rolePermissions.add(p); } } finally { if (roleConnection != null) { roleConnection.disconnect(); } } return rolePermissions; }
Source:
protected void executeVmCommand() { this.setVmName(vmStaticDao.get(getParameters().getVmId()).getName()); VmNic iface = vmNicDao.get(getParameters().getInterfaceId()); if (iface != null) { interfaceName = iface.getName(); String interType = VmInterfaceType.forValue(iface.getType()).getDescription(); if (interType != null) { addCustomValue("InterfaceType", interType); } externalNetworkManagerFactory.create(iface).deallocateIfExternal(); } TransactionSupport.executeInNewTransaction(() -> { vmStaticDao.incrementDbGeneration(getParameters().getVmId()); vmNicDao.remove(getParameters().getInterfaceId()); vmNetworkStatisticsDao.remove(getParameters().getInterfaceId()); vmDeviceDao.remove(new VmDeviceId(getParameters().getInterfaceId(), getParameters().getVmId())); if (iface != null) { getMacPool().freeMac(iface.getMacAddress()); } setSucceeded(true); return null; }); }

Target:
protected void executeVmCommand() { this.setVmName(vmStaticDao.get(getParameters().getVmId()).getName()); VmNic iface = vmNicDao.get(getParameters().getInterfaceId()); if (iface != null) { interfaceName = iface.getName(); String interType = VmInterfaceType.forValue(iface.getType()).getDescription(); if (interType != null) { addCustomValue("InterfaceType", interType); } externalNetworkManagerFactory.create(iface).deallocateIfExternal(); } TransactionSupport.executeInNewTransaction(() -> { vmStaticDao.incrementDbGeneration(getParameters().getVmId()); vmNicDao.remove(getParameters().getInterfaceId()); vmNetworkStatisticsDao.remove(getParameters().getInterfaceId()); vmDeviceDao.remove(new VmDeviceId(getParameters().getInterfaceId(), getParameters().getVmId())); if (iface != null) { String macOfNicBeingRemoved = iface.getMacAddress(); if (macCanBeReleased(macOfNicBeingRemoved)) { getMacPool().freeMac(macOfNicBeingRemoved); } } setSucceeded(true); return null; }); }
Source:
public void testResolveFromWorkDirYamlAndYml() throws Exception { helper.givenYamlClientConfigFileInWorkDir("cluster-yaml-workdir"); helper.givenYmlClientConfigFileInWorkDir("cluster-yaml-workdir"); ClientConfig config = new YamlClientConfigBuilder().build(); assertEquals("cluster-yaml-workdir", config.getInstanceName()); }

Target:
public void testResolveFromWorkDirYamlAndYml() throws Exception { helper.givenYamlClientConfigFileInWorkDir("cluster-yaml-workdir"); helper.givenYmlClientConfigFileInWorkDir("cluster-yml-workdir"); ClientConfig config = new YamlClientConfigBuilder().build(); assertEquals("cluster-yaml-workdir", config.getInstanceName()); }
Source:
public void tearDown() throws Exception { FileUtils.deleteDirectory(workspacesRootFile); }

Target:
public void tearDown() throws Exception { IoUtil.deleteRecursive(workspacesRootFile); }
Source:
private static String getDetailedLog(String msg, int depth) { if (!shouldShowLogs()) { return msg; } Thread current = Thread.currentThread(); final StackTraceElement trace = current.getStackTrace()[depth]; final String filename = trace.getFileName(); return "[" + current.getName() + "][" + "(" + filename.substring(0, filename.length() - DOT_CLASS) + ".java:" + trace.getLineNumber() + ")." + trace.getMethodName() + "] " + msg; }

Target:
private static String getDetailedLog(String msg, int depth) { if (!shouldShowLogs()) { return msg; } Thread currentThread = Thread.currentThread(); final StackTraceElement trace = currentThread.getStackTrace()[depth]; final String filename = trace.getFileName(); final String linkableSourcePosition = String.format("(%s.java:%d)", filename.substring(0, filename.length() - DOT_CLASS), trace.getLineNumber()); final String logPrefix = String.format("[%s][%s.%s] ", currentThread.getName(), linkableSourcePosition, trace.getMethodName()); return logPrefix + msg; }
Source:
private boolean shouldFreezeOrThawVm() { Predicate<List<DiskImage>> hasManagedBlockDisks = disks -> !DisksFilter.filterManagedBlockStorageDisks(disks).isEmpty(); return isLiveSnapshotApplicable() && (isCinderDisksExist() || hasManagedBlockDisks.test(getDisksList())) && getParameters().getParentCommand() != ActionType.LiveMigrateDisk; }

Target:
private boolean shouldFreezeOrThawVm() { return isLiveSnapshotApplicable() && (diskOfTypeExists(DiskStorageType.CINDER) || diskOfTypeExists(DiskStorageType.MANAGED_BLOCK_STORAGE)) && getParameters().getParentCommand() != ActionType.LiveMigrateDisk; }
Source:
static <T> CheckedConsumer<T> decorateCheckedConsumer(AdaptiveBulkhead bulkhead, CheckedConsumer<T> consumer) { return t -> { long start = 0; boolean isFailed=false; bulkhead.acquirePermission(); try { start = Instant.now().toEpochMilli(); consumer.accept(t); } catch (Exception e) { isFailed=true; bulkhead.onError( start,TimeUnit.MILLISECONDS, e); throw e; } finally { if (start != 0 && !isFailed) { bulkhead.onSuccess(start, TimeUnit.MILLISECONDS); } } }; }

Target:
static <T> CheckedConsumer<T> decorateCheckedConsumer(AdaptiveBulkhead bulkhead, CheckedConsumer<T> consumer) { return t -> { long start = 0; boolean isFailed=false; bulkhead.acquirePermission(); try { start = System.currentTimeMillis(); consumer.accept(t); } catch (Exception e) { isFailed=true; bulkhead.onError(System.nanoTime() - start, TimeUnit.NANOSECONDS, e); throw e; } finally { if (start != 0 && !isFailed) { bulkhead.onSuccess(System.nanoTime() - start, TimeUnit.NANOSECONDS); } } }; }
Source:
private void getApprovalNames() throws OrmException { optionList = new ArrayList<CmdOption>(); for (ApprovalType type : approvalTypes.getApprovalTypes()) { String usage = ""; final ApprovalCategory category = type.getCategory(); if (category.getFunctionName().equals("MaxWithBlock")) { usage = "Score for " + category.getName() + "\n"; for (ApprovalCategoryValue v : type.getValues()) { usage += String.format("%4d", v.getValue()) + " - " + v.getName() + "\n"; } } optionList.add( new CmdOption( "--" + category.getName().toLowerCase().replace(' ', '-'), usage, category.getId().get(), type.getMin().getValue(), type.getMax().getValue(), category.getName())); } }

Target:
private void getApprovalNames() throws OrmException { optionList = new ArrayList<CmdOption>(); for (ApprovalType type : approvalTypes.getApprovalTypes()) { String usage = ""; final ApprovalCategory category = type.getCategory(); usage = "Score for " + category.getName() + "\n"; for (ApprovalCategoryValue v : type.getValues()) { usage += String.format("%4d", v.getValue()) + " - " + v.getName() + "\n"; } optionList.add( new CmdOption( "--" + category.getName().toLowerCase().replace(' ', '-'), usage, category.getId().get(), type.getMin().getValue(), type.getMax().getValue(), category.getName())); } }
Source:
@BeforeEach void init() throws IOException { credentialsFile = File.createTempFile("zipkin-server-security", ".properties"); Properties props = new Properties(); props.put(USERNAME_PROP, "foo"); props.put(PASSWORD_PROP, "bar"); try (FileOutputStream os = new FileOutputStream(credentialsFile)) { props.store(os, ""); } TestPropertyValues.of( "spring.config.name=zipkin-server", "zipkin.storage.type:elasticsearch", "zipkin.storage.elasticsearch.hosts:https://localhost:" + server.httpsPort(), "zipkin.storage.elasticsearch.credentials-file=" + credentialsFile.getAbsolutePath(), "zipkin.storage.elasticsearch.credentials-refresh-interval=3000", "zipkin.storage.elasticsearch.ssl.key-store=classpath:keystore.jks", "zipkin.storage.elasticsearch.ssl.key-store-password=password", "zipkin.storage.elasticsearch.ssl.trust-store=classpath:keystore.jks", "zipkin.storage.elasticsearch.ssl.trust-store-password=password") .applyTo(context); Access.registerElasticsearch(context); context.refresh(); storage = context.getBean(ElasticsearchStorage.class); }

Target:
@BeforeEach void init() throws IOException { credentialsFile = pathOfResource("es-credentials"); TestPropertyValues.of( "spring.config.name=zipkin-server", "zipkin.storage.type:elasticsearch", "zipkin.storage.elasticsearch.hosts:https://localhost:" + server.httpsPort(), "zipkin.storage.elasticsearch.credentials-file=" + credentialsFile, "zipkin.storage.elasticsearch.credentials-refresh-interval=3", "zipkin.storage.elasticsearch.ssl.key-store=classpath:keystore.jks", "zipkin.storage.elasticsearch.ssl.key-store-password=password", "zipkin.storage.elasticsearch.ssl.trust-store=classpath:keystore.jks", "zipkin.storage.elasticsearch.ssl.trust-store-password=password") .applyTo(context); Access.registerElasticsearch(context); context.refresh(); storage = context.getBean(ElasticsearchStorage.class); }
Source:
private void extractFromSource(SearchHit hit) { Map<String, Object> map = hit.getSourceAsMap(); TreeMap<String, Object> fieldsMap = new TreeMap<>(new Comparator<String>() { @Override public int compare(String key1, String key2) { int length1 = key1.split("\\.").length; int length2 = key2.split("\\.").length; if (length1 == length2) { return key1.compareTo(key2); } return length2 - length1; } }); for (Map.Entry<String, Object> entry : map.entrySet()) { fieldsMap.put(entry.getKey(), entry.getValue()); } processFields(fieldsMap); }

Target:
private void extractFromSource(SearchHit hit) { List<Field> fields = new ArrayList<>(); for (Map.Entry<String, Object> entry : hit.getSourceAsMap().entrySet()) { fields.add(new Field(entry.getKey(), entry.getValue())); } Collections.sort(fields, Comparator.comparing(Field::getName)); for (Map.Entry<String, Object> entry : unflatten(fields).entrySet()) { setFieldIfExists(entry.getKey(), entry.getValue()); } }
Source:
void register() { checkLocked(); try { owner.mbeanServer.registerMBean(this, objectName); } catch (Exception e) { throw new RuntimeException("Failed to reregister bean " + mbeanName, e); } }

Target:
void register() { checkLocked(); try { owner.mbeanServer.registerMBean(this, objectName); } catch (Exception e) { throw new KafkaException("Failed to register bean " + mbeanName, e); } }
Source:
public void testPutFile() throws IOException { String envVar; envVar = getVar("pf_start_size"); long pf_start_size = (envVar != null ? new Long(envVar) : 1024 * 1024 * 1L); envVar = getVar("pf_multiplier"); int pf_multiplier = (envVar != null ? new Integer(envVar) : 2); envVar = getVar("pf_count"); int pf_count = (envVar != null ? new Integer(envVar) : 3); envVar = getVar("pf_repeat"); int pf_repeat = (envVar != null ? new Integer(envVar) : 1); if (logger.isInfoEnabled()) { logger.info("testPutFile: pf_start_size="+pf_start_size+", pf_multiplier="+pf_multiplier +", pf_count="+pf_count+", pf_repeat="+pf_repeat); } long testContentSizeInBytes = pf_start_size; for (int i = 0; i < pf_count; i++) { File testFile = createTestFile(testContentSizeInBytes); for (int j = 0; j < pf_repeat; j++) { testPutFileImpl(testFile, true); testPutFileImpl(testFile, false); } if (cleanup) { testFile.delete(); } testContentSizeInBytes = testContentSizeInBytes * pf_multiplier; } }

Target:
public void testPutFile() throws IOException { Long pf_start_size = getVar("pf_start_size", new Long(1024 * 1024 * 1L), Long.class); Integer pf_multiplier = getVar("pf_multiplier", new Integer(2), Integer.class); Integer pf_count = getVar("pf_count", new Integer(3), Integer.class); Integer pf_repeat = getVar("pf_repeat", new Integer(1), Integer.class); if (logger.isInfoEnabled()) { logger.info("testPutFile: pf_start_size="+pf_start_size+", pf_multiplier="+pf_multiplier +", pf_count="+pf_count+", pf_repeat="+pf_repeat); } long testContentSizeInBytes = pf_start_size; for (int i = 0; i < pf_count; i++) { File testFile = createTestFile(testContentSizeInBytes); for (int j = 0; j < pf_repeat; j++) { testPutFileImpl(testFile, true); testPutFileImpl(testFile, false); } if (cleanup) { testFile.delete(); } testContentSizeInBytes = testContentSizeInBytes * pf_multiplier; } }
Source:
public void performSearchWithDoiEmptyCitedByMode() throws FetcherException { BibEntry doiEmptyCitedBy = new BibEntry().withField(StandardField.DOI, "10.1.1.19.4684"); assertTrue(openCitationFetcher.searchCitedBy(doiEmptyCitedBy).isEmpty()); }

Target:
public void performSearchWithDoiEmptyCitedByMode() throws FetcherException { BibEntry doiEmptyCitedBy = new BibEntry().withField(StandardField.DOI, "10.1.1.19.4684"); assertEquals(Collections.emptyList(), openCitationFetcher.searchCitedBy(doiEmptyCitedBy)); }
Source:
public boolean validate(String name, ApplicationType appType) { Assert.hasText(name, "name must not be null or empty"); Assert.notNull(appType, "ApplicationType must not be null"); boolean result = false; AppRegistration registration = appRegistry.find(name, appType); if (registration != null) { Resource resource = appRegistry.getAppResource(registration); try { if ((resource instanceof DockerResource)) { result = validateDockerResource(dockerValidatorProperties, (DockerResource) resource); } else { new BootClassLoaderFactory(resolveAsArchive(appRegistry.getAppResource(registration)), null) .createClassLoader(); result = true; } } catch (NullPointerException nex) { logger.info(String.format("The app %s was marked invalid because the URL specified does not resolve to a resource", name)); } catch (Exception ex) { logger.info(String.format("The app %s was marked invalid because: ", name), ex); } } return result; }

Target:
public boolean validate(String name, ApplicationType appType) { Assert.hasText(name, "name must not be null or empty"); Assert.notNull(appType, "ApplicationType must not be null"); boolean result = false; AppRegistration registration = appRegistry.find(name, appType); if (registration != null) { Resource resource = appRegistry.getAppResource(registration); try { if ((resource instanceof DockerResource)) { result = validateDockerResource(dockerValidatorProperties, (DockerResource) resource); } else { new BootClassLoaderFactory(resolveAsArchive(resource), null) .createClassLoader(); result = true; } } catch (Exception ex) { logger.info(String.format("The app %s was marked invalid because: ", name), ex); } } return result; }
Source:
public synchronized void visit(MetricsVisitor visitor) { visitor.listGauge(this); }

Target:
public void visit(MetricsVisitor visitor) { visitor.listGauge(this); }
Source:
private static boolean chipsetMatchesEmulatedMachine(ChipsetType chipsetType, String emulatedMachine) { if (chipsetType == ChipsetType.I440FX) { return true; } return chipsetType == ChipsetType.fromMachineType(emulatedMachine); }

Target:
private static boolean chipsetMatchesEmulatedMachine(ChipsetType chipsetType, String emulatedMachine) { return chipsetType == ChipsetType.I440FX || chipsetType == ChipsetType.fromMachineType(emulatedMachine); }
Source:
public int execute() { try { Task<?> rootTask = work.getRootTask(); if (rootTask != null) { rootTask.setChildTasks(null); } work.setRootTask(this); this.parentTasks = null; int status = 0; if (work.isIncrementalLoad()) { status = executeIncrementalLoad(); if (status == 0 && !work.incrementalLoadTasksBuilder().hasMoreWork()) { writeLoadCompleteAck(work.dumpDirectory); } } else { status = executeBootStrapLoad(); if (status == 0 && !work.hasBootstrapLoadTasks()) { writeLoadCompleteAck(work.dumpDirectory); } } return status; } catch (SemanticException e) { LOG.error("failed", e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } }

Target:
public int execute() { Task<?> rootTask = work.getRootTask(); if (rootTask != null) { rootTask.setChildTasks(null); } work.setRootTask(this); this.parentTasks = null; if (work.isIncrementalLoad()) { return executeIncrementalLoad(); } else { return executeBootStrapLoad(); } }
Source:
private AuthenticationResult tryRT() throws AuthenticationException { CacheEvent cacheEvent = new CacheEvent(EventStrings.TOKEN_CACHE_LOOKUP); cacheEvent.setTokenType(EventStrings.TOKEN_TYPE_RT); cacheEvent.setRequestId(mAuthRequest.getTelemetryRequestId()); Telemetry.getInstance().startEvent(mAuthRequest.getTelemetryRequestId(), EventStrings.TOKEN_CACHE_LOOKUP); final TokenCacheItem regularRTItem = mTokenCacheAccessor.getRegularRefreshTokenCacheItem(mAuthRequest.getResource(), mAuthRequest.getClientId(), mAuthRequest.getUserFromRequest()); if (regularRTItem == null) { Telemetry.getInstance().stopEvent(mAuthRequest.getTelemetryRequestId(), cacheEvent, EventStrings.TOKEN_CACHE_LOOKUP); Logger.v(TAG, "Regular token cache entry does not exist, try with MRRT."); return tryMRRT(); } cacheEvent.setTokenTypeRT(true); if (regularRTItem.getIsMultiResourceRefreshToken() || isMRRTEntryExisted()) { final String statusMessage = regularRTItem.getIsMultiResourceRefreshToken() ? "Found RT and it's also a MRRT, retry with MRRT" : "RT is found and there is a MRRT entry existed, try with MRRT"; cacheEvent.setTokenTypeMRRT(true); Telemetry.getInstance().stopEvent(mAuthRequest.getTelemetryRequestId(), cacheEvent, EventStrings.TOKEN_CACHE_LOOKUP); Logger.v(TAG, statusMessage); return tryMRRT(); } Telemetry.getInstance().stopEvent(mAuthRequest.getTelemetryRequestId(), cacheEvent, EventStrings.TOKEN_CACHE_LOOKUP); Logger.v(TAG, "Send request to use regular RT for new AT."); return acquireTokenWithCachedItem(regularRTItem); }

Target:
private AuthenticationResult tryRT() throws AuthenticationException { final TokenCacheItem regularRTItem = mTokenCacheAccessor.getRegularRefreshTokenCacheItem(mAuthRequest.getResource(), mAuthRequest.getClientId(), mAuthRequest.getUserFromRequest()); if (regularRTItem == null) { Logger.v(TAG, "Regular token cache entry does not exist, try with MRRT."); return tryMRRT(); } if (regularRTItem.getIsMultiResourceRefreshToken() || isMRRTEntryExisted()) { final String statusMessage = regularRTItem.getIsMultiResourceRefreshToken() ? "Found RT and it's also a MRRT, retry with MRRT" : "RT is found and there is a MRRT entry existed, try with MRRT"; Logger.v(TAG, statusMessage); return tryMRRT(); } Logger.v(TAG, "Send request to use regular RT for new AT."); return acquireTokenWithCachedItem(regularRTItem); }
Source:
public void testProprietaryAPI() { final CreateContent invoke = new CreateContent().invoke(); final ApiClient webClient = getWebClient(true, false); WorkflowsApi client = new WorkflowsApi(webClient); final List<io.swagger.client.model.Workflow> services = client.allPublishedWorkflows(null, null, null, null, null, true); final List<io.swagger.client.model.Workflow> workflows = client.allPublishedWorkflows(null, null, null, null, null, false); Gson gson = new Gson(); String serviceString = gson.toJson(services); System.out.println(serviceString); assertTrue(workflows.size() >= 2 && workflows.stream().noneMatch(workflow -> workflow.getDescriptorType().getValue().equalsIgnoreCase(DescriptorLanguage.SERVICE.toString()))); assertTrue(services.size() >= 1 && services.stream().allMatch(workflow -> workflow.getDescriptorType().getValue().equalsIgnoreCase(DescriptorLanguage.SERVICE.toString()))); client.starEntry(invoke.getServiceID(), new StarRequest().star(true)); client.updateLabels(invoke.getServiceID(), "foo,batman,chicken", ""); final io.swagger.client.model.Workflow workflow = client.getWorkflow(invoke.getServiceID(), ""); assertFalse(workflow.getStarredUsers().isEmpty()); assertTrue(workflow.getLabels().stream().anyMatch(label -> "batman".equals(label.getValue()))); }

Target:
public void testProprietaryAPI() { final CreateContent invoke = new CreateContent().invoke(); final ApiClient webClient = getWebClient(true, false); WorkflowsApi client = new WorkflowsApi(webClient); final List<io.swagger.client.model.Workflow> services = client.allPublishedWorkflows(null, null, null, null, null, true); final List<io.swagger.client.model.Workflow> workflows = client.allPublishedWorkflows(null, null, null, null, null, false); assertTrue(workflows.size() >= 2 && workflows.stream().noneMatch(workflow -> workflow.getDescriptorType().getValue().equalsIgnoreCase(DescriptorLanguage.SERVICE.toString()))); assertTrue(services.size() >= 1 && services.stream().allMatch(workflow -> workflow.getDescriptorType().getValue().equalsIgnoreCase(DescriptorLanguage.SERVICE.toString()))); client.starEntry(invoke.getServiceID(), new StarRequest().star(true)); client.updateLabels(invoke.getServiceID(), "foo,batman,chicken", ""); final io.swagger.client.model.Workflow workflow = client.getWorkflow(invoke.getServiceID(), ""); assertFalse(workflow.getStarredUsers().isEmpty()); assertTrue(workflow.getLabels().stream().anyMatch(label -> "batman".equals(label.getValue()))); }
Source:
private void addFilterToList(final ContextMenuAdapter adapter, final List<PoiUIFilter> list, final PoiUIFilter f) { list.add(f); ContextMenuItem.ItemBuilder builder = new ContextMenuItem.ItemBuilder(); builder.setListener(new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) { if (isChecked) getApplication().getPoiFilters().addSelectedPoiFilter(f); else getApplication().getPoiFilters().removeSelectedPoiFilter(f); return true; } }); builder.setTitle(f.getName()); builder.setSelected(getApplication().getPoiFilters().isPoiFilterSelected(f)); if (RenderingIcons.containsBigIcon(f.getIconId())) { builder.setIcon(RenderingIcons.getBigIconResourceId(f.getIconId())); } else { builder.setIcon(R.drawable.mx_user_defined); } builder.setColor(R.color.osmand_orange); adapter.addItem(builder.createItem()); }

Target:
private void addFilterToList(final ContextMenuAdapter adapter, final List<PoiUIFilter> list, final PoiUIFilter f) { list.add(f); ContextMenuItem.ItemBuilder builder = new ContextMenuItem.ItemBuilder(); builder.setListener(new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) { if (isChecked) { getApplication().getPoiFilters().addSelectedPoiFilter(f); } else { getApplication().getPoiFilters().removeSelectedPoiFilter(f); } return true; } }); builder.setTitle(f.getName()); builder.setSelected(getApplication().getPoiFilters().isPoiFilterSelected(f)); if (RenderingIcons.containsBigIcon(f.getIconId())) { builder.setIcon(RenderingIcons.getBigIconResourceId(f.getIconId())); } else { builder.setIcon(R.drawable.mx_user_defined); } builder.setColor(R.color.osmand_orange); adapter.addItem(builder.createItem()); }
Source:
private boolean hasCrashedGSPP( TreeNode<?,?> treeNode, PageCursor cursor ) throws IOException { boolean isTreeNode; int keyCount; do { isTreeNode = TreeNode.nodeType( cursor ) == TreeNode.NODE_TYPE_TREE_NODE; keyCount = treeNode.keyCount( cursor ); } while ( cursor.shouldRetry() ); if ( !isTreeNode ) { return false; } boolean hasCrashed; do { hasCrashed = hasCrashedGSPP( cursor, TreeNode.BYTE_POS_NEWGEN ) || hasCrashedGSPP( cursor, TreeNode.BYTE_POS_LEFTSIBLING ) || hasCrashedGSPP( cursor, TreeNode.BYTE_POS_RIGHTSIBLING ); if ( !hasCrashed && TreeNode.isInternal( cursor ) ) { for ( int i = 0; i <= keyCount && i <= maxKeyCount && !hasCrashed; i++ ) { hasCrashed |= hasCrashedGSPP( cursor, treeNode.childOffset( i ) ); } } } while ( cursor.shouldRetry() ); return hasCrashed; }

Target:
private boolean hasCrashedGSPP( TreeNode<?,?> treeNode, PageCursor cursor ) throws IOException { boolean isTreeNode; int keyCount; do { isTreeNode = TreeNode.nodeType( cursor ) == TreeNode.NODE_TYPE_TREE_NODE; keyCount = treeNode.keyCount( cursor ); } while ( cursor.shouldRetry() ); PageCursorUtil.checkOutOfBounds( cursor ); if ( !isTreeNode ) { return false; } boolean hasCrashed; do { hasCrashed = hasCrashedGSPP( cursor, TreeNode.BYTE_POS_NEWGEN ) || hasCrashedGSPP( cursor, TreeNode.BYTE_POS_LEFTSIBLING ) || hasCrashedGSPP( cursor, TreeNode.BYTE_POS_RIGHTSIBLING ); if ( !hasCrashed && TreeNode.isInternal( cursor ) ) { for ( int i = 0; i <= keyCount && i <= internalMaxKeyCount && !hasCrashed; i++ ) { hasCrashed = hasCrashedGSPP( cursor, treeNode.childOffset( i ) ); } } } while ( cursor.shouldRetry() ); PageCursorUtil.checkOutOfBounds( cursor ); return hasCrashed; }
Source:
public Collection<Session> values() { removeClosedSessions(); return ImmutableSet.copyOf(sessions); }

Target:
public Collection<Session> values() { return sessions.stream().filter(Session::isOpen).collect(Collectors.toSet()); }
Source:
private X509CRL loadRevokedCertificates(CertificateFactory cf, String crlFile) throws IOException, CRLException { X509CRL crl = null; try { FileInputStream fis = new FileInputStream(crlFile); crl = (X509CRL) cf.generateCRL(fis); fis.close(); } catch (FileNotFoundException ex) { } return crl; }

Target:
private X509CRL loadRevokedCertificates(CertificateFactory cf, String crlFile) throws IOException, CRLException { X509CRL crl = null; FileInputStream fis = null; try { new FileInputStream(crlFile); crl = (X509CRL) cf.generateCRL(fis); fis.close(); } catch (FileNotFoundException ex) { } finally { if ( fis != null ) { fis.close(); } } return crl; }
Source:
void proceedVmReportedOnOtherHost() { switch(vdsmVm.getVmDynamic().getStatus()) { case MigratingTo: if (dbVm.getRunOnVds() == null) { log.info("VM '{}' is found as migrating on VDS '{}'({}) ", vdsmVm.getVmDynamic().getId(), vdsManager.getVdsId(), vdsManager.getVdsName()); dbVm.updateRuntimeData(vdsmVm.getVmDynamic(), vdsManager.getVdsId()); saveDynamic(dbVm); if (!vdsManager.isInitialized()) { resourceManager.removeVmFromDownVms(vdsManager.getVdsId(), vdsmVm.getVmDynamic().getId()); } } else { log.info("VM '{}' is migrating to VDS '{}'({}) ignoring it in the refresh until migration is done", vdsmVm.getVmDynamic().getId(), vdsManager.getVdsId(), vdsManager.getVdsName()); } return; case MigratingFrom: return; case Paused: if (vdsmVm.getVmDynamic().getPauseStatus() == VmPauseStatus.POSTCOPY) { return; } break; case WaitForLaunch: if (dbVm.getStatus() == VMStatus.Unknown) { return; } break; default: } if (isVmMigratingToThisVds() && vdsmVm.getVmDynamic().getStatus().isRunning()) { succeededToRun = true; } if (vdsmVm.getVmDynamic().getStatus().isUpOrPaused()) { succeededToRun = true; } dbVm.updateRuntimeData(vdsmVm.getVmDynamic(), vdsManager.getVdsId()); saveDynamic(dbVm); updateStatistics(); if (!vdsManager.isInitialized()) { resourceManager.removeVmFromDownVms(vdsManager.getVdsId(), vdsmVm.getVmDynamic().getId()); } }

Target:
void proceedVmReportedOnOtherHost() { switch(vdsmVm.getVmDynamic().getStatus()) { case MigratingTo: if (dbVm.getRunOnVds() == null) { log.info("VM '{}' is found as migrating on VDS '{}'({}) ", vdsmVm.getVmDynamic().getId(), vdsManager.getVdsId(), vdsManager.getVdsName()); dbVm.updateRuntimeData(vdsmVm.getVmDynamic(), vdsManager.getVdsId()); saveDynamic(dbVm); if (!vdsManager.isInitialized()) { resourceManager.removeVmFromDownVms(vdsManager.getVdsId(), vdsmVm.getVmDynamic().getId()); } } else { log.info("VM '{}' is migrating to VDS '{}'({}) ignoring it in the refresh until migration is done", vdsmVm.getVmDynamic().getId(), vdsManager.getVdsId(), vdsManager.getVdsName()); } return; case MigratingFrom: return; case Paused: if (vdsmVm.getVmDynamic().getPauseStatus() == VmPauseStatus.POSTCOPY) { return; } break; case WaitForLaunch: if (dbVm.getStatus() == VMStatus.Unknown) { return; } break; default: } if (isVmMigratingToThisVds() && vdsmVm.getVmDynamic().getStatus().isRunningOrPaused()) { succeededToRun = true; } if (vdsmVm.getVmDynamic().getStatus() == VMStatus.Up) { succeededToRun = true; } dbVm.updateRuntimeData(vdsmVm.getVmDynamic(), vdsManager.getVdsId()); saveDynamic(dbVm); updateStatistics(); if (!vdsManager.isInitialized()) { resourceManager.removeVmFromDownVms(vdsManager.getVdsId(), vdsmVm.getVmDynamic().getId()); } }
Source:
private void postPushUnregister(BroadcastReceiver pushReceiver, final ClientManager clientMgr, final boolean showLoginPage, final String refreshToken, final String loginServer, final Account account, Activity frontActivity) { if (numPostPushUnregisterCalls <= 1) { try { context.unregisterReceiver(pushReceiver); } catch (Exception e) { SalesforceSDKLogger.e(TAG, "Exception occurred while un-registering", e); } removeAccount(clientMgr, showLoginPage, refreshToken, loginServer, account, frontActivity); } else { numPostPushUnregisterCalls = 0; } }

Target:
private void postPushUnregister(BroadcastReceiver pushReceiver, final ClientManager clientMgr, final boolean showLoginPage, final String refreshToken, final String loginServer, final Account account, Activity frontActivity) { try { context.unregisterReceiver(pushReceiver); } catch (Exception e) { SalesforceSDKLogger.e(TAG, "Exception occurred while un-registering", e); } removeAccount(clientMgr, showLoginPage, refreshToken, loginServer, account, frontActivity); }
Source:
public int getOffset() { int offset = row; ++row; return offset; }

Target:
public int getOffset() { int offset = row; row++; return offset; }
Source:
public ExtendedQueryResult<T> maxResults(int max) { lastPaginatedQuery = null; if (!context.getRepositoryMethod().isQuery()) { maxResults = max; pageSize = max; } else { context.addJpaQueryPostProcessor(new MaxResultPostProcessor(max)); } return this; }

Target:
public ExtendedQueryResult<T> maxResults(int max) { lastPaginatedQuery = null; if (context.getRepositoryMethod().isQuery()) { context.addJpaQueryPostProcessor(new MaxResultPostProcessor(max)); } else { maxResults = max; pageSize = max; } return this; }
Source:
protected Object exchange(URI uri, HttpMethod httpMethod, HttpEntity<?> httpRequest, Object expectedResponseType) { SettableListenableFuture<Object> replyMessageFuture = new SettableListenableFuture<>(); ListenableFuture<? extends ResponseEntity<?>> responseFuture; if (expectedResponseType instanceof ParameterizedTypeReference<?>) { responseFuture = this.asyncRestTemplate.exchange(uri, httpMethod, httpRequest, (ParameterizedTypeReference<?>) expectedResponseType); } else { responseFuture = this.asyncRestTemplate.exchange(uri, httpMethod, httpRequest, (Class<?>) expectedResponseType); } responseFuture.addCallback(new ListenableFutureCallback<ResponseEntity<?>>() { @Override public void onFailure(Throwable ex) { replyMessageFuture.setException(ex); } @Override public void onSuccess(ResponseEntity<?> result) { replyMessageFuture.set(AsyncHttpRequestExecutingMessageHandler.this.getReply(result)); } }); return replyMessageFuture; }

Target:
protected Object exchange(URI uri, HttpMethod httpMethod, HttpEntity<?> httpRequest, Object expectedResponseType) { SettableListenableFuture<Object> replyMessageFuture = new SettableListenableFuture<>(); ListenableFuture<? extends ResponseEntity<?>> responseFuture; if (expectedResponseType instanceof ParameterizedTypeReference<?>) { responseFuture = this.asyncRestTemplate.exchange(uri, httpMethod, httpRequest, (ParameterizedTypeReference<?>) expectedResponseType); } else { responseFuture = this.asyncRestTemplate.exchange(uri, httpMethod, httpRequest, (Class<?>) expectedResponseType); } responseFuture.addCallback( result -> replyMessageFuture.set(getReply(result)), replyMessageFuture::setException); return replyMessageFuture; }
Source:
public void visitIdentifier(IdentifierTree tree) { Iterator<Set<IdentifierTree>> iterator = writeUsagesOfCounters.descendingIterator(); while (iterator.hasNext()) { Set<IdentifierTree> currentLoopCounterUsages = iterator.next(); if (currentLoopCounterUsages.contains(tree)) { raiseIssue(tree); return; } } }

Target:
public void visitIdentifier(IdentifierTree tree) { for (Map<IdentifierTree, IdentifierTree> currentLoopCounterUsages : writeUsagesOfCounters) { IdentifierTree identifierUsedInUpdateClause = currentLoopCounterUsages.get(tree); if (identifierUsedInUpdateClause != null) { raiseIssue(tree, identifierUsedInUpdateClause); return; } } }
Source:
@Override public <K, V> StackedModel<IS, IA, O, AM> update(StackedModel<IS, IA, O, AM> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return runOnSubmodels( ensemble -> { int i = 0; List<IgniteSupplier<Model<IS, IA>>> res = new ArrayList<>(); for (Model<IS, IA> submodel : mdl.submodels()) { int j = i; res.add(() -> ensemble.get(j).update(submodel, datasetBuilder, featureExtractor, lbExtractor)); i++; } return res; }, (at, extr) -> at.fit(datasetBuilder, extr, lbExtractor), featureExtractor ); }

Target:
@Override public <K, V> StackedModel<IS, IA, O, AM> update(StackedModel<IS, IA, O, AM> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return runOnSubmodels( ensemble -> { List<IgniteSupplier<Model<IS, IA>>> res = new ArrayList<>(); for (int i = 0; i < ensemble.size(); i++) { final int j = i; res.add(() -> { DatasetTrainer<Model<IS, IA>, L> trainer = ensemble.get(j); return mdl == null ? trainer.fit(datasetBuilder, featureExtractor, lbExtractor) : trainer.update(mdl.submodels().get(j), datasetBuilder, featureExtractor, lbExtractor); }); } return res; }, (at, extr) -> mdl == null ? at.fit(datasetBuilder, extr, lbExtractor) : at.update(mdl.aggregatorModel(), datasetBuilder, extr, lbExtractor), featureExtractor ); }
Source:
private static byte[] getQualifierForDynamicColumnMetaDataCell(PTableProtos.PColumn dynColProto) throws IOException { PColumn dynCol = PColumnImpl.createFromProto(dynColProto); ByteArrayOutputStream qual = new ByteArrayOutputStream(); qual.write(DYN_COLS_METADATA_CELL_QUALIFIER); qual.write(dynCol.getColumnQualifierBytes()); if (LOG.isDebugEnabled()) { LOG.debug("Storing shadow cell for dynamic column metadata for dynamic column : " + dynCol.getFamilyName().getString() + "." + dynCol.getName().getString()); } return qual.toByteArray(); }

Target:
private static byte[] getQualifierForDynamicColumnMetaDataCell(PTableProtos.PColumn dynColProto) throws IOException { PColumn dynCol = PColumnImpl.createFromProto(dynColProto); ByteArrayOutputStream qual = new ByteArrayOutputStream(); qual.write(DYN_COLS_METADATA_CELL_QUALIFIER); qual.write(dynCol.getColumnQualifierBytes()); if (LOG.isTraceEnabled()) { LOG.trace("Storing shadow cell for dynamic column metadata for dynamic column : " + dynCol.getFamilyName().getString() + "." + dynCol.getName().getString()); } return qual.toByteArray(); }
Source:
public void refresh(final Diagram diagram) { clearDecisionComponents(); enableLoading(); client.loadNodesByNamespaces(getNamespaces(diagram), getNodesConsumer()); }

Target:
public void refresh(final Diagram diagram) { clearDecisionComponents(); startLoading(); client.loadNodesFromImports(getDMNIncludedModels(diagram), getNodesConsumer()); }
Source:
private List<String> getAppThemePossiblePaths(String themePath) { String themePathInMetaInfResources = String.join("/", APPLICATION_META_INF_RESOURCES, themePath); String themePathInStaticResources = String.join("/", APPLICATION_STATIC_RESOURCES, themePath); String themePathInClassPathResources = FrontendUtils.NODE_MODULES + FrontendUtils.FLOW_NPM_PACKAGE_NAME + themePath; return Arrays.asList(themePathInMetaInfResources, themePathInStaticResources, themePathInClassPathResources); }

Target:
private List<String> getAppThemePossiblePaths(String themePath) { String frontendTheme = String.join("/", npmFolder.toPath() .relativize(frontendDirectory.toPath()).toString(), themePath); String themePathInMetaInfResources = String.join("/", APPLICATION_META_INF_RESOURCES, themePath); String themePathInStaticResources = String.join("/", APPLICATION_STATIC_RESOURCES, themePath); String themePathInClassPathResources = String.join("", FrontendUtils.NODE_MODULES, FrontendUtils.FLOW_NPM_PACKAGE_NAME, themePath); return Arrays.asList(frontendTheme, themePathInMetaInfResources, themePathInStaticResources, themePathInClassPathResources); }
Source:
private List<JdbcLiteral> replacePlaceholder(StringBuilder sb, String rawQuery, JdbcSchema querySchema, List<Integer> incrementalColumnIndexes, List<JsonNode> incrementalValues) { ImmutableList.Builder<JdbcLiteral> parameters = ImmutableList.builder(); for (int n = 0; n < incrementalColumnIndexes.size(); n++) { int columnIndex = incrementalColumnIndexes.get(n); String columnName = querySchema.getColumnName(columnIndex); JsonNode value = incrementalValues.get(n); rawQuery = rawQuery.replaceAll(":" + columnName, "?"); parameters.add(new JdbcLiteral(columnIndex, value)); } sb.append(rawQuery); return parameters.build(); }

Target:
private List<JdbcLiteral> replacePlaceholder(StringBuilder sb, String rawQuery, JdbcSchema querySchema, List<Integer> incrementalColumnIndexes, List<JsonNode> incrementalValues) { TreeMap<String, Integer> columnNames = new TreeMap<>(new Comparator<String>() { @Override public int compare(String val1, String val2) { return val2.length() - val1.length(); } }); ImmutableList.Builder<JdbcLiteral> parameters = ImmutableList.builder(); for (int n = 0; n < incrementalColumnIndexes.size(); n++) { int columnIndex = incrementalColumnIndexes.get(n); String columnName = querySchema.getColumnName(columnIndex); columnNames.put(columnName, columnIndex); } for (Map.Entry<Integer, Integer> columnPosition: generateColumnPositionList(rawQuery, columnNames).entrySet()) { int columnIndex = columnPosition.getValue(); JsonNode value = incrementalValues.get(columnIndex); parameters.add(new JdbcLiteral(columnIndex, value)); } for (Entry<String, Integer> column : columnNames.entrySet()) { String columnName = column.getKey(); while (rawQuery.contains(":" + columnName)) { rawQuery = rawQuery.replaceFirst(":" + columnName, "?"); } } sb.append(rawQuery); return parameters.build(); }
Source:
public static CharSequence decodeMimeTypeFromMimeBuffer(ByteBuf flyweightMimeBuffer) { if (flyweightMimeBuffer.readableBytes() < 2) { return null; } flyweightMimeBuffer.skipBytes(1); int mimeStringLength = flyweightMimeBuffer.readableBytes(); return flyweightMimeBuffer.readCharSequence(mimeStringLength, CharsetUtil.US_ASCII); }

Target:
public static CharSequence decodeMimeTypeFromMimeBuffer(ByteBuf flyweightMimeBuffer) { if (flyweightMimeBuffer.readableBytes() < 2) { throw new IllegalStateException("unable to decode explicit MIME type"); } flyweightMimeBuffer.skipBytes(1); int mimeStringLength = flyweightMimeBuffer.readableBytes(); return flyweightMimeBuffer.readCharSequence(mimeStringLength, CharsetUtil.US_ASCII); }
Source:
public final void sourceOnlyConfiguration(Configuration configuration) { Preconditions.checkNotNull(configuration); Preconditions.checkArgument( configuration.isCanBeResolved(), "May only add sourceOnlyConfiguration if it is resolvable: %s", configuration); this.sourceOnlyConfigurations.add(Objects.requireNonNull(configuration)); }

Target:
public final void sourceOnlyConfiguration(Configuration configuration) { Preconditions.checkNotNull(configuration, "This method requires a non-null configuration"); Preconditions.checkArgument( configuration.isCanBeResolved(), "May only add sourceOnlyConfiguration if it is resolvable: %s", configuration); this.sourceOnlyConfigurations.add(Objects.requireNonNull(configuration)); }
Source:
public void catchUp(Timestamp since, @Nullable Set<I> ids) throws CatchUpAlreadyStartedException { checkCatchUpTargets(ids); checkCatchUpStartTime(since); withCurrentTenant(context().isMultitenant()).run( () -> catchUpProcess.startCatchUp(since, ids) ); }

Target:
public CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids) throws CatchUpAlreadyStartedException { checkCatchUpTargets(ids); checkCatchUpStartTime(since); CatchUpId catchUpId = withCurrentTenant(context().isMultitenant()) .evaluate(() -> catchUpProcess.startCatchUp(since, ids)); return catchUpId; }
Source:
public static void input(@AggregationState GeometryState state, @SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = GeometrySerde.deserialize(input); if (state.getGeometry() == null) { state.setGeometry(geometry.convexHull()); } else if (!geometry.isEmpty()) { state.addMemoryUsage(-state.estimateGeometryMemorySize()); state.setGeometry(state.getGeometry().union(geometry).convexHull()); } state.addMemoryUsage(state.estimateGeometryMemorySize()); }

Target:
public static void input(@AggregationState GeometryState state, @SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = GeometrySerde.deserialize(input); if (state.getGeometry() == null) { state.setGeometry(geometry.convexHull(), 0); } else if (!geometry.isEmpty()) { long previousMemorySize = state.getGeometry().estimateMemorySize(); state.setGeometry(state.getGeometry().union(geometry).convexHull(), previousMemorySize); } }
Source:
public final String raw( @NotNull(message = "Markdown can't be NULL") final String text ) throws IOException { throw new NotImplementedException("MkMarkdown#raw()"); }

Target:
public final String raw( @NotNull(message = "Markdown can't be NULL") final String text ) { return text; }
Source:
protected static void removeProject(Logger log) { log.info("Removing " + PROJECT_NAME); try { org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException runtimeExc) { log.info("Runtime exception appeared, re-trying deleting of project"); org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } new WaitWhile(new JobIsRunning()); }

Target:
protected static void removeProject(Logger log) { log.info("Removing " + PROJECT_NAME); try { new WaitUntil(new JobIsRunning(), TimePeriod.NORMAL); org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException exc) { log.error("RuntimeException occured during deleting project"); exc.printStackTrace(); log.info("Deleting project second time ..."); try { org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException e) { throw new RuntimeException("Was not possible to delete project: " + PROJECT_NAME, e); } } new WaitWhile(new JobIsRunning()); }
Source:
default void fetchInstallableApplications(Consumer<RepositoryDTO> callback, Consumer<Exception> errorCallback) { try { callback.accept(fetchInstallableApplications()); } catch (Exception e) { e.printStackTrace(); errorCallback.accept(e); } }

Target:
default void fetchInstallableApplications(Consumer<RepositoryDTO> callback, Consumer<Exception> errorCallback) { try { callback.accept(fetchInstallableApplications()); } catch (Exception e) { LOGGER.error("Fetching installable applications failed!", e); errorCallback.accept(e); } }
Source:
public String identifySimple() { return "bigdoor@" + door.getDoorUID(); }

Target:
public String identifySimple() { return identify(); }
Source:
public R record() { return record; }

Target:
public final R record() { return record; }
Source:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return CollectionUtils .isNotEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName)); }

Target:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return !vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName).isEmpty(); }
Source:
public YarnRestJobStatusProvider(JobsResourceConfig config) { YarnJobResourceConfig yarnConfig = new YarnJobResourceConfig(config); this._objectMapper = new ObjectMapper(); this._objectMapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true); this._httpClient = new HttpClient(); this._apiEndpoint = String.format("http://%s/ws/v1/cluster/apps?states=RUNNING,NEW,NEW_SAVING,SUBMITTED,ACCEPTED", yarnConfig.getYarnResourceManagerEndpoint()); }

Target:
public YarnRestJobStatusProvider(JobsResourceConfig config) { YarnJobResourceConfig yarnConfig = new YarnJobResourceConfig(config); this.httpClient = new HttpClient(); OBJECT_MAPPER.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true); this.apiEndpoint = String.format("http://%s/ws/v1/cluster/apps", yarnConfig.getYarnResourceManagerEndpoint()); }
Source:
private void scanErrorLogs(String errFilePath) throws IOException { File regfile = new File(errFilePath); try (BufferedReader reader = new BufferedReader(new FileReader(regfile))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.contains("Error") || line.contains("@INC")) { logger.log(Level.WARNING, "Regripper file {0} contains errors from run", errFilePath); } line = reader.readLine(); } } }

Target:
private void scanErrorLogs(String errFilePath) throws IOException { File regfile = new File(errFilePath); try (BufferedReader reader = new BufferedReader(new FileReader(regfile))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.toLowerCase().contains("error") || line.toLowerCase().contains("@inc")) { logger.log(Level.WARNING, "Regripper file {0} contains errors from run", errFilePath); } line = reader.readLine(); } } }
Source:
public int hashCode() { int hash = 0; for (String editor : editors) { hash = hash * 37 + editor.hashCode(); } for (IEditorInput element : input) { hash = hash * 37 + element.hashCode(); } return hash; }

Target:
public int hashCode() { int hash = 0; for (String editor : editors) { hash = hash * 37 + editor.hashCode(); } for (IEditorInput editorInput : input) { hash = hash * 37 + editorInput.hashCode(); } return hash; }
Source:
public short getFlag() { return flag; }

Target:
public byte getFlag() { return flag; }
Source:
private String getExpectedBeanName(String domain, String instanceName, String grp, String name) { StringBuffer sb = new StringBuffer(); sb.append(domain + ":"); if (getBoolean(IGNITE_MBEAN_APPEND_CLASS_LOADER_ID, true)) { String clsLdrHash = Integer.toHexString(Ignite.class.getClassLoader().hashCode()); sb.append("clsLdr=").append(clsLdrHash).append(','); } if (getBoolean(IGNITE_MBEAN_APPEND_JVM_ID)) { String jvmId = ManagementFactory.getRuntimeMXBean().getName(); sb.append("jvmId=").append(jvmId).append(','); } sb.append("group=").append(grp).append(","); sb.append("igniteInstanceName=").append(instanceName).append(","); sb.append("name=").append(name); return sb.toString(); }

Target:
private String getExpectedBeanName(String domain, String instanceName, String grp, String name) { StringBuffer sb = new StringBuffer(); sb.append(domain + ":"); sb.append("group=").append(grp).append(","); sb.append("igniteInstanceName=").append(instanceName).append(","); sb.append("name=").append(name); return sb.toString(); }
Source:
public void addPageTerminalControl(ITerminalControl terminalControl) { if (fHistoryBuffer.size() > 0) { new WriteHistoryJob(terminalControl).schedule(); } fTerminalPageControls.add(terminalControl); }

Target:
public void addPageTerminalControl(ITerminalControl terminalControl) { new WriteHistoryJob(terminalControl).schedule(); }
Source:
public RequestSpecBacking(MutableHeaders headers, URI uri, ByteBufAllocator byteBufAllocator, RequestParams requestParams) { this.headers = headers; this.uri = uri; this.byteBufAllocator = byteBufAllocator; this.requestParams = requestParams; this.bodyByteBuf = byteBufAllocator.buffer(0, 0); this.decompressResponse = false; }

Target:
public RequestSpecBacking(MutableHeaders headers, URI uri, ByteBufAllocator byteBufAllocator, RequestParams requestParams) { this.headers = headers; this.uri = uri; this.byteBufAllocator = byteBufAllocator; this.requestParams = requestParams; this.bodyByteBuf = byteBufAllocator.buffer(0, 0); this.decompressResponse = true; }