auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { String masterHost = null; int masterPort = RemoteSlaveConnection.DEFAULT_PORT; int slaveIndex = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-master")) { String param = args[i + 1]; if (param.contains(":")) { masterHost = param.substring(0, param.indexOf(":")); try { masterPort = Integer.parseInt(param.substring(param.indexOf(":") + 1)); } catch (NumberFormatException nfe) { log.warn("Unable to parse port part of the master! Failing!"); ShutDownHook.exit(10); } } else { masterHost = param; } } else if (args[i].equals("-slaveIndex")) { try { slaveIndex = Integer.parseInt(args[i + 1]); } catch (NumberFormatException nfe) { log.warn("Unable to parse slaveIndex! Failing!"); ShutDownHook.exit(10); } } else { PluginParamHolder.parseCommandLineArg(args[i]); } } if (masterHost == null) { printUsageAndExit(); } Slave slave = new Slave(new RemoteMasterConnection(masterHost, masterPort)); try { slave.run(slaveIndex); } catch (Exception e) { e.printStackTrace(); ShutDownHook.exit(10); } }

Target:
public static void main(String[] args) { ArgsHolder.init(args, ArgsHolder.ArgType.SLAVE); if (ArgsHolder.getMasterHost() == null) { printUsageAndExit(); } Slave slave = new Slave(new RemoteMasterConnection(ArgsHolder.getMasterHost(), ArgsHolder.getMasterPort())); try { slave.run(ArgsHolder.getSlaveIndex()); } catch (Exception e) { e.printStackTrace(); ShutDownHook.exit(10); } }
Source:
private void initialize() { project = (IProject) getElement().getAdapter(IResource.class); if (project == null) { throw new RuntimeException( TasksUiPlugin.ID_PLUGIN + ": Can not get the project of " + getElement().toString()); } noDefaultAndApplyButton(); setDescription( Messages.ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below); }

Target:
private void initialize() { project = (IProject) getElement().getAdapter(IResource.class); if (project == null) { throw new RuntimeException( TasksUiPlugin.ID_PLUGIN + ": Can not get the project of " + getElement()); } noDefaultAndApplyButton(); setDescription( Messages.ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below); }
Source:
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { if (this.delegate != null) { ConservedHeadersFilter.extractHeaders(request) .forEach((header, value) -> { if (HEADER_BLACKLIST.copyToResponse(header.getHeaderName())) { response.setHeader(header.getHeaderName(), value); } }); this.delegate.handle(target, baseRequest, request, response); } }

Target:
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { if (this.delegate != null) { ConservedHeadersFilter.extractHeaders(request) .forEach((header, value) -> { if (HEADER_BLACKLIST.canCopyToResponse(header.getHeaderName())) { response.setHeader(header.getHeaderName(), value); } }); this.delegate.handle(target, baseRequest, request, response); } }
Source:
public CloseableIterator<SAMRecord> queryAlignmentStart(final String sequence, final int start) { final int referenceIndex = this.mFileHeader.getSequenceIndex(sequence); if (referenceIndex == -1) { return new CloseableIterator<SAMRecord>() { @Override public void close() { } @Override public boolean hasNext() { return false; } @Override public SAMRecord next() { return null; } }; } else { final HtsgetRequest req = new HtsgetRequest(this.mSource).withInterval(new Interval(sequence, start, Integer.MAX_VALUE)); final CloseableIterator<SAMRecord> queryIterator = new HtsgetBAMFileIterator(req); final BAMStartingAtIteratorFilter filter = new BAMStartingAtIteratorFilter(this.mFileHeader.getSequenceIndex(sequence), start); final CloseableIterator<SAMRecord> filteredIterator = new BAMQueryFilteringIterator(queryIterator, filter); this.iterators.add(filteredIterator); return filteredIterator; } }

Target:
public CloseableIterator<SAMRecord> queryAlignmentStart(final String sequence, final int start) { final int referenceIndex = this.mFileHeader.getSequenceIndex(sequence); if (referenceIndex == -1) { return new EmptyBamIterator(); } else { final HtsgetRequest req = new HtsgetRequest(this.mSource) .withFormat(HtsgetFormat.BAM) .withInterval(new Interval(sequence, start, start + 1)); final CloseableIterator<SAMRecord> iterator = new HtsgetBAMFileIterator(req); final BAMStartingAtIteratorFilter filter = new BAMStartingAtIteratorFilter(referenceIndex, start); final CloseableIterator<SAMRecord> filteringIterator = new BAMQueryFilteringIterator(iterator, filter); final CloseableIterator<SAMRecord> queryIterator = this.mUseAsynchronousIO ? new SAMRecordPrefetchingIterator(filteringIterator, READAHEAD_LIMIT) : filteringIterator; this.iterators.add(queryIterator); return queryIterator; } }
Source:
public QueueAsyncClientBuilder endpoint(String endpoint) { Objects.requireNonNull(endpoint); try { URL fullURL = new URL(endpoint); this.endpoint = new URL(fullURL.getProtocol() + "://" + fullURL.getHost()); String[] pathSegments = fullURL.getPath().split("/", 2); if (pathSegments.length == 2 && !ImplUtils.isNullOrEmpty(pathSegments[1])) { this.queueName = pathSegments[1]; } SASTokenCredential credential = SASTokenCredential.fromQuery(fullURL.getQuery()); if (credential != null) { this.sasTokenCredential = credential; } } catch (MalformedURLException ex) { throw new IllegalArgumentException("The Azure Storage Queue endpoint url is malformed."); } return this; }

Target:
public QueueAsyncClientBuilder endpoint(String endpoint) { Objects.requireNonNull(endpoint); try { UrlBuilder urlBuilder = UrlBuilder.parse(endpoint); URL fullURL = new URL(endpoint); this.endpoint = new URL(fullURL.getProtocol() + "://" + fullURL.getHost()); String[] pathSegments = fullURL.getPath().split("/", 2); if (pathSegments.length == 2 && !ImplUtils.isNullOrEmpty(pathSegments[1])) { this.queueName = pathSegments[1]; } SASTokenCredential credential = SASTokenCredential.fromQuery(fullURL.getQuery()); if (credential != null) { this.sasTokenCredential = credential; } } catch (MalformedURLException ex) { throw new IllegalArgumentException("The Azure Storage Queue endpoint url is malformed."); } return this; }
Source:
public void testCompareToMessageWithGreaterLineNumber() { ViolationMessage messageWithGreaterLineNumber = new ViolationMessage(null, "/usr/bin/local", 12, 5, Severity.ERROR, "errMsg"); int ret = this.violationMessage.compareTo(messageWithGreaterLineNumber); assertThat(ret, lessThan(0)); }

Target:
public void testCompareToMessageWithGreaterLineNumber() { ViolationMessage messageWithGreaterLineNumber = new ViolationMessage(Rules.LOWER_CAMEL_CASE, "/usr/bin/local", 12, 5, Severity.ERROR, "errMsg"); int ret = this.violationMessage.compareTo(messageWithGreaterLineNumber); assertThat(ret, lessThan(0)); }
Source:
public static void setup() { WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog(); preferenceDialog.open(); MavenSettingsPreferencePage prefPage = new MavenSettingsPreferencePage(preferenceDialog); preferenceDialog.select(prefPage); preferenceDialog.ok(); new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); new DefaultEditor(CENTRAL_LABEL); }

Target:
public static void setup() { new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); new DefaultEditor(CENTRAL_LABEL); }
Source:
public ModelAndView editBulkSamples(@PathVariable String sampleIds, ModelMap model) throws IOException { try { List<Long> idList = getIdsFromString(sampleIds); ObjectMapper mapper = new ObjectMapper(); JSONArray samplesDtos = new JSONArray(); for (Sample sample : requestManager.getSamplesByIdList(idList)) { samplesDtos.add(Dtos.asDto(sample)); } model.put("title", "Bulk Edit Samples"); model.put("samplesJSON", samplesDtos); model.put("method", "Edit"); return new ModelAndView("/pages/bulkEditSamples.jsp", model); } catch (IOException ex) { if (log.isDebugEnabled()) { log.error("Failed to get bulk samples", ex); } throw ex; } }

Target:
public ModelAndView editBulkSamples(@PathVariable String sampleIds, ModelMap model) throws IOException { try { List<Long> idList = getIdsFromString(sampleIds); ObjectMapper mapper = new ObjectMapper(); List<SampleDto> samplesDtos = new ArrayList<SampleDto>(); for (Sample sample : requestManager.getSamplesByIdList(idList)) { samplesDtos.add(Dtos.asDto(sample)); } model.put("title", "Bulk Edit Samples"); model.put("samplesJSON", mapper.writeValueAsString(samplesDtos)); model.put("method", "Edit"); return new ModelAndView("/pages/bulkEditSamples.jsp", model); } catch (IOException ex) { if (log.isDebugEnabled()) { log.error("Failed to get bulk samples", ex); } throw ex; } }
Source:
public void addCloudConfig(String clusterName, CloudConfig cloudConfig) { logger.info("Add CloudConfig to cluster {}.", clusterName); if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) { throw new HelixException("cluster " + clusterName + " is not setup yet"); } CloudConfig.Builder builder = new CloudConfig.Builder(cloudConfig); builder.setClusterName(clusterName); CloudConfig cloudConfigBuilder = builder.build(); ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient)); Builder keyBuilder = accessor.keyBuilder(); accessor.setProperty(keyBuilder.cloudConfig(), cloudConfigBuilder); }

Target:
public void addCloudConfig(String clusterName, CloudConfig cloudConfig) { logger.info("Add CloudConfig to cluster {}, CloudConfig is {}.", clusterName, cloudConfig.toString()); if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) { throw new HelixException("cluster " + clusterName + " is not setup yet"); } CloudConfig.Builder builder = new CloudConfig.Builder(cloudConfig); CloudConfig cloudConfigBuilder = builder.build(); ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient)); Builder keyBuilder = accessor.keyBuilder(); accessor.setProperty(keyBuilder.cloudConfig(), cloudConfigBuilder); }
Source:
public boolean isContentLoaded() { wait.forElementVisible(iframe); driver.switchTo().frame(iframe); try { wait.forElementVisible(contentInput); driver.switchTo().defaultContent(); return true; } catch (NoSuchElementException e) { PageObjectLogging.log("isContentLoaded", "RTE editor loaded", false, driver); driver.switchTo().defaultContent(); return false; } }

Target:
public boolean isContentLoaded() { wait.forElementVisible(iframe); driver.switchTo().frame(iframe); try { wait.forElementVisible(contentInput); return true; } catch (TimeoutException e) { PageObjectLogging.log("isContentLoaded", "RTE editor loaded", false, driver); return false; } finally { driver.switchTo().defaultContent(); } }
Source:
void setValue(String param, String value) { if ("IPADDRESS".equalsIgnoreCase(param)) { m_ipAddress = value; } else if ("HOSTNAME".equalsIgnoreCase(param)) { m_hostName = value; } else if ("CLIENTPORT".equalsIgnoreCase(param)) { m_clientPort = Integer.parseInt(value); } }

Target:
void setValue(String param, String value) { if ("IPADDRESS".equalsIgnoreCase(param)) { m_ipAddress = value; } else if ("HOSTNAME".equalsIgnoreCase(param)) { m_hostName = value; } else if ("CLIENTPORT".equalsIgnoreCase(param)) { m_clientPort = Integer.parseInt(value); } else if ("ADMINPORT".equalsIgnoreCase(param)) { m_adminPort = Integer.parseInt(value); } }
Source:
public void testValidateDataNotes() { this.transactionDto.setAmount(TEN); this.transactionDto.setTransactionType(DEPOSIT); this.transactionDto.setNotes( "notesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotesnotes"); this.transactionInputValidator.validate(this.transactionDto); }

Target:
public void testValidateDataNotes() { this.transactionDto.setAmount(TEN); this.transactionDto.setTransactionType(DEPOSIT); this.transactionDto.setNotes(RandomStringUtils.randomAlphabetic(256)); this.transactionInputValidator.validate(this.transactionDto); }
Source:
private void waitForJoinerView(Address joiner, int joinerViewId, long timeout) throws InterruptedException { if (joinerViewId > viewId || clusterManagerStatus == ClusterManagerStatus.RECOVERING_CLUSTER) { if (trace) { if (joinerViewId > viewId) { log.tracef("Waiting to install view %s before processing join request from %s", joiner, joinerViewId); } else { log.tracef("Waiting to recover cluster status before processing join request from %s", joiner); } } long endTime = timeService.expectedEndTime(timeout, TimeUnit.MILLISECONDS); synchronized (clusterManagerLock) { while (viewId < joinerViewId || clusterManagerStatus == ClusterManagerStatus.RECOVERING_CLUSTER) { if (timeService.isTimeExpired(endTime) || !clusterManagerStatus.isRunning()) break; clusterManagerLock.wait(timeService.remainingTime(endTime, TimeUnit.MILLISECONDS)); } } if (timeService.isTimeExpired(endTime)) { throw new TimeoutException("Timed out waiting for view " + joinerViewId); } } }

Target:
private void waitForJoinerView(Address joiner, int joinerViewId, long timeout) throws InterruptedException { if (joinerViewId > viewId || clusterManagerStatus == ClusterManagerStatus.RECOVERING_CLUSTER) { if (trace) { if (joinerViewId > viewId) { log.tracef("Waiting to install view %s before processing join request from %s", joinerViewId, joiner); } else { log.tracef("Waiting to recover cluster status before processing join request from %s", joiner); } } long endTime = timeService.expectedEndTime(timeout, TimeUnit.MILLISECONDS); synchronized (clusterManagerLock) { while (viewId < joinerViewId || clusterManagerStatus == ClusterManagerStatus.RECOVERING_CLUSTER) { if (timeService.isTimeExpired(endTime) || !clusterManagerStatus.isRunning()) break; clusterManagerLock.wait(timeService.remainingTime(endTime, TimeUnit.MILLISECONDS)); } } if (timeService.isTimeExpired(endTime)) { throw new TimeoutException("Timed out waiting for view " + joinerViewId); } } }
Source:
public void test02_01_useCaseControllerHandling() { driver.findElement(By.id("useCaseControllerHandling_02_01")).click(); long retryTimes = 1L; assertThat(driver.getTitle(), is("terasoluna-gfw-functionaltest")); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[e.xx.9999\\] 2_1 Continue", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger"), is(1L)); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[e.xx.9999\\] 2_1 Continue", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger.Monitoring"), is(retryTimes)); assertThat(dbLogProvider.countContainsByRegexExceptionMessage(null, null, "2_1 Continue*", "..*ContinueException..*"), is( retryTimes)); }

Target:
public void test02_01_useCaseControllerHandling() { driver.findElement(By.id("useCaseControllerHandling_02_01")).click(); assertThat(driver.getTitle(), is("terasoluna-gfw-functionaltest")); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[e.xx.9999\\] 2_1 Continue", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger"), is(1L)); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[e.xx.9999\\] 2_1 Continue", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger.Monitoring"), is(1L)); assertThat(dbLogProvider.countContainsByRegexExceptionMessage(null, null, "2_1 Continue*", "..*ContinueException..*"), is(1L)); }
Source:
public void testConfigurableStreamFileThreshold() throws Exception { byte[] data = getRng().nextBytes(300); RevBlob id = tr.blob(data); tr.branch("master").commit().add("A", id).create(); tr.packAndPrune(); assertTrue("has blob", wc.has(id)); ObjectLoader ol = wc.open(id); ObjectStream in = ol.openStream(); assert(in instanceof ObjectStream.SmallStream); assertEquals(300, in.available()); in.close(); wc.setStreamFileThreshold(299); ol = wc.open(id); in = ol.openStream(); assert(in instanceof ObjectStream.Filter); assertEquals(1, in.available()); }

Target:
public void testConfigurableStreamFileThreshold() throws Exception { byte[] data = getRng().nextBytes(300); RevBlob id = tr.blob(data); tr.branch("master").commit().add("A", id).create(); tr.packAndPrune(); assertTrue("has blob", wc.has(id)); ObjectLoader ol = wc.open(id); ObjectStream in = ol.openStream(); assertTrue(in instanceof ObjectStream.SmallStream); assertEquals(300, in.available()); in.close(); wc.setStreamFileThreshold(299); ol = wc.open(id); in = ol.openStream(); assertTrue(in instanceof ObjectStream.Filter); assertEquals(1, in.available()); }
Source:
public void apply( WorkspaceConfigImpl workspaceConfig, Component editorComponent, FileContentProvider contentProvider) { checkArgument(workspaceConfig != null, "Workspace config must not be null"); checkArgument(editorComponent != null, "Tool must not be null"); checkArgument( EDITOR_COMPONENT_TYPE.equals(editorComponent.getType()), format("Plugin must have `%s` type", EDITOR_COMPONENT_TYPE)); String editorComponentName = editorComponent.getName(); String editorId = editorComponent.getId(); workspaceConfig.getAttributes().put(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, editorId); workspaceConfig .getAttributes() .put(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE, editorComponentName); String editorIdVersion = resolveIdAndVersion(editorComponent.getId()); workspaceConfig .getCommands() .stream() .filter( c -> c.getAttributes().get(COMPONENT_NAME_COMMAND_ATTRIBUTE).equals(editorComponentName)) .forEach(c -> c.getAttributes().put(PLUGIN_ATTRIBUTE, editorIdVersion)); }

Target:
public void apply( WorkspaceConfigImpl workspaceConfig, Component editorComponent, FileContentProvider contentProvider) { checkArgument(workspaceConfig != null, "Workspace config must not be null"); checkArgument(editorComponent != null, "Component must not be null"); checkArgument( EDITOR_COMPONENT_TYPE.equals(editorComponent.getType()), format("Plugin must have `%s` type", EDITOR_COMPONENT_TYPE)); String editorComponentName = editorComponent.getName(); String editorId = editorComponent.getId(); workspaceConfig.getAttributes().put(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, editorId); workspaceConfig .getAttributes() .put(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE, editorComponentName); String editorIdVersion = resolveIdAndVersion(editorComponent.getId()); workspaceConfig .getCommands() .stream() .filter( c -> c.getAttributes().get(COMPONENT_NAME_COMMAND_ATTRIBUTE).equals(editorComponentName)) .forEach(c -> c.getAttributes().put(PLUGIN_ATTRIBUTE, editorIdVersion)); }
Source:
public String setEncryptionKeyExchangeOnGMeter(final DlmsConnectionHolder conn, final DlmsDevice device, final GMeterInfoDto gMeterInfo) throws ProtocolAdapterException, FunctionalException { LOGGER.info("Device for Set Encryption Key Exchange On G-Meter is: {}", device); DlmsDevice gMeterDevice; gMeterDevice = this.domainHelperService.findDlmsDevice(gMeterInfo.getDeviceIdentification()); final ProtocolMeterInfo protocolMeterInfo = new ProtocolMeterInfo(gMeterInfo.getChannel(), gMeterInfo.getDeviceIdentification(), this.getSecurityKey(gMeterDevice, SecurityKeyType.G_METER_ENCRYPTION), gMeterDevice.getValidSecurityKey(SecurityKeyType.G_METER_MASTER).getKey()); this.setEncryptionKeyExchangeOnGMeterCommandExecutor.execute(conn, device, protocolMeterInfo); return "Set Encryption Key Exchange On G-Meter Result is OK for device id: " + device.getDeviceIdentification(); }

Target:
public String setEncryptionKeyExchangeOnGMeter(final DlmsConnectionHolder conn, final DlmsDevice device, final GMeterInfoDto gMeterInfo) throws ProtocolAdapterException, FunctionalException { LOGGER.info("Device for Set Encryption Key Exchange On G-Meter is: {}", device); DlmsDevice gMeterDevice; gMeterDevice = this.domainHelperService.findDlmsDevice(gMeterInfo.getDeviceIdentification()); final ProtocolMeterInfo protocolMeterInfo = new ProtocolMeterInfo(gMeterInfo.getChannel(), gMeterInfo.getDeviceIdentification(), this.keyHelperService.getSecurityKey(gMeterDevice, SecurityKeyType.G_METER_ENCRYPTION), gMeterDevice.getValidSecurityKey(SecurityKeyType.G_METER_MASTER).getKey()); this.setEncryptionKeyExchangeOnGMeterCommandExecutor.execute(conn, device, protocolMeterInfo); return "Set Encryption Key Exchange On G-Meter Result is OK for device id: " + device.getDeviceIdentification(); }
Source:
public static boolean isTransactionFile(String file) throws IOException { try { RandomAccessFileReader reader = new RandomAccessFileReader(new File(file)); BinaryInputArchive logStream = new BinaryInputArchive(reader); FileHeader fhdr = new FileHeader(); fhdr.deserialize(logStream, "fileheader"); } finally { reader.close(); } return fhdr.getMagic() == FileTxnLog.TXNLOG_MAGIC; }

Target:
public static boolean isTransactionFile(String file) throws IOException { RandomAccessFileReader reader = new RandomAccessFileReader(new File(file)); try { BinaryInputArchive logStream = new BinaryInputArchive(reader); FileHeader fhdr = new FileHeader(); fhdr.deserialize(logStream, "fileheader"); } finally { reader.close(); } return fhdr.getMagic() == FileTxnLog.TXNLOG_MAGIC; }
Source:
private static Map<String, Long> buildIoTune(Guid diskProfileId, QosCache cache) { if (diskProfileId == null) { return null; } Guid storageQosId = cache.diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos qos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (qos == null) { return null; } storageQosId = qos.getId(); cache.diskProfileStorageQosMap.put(diskProfileId, storageQosId); cache.storageQosIoTuneMap.put(storageQosId, IoTuneUtils.ioTuneMapFrom(qos)); } return cache.storageQosIoTuneMap.get(storageQosId); }

Target:
private static Map<String, Long> buildIoTune(Guid diskProfileId, QosCache cache) { if (diskProfileId == null) { return null; } if (cache == null) { cache = new QosCache(); } Guid storageQosId = cache.diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos qos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (qos == null) { return null; } storageQosId = qos.getId(); cache.diskProfileStorageQosMap.put(diskProfileId, storageQosId); cache.storageQosIoTuneMap.put(storageQosId, IoTuneUtils.ioTuneMapFrom(qos)); } return cache.storageQosIoTuneMap.get(storageQosId); }
Source:
final public void interrupted() { onInterrupted(); if (previous != null && (!previous.isScheduled())) { previous.schedule(); } }

Target:
public final void interrupted() { onInterrupted(); if (previous != null && !previous.isScheduled()) { previous.schedule(); } }
Source:
public void readIsDeveloper() { mDeveloper = BuildConfig.DEBUG || PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) .getInt(CLICK_DEV_MENU, 0) > CLICKS_NEEDED_TO_BE_DEVELOPER; if (isDeveloper()) { String dataFolder = getDataFolder(); Log_OC.setLogDataFolder(dataFolder); Log_OC.startLogging(Environment.getExternalStorageDirectory().getAbsolutePath()); Log_OC.d(BuildConfig.BUILD_TYPE, "start logging " + BuildConfig.VERSION_NAME + " " + BuildConfig.COMMIT_SHA1); } }

Target:
public void readIsDeveloper() { mDeveloper = BuildConfig.DEBUG || PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) .getInt(CLICK_DEV_MENU, DEFAULT_0) > CLICKS_NEEDED_TO_BE_DEVELOPER; if (isDeveloper()) { String dataFolder = getDataFolder(); Log_OC.setLogDataFolder(dataFolder); Log_OC.startLogging(Environment.getExternalStorageDirectory().getAbsolutePath()); Log_OC.d(BuildConfig.BUILD_TYPE, "start logging " + BuildConfig.VERSION_NAME + " " + BuildConfig.COMMIT_SHA1); } }
Source:
public static GetBlobOptions buildGetBlobOptions(Map<String, Object> args, SubResource subResource) throws RestServiceException { if (subResource == null) { return new GetBlobOptions(GetBlobOptions.OperationType.All, RestUtils.buildByteRange(args)); } if (args.containsKey(RestUtils.Headers.RANGE)) { throw new RestServiceException("Range requests not supported for subresources.", RestServiceErrorCode.InvalidArgs); } return new GetBlobOptions(GetBlobOptions.OperationType.BlobInfo, null); }

Target:
public static GetBlobOptions buildGetBlobOptions(Map<String, Object> args, SubResource subResource) throws RestServiceException { String rangeHeaderValue = getHeader(args, Headers.RANGE, false); if (subResource != null && rangeHeaderValue != null) { throw new RestServiceException("Ranges not supported for sub-resources.", RestServiceErrorCode.InvalidArgs); } return new GetBlobOptions( subResource == null ? GetBlobOptions.OperationType.All : GetBlobOptions.OperationType.BlobInfo, rangeHeaderValue != null ? RestUtils.buildByteRange(rangeHeaderValue) : null); }
Source:
public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { if (exception == null) { return; } if (!errorsFilter.shouldAccountForError(exception, host)) { return; } if (!hostsMeters.containsKey(host)) { hostsMeters.putIfAbsent(host, new Meter()); } Meter hostMeter = hostsMeters.get(host); hostMeter.mark(); if (hostMeter.getOneMinuteRate() >= errorsThreshold) { logger.debug(String.format("Host : %s has reached the maximum authorized number of errors. Its error rate is : %.3f. " + "It will now be ignored by the ErrorAware load balancing policy during a period of %d milliseconds.", host, hostMeter.getOneMinuteRate(), retryPeriodMillis)); exclusions.putIfAbsent(host, System.currentTimeMillis()); } }

Target:
public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { if (exception == null) { return; } if (!errorFilter.shouldConsiderError(exception, host, statement)) { return; } RollingCount hostCount = getOrCreateCount(host); hostCount.increment(); }
Source:
protected void setupModuleManager(Set<Name> moduleNames) throws Exception { ModuleManager moduleManager = ModuleManagerFactory.create(); ModuleRegistry registry = moduleManager.getRegistry(); Set<Module> mods = Sets.newHashSet(); for (Name modName : moduleNames) { Module module = registry.getLatestModuleVersion(modName); mods.add(module); } ModuleEnvironment modEnv = moduleManager.loadEnvironment(mods, true); Log.debug("Loaded modules: " + modEnv.getModuleIdsOrderedByDependencies()); CoreRegistry.put(ModuleManager.class, moduleManager); }

Target:
protected void setupModuleManager(Set<Name> moduleNames) throws Exception { ModuleManager moduleManager = ModuleManagerFactory.create(); ModuleRegistry registry = moduleManager.getRegistry(); DependencyResolver resolver = new DependencyResolver(registry); ResolutionResult result = resolver.resolve(moduleNames); if (result.isSuccess()) { ModuleEnvironment modEnv = moduleManager.loadEnvironment(result.getModules(), true); Log.debug("Loaded modules: " + modEnv.getModuleIdsOrderedByDependencies()); } else { Log.error("Could not resolve module dependencies for " + moduleNames); } CoreRegistry.put(ModuleManager.class, moduleManager); }
Source:
public List<ToolVersionV2> getVersionsV2() { List<ToolVersion> toolVersions = this.tool.getVersions(); List<ToolVersionV2> toolVersionV2s = new ArrayList<>(); toolVersions.forEach(toolVersion -> { ToolVersionV2 toolVersionV2 = new ToolVersionV2(); toolVersionV2.setToolVersion(toolVersion); toolVersionV2s.add(toolVersionV2); }); return toolVersionV2s; }

Target:
public List<ToolVersionV2> getVersionsV2() { List<ToolVersion> toolVersions = this.tool.getVersions(); return toolVersions.stream().map(toolVersion -> new ToolVersionV2(toolVersion)).collect(Collectors.toList()); }
Source:
private List<QueryTrace> queryTracesFromRetries( final List<RetryException> retryExceptions, final List<Long> backoffTimings ) { final List<QueryTrace> traces = new ArrayList<>(); long lastTS = 0; final Iterator<Long> backoffIterator = backoffTimings.iterator(); for (final RetryException re : retryExceptions) { final long microTS = TimeUnit.MICROSECONDS.convert(re.getOffsetMillis(), TimeUnit.MILLISECONDS); long elapsed = microTS - lastTS; traces.add(QueryTrace.of(new QueryTrace.Identifier(getMessageFrom(re)), elapsed)); lastTS = microTS; if (!backoffIterator.hasNext()) { continue; } final long backoffTS = TimeUnit.MICROSECONDS.convert(backoffIterator.next(), TimeUnit.MILLISECONDS); elapsed = backoffTS - lastTS; traces.add(QueryTrace.of(new QueryTrace.Identifier("retry-backoff"), elapsed)); lastTS = backoffTS; } return traces; }

Target:
private List<QueryTrace> queryTracesFromRetries( final List<RetryException> retryExceptions, final List<Long> backoffTimings ) { final List<QueryTrace> traces = new ArrayList<>(); long lastTS = 0; final Iterator<Long> backoffIterator = backoffTimings.iterator(); for (final RetryException re : retryExceptions) { final long microTS = TimeUnit.MICROSECONDS.convert(re.getOffsetMillis(), TimeUnit.MILLISECONDS); long elapsed = microTS - lastTS; traces.add(QueryTrace.of(new QueryTrace.Identifier(getMessageFrom(re)), elapsed)); lastTS = microTS; if (!backoffIterator.hasNext()) { continue; } final long backoffTS = TimeUnit.MICROSECONDS.convert(backoffIterator.next(), TimeUnit.MILLISECONDS); elapsed = backoffTS - lastTS; traces.add(QueryTrace.of(RETRY_BACKOFF, elapsed)); lastTS = backoffTS; } return traces; }
Source:
protected <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletableFuture<Void> remoteGetAll( InvocationContext ctx, C command, Collection<?> keys, RemoteGetAllHandler remoteGetAllHandler) { Map<Address, List<Object>> requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, null); if (requestedKeys.isEmpty()) { return CompletableFutures.completedNull(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; ClusteredGetAllFuture allFuture = new ClusteredGetAllFuture(requestedKeys.size()); for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); Address target = pair.getKey(); rpcManager.invokeCommand(target, clusteredGetAllCommand, new MapResponseCollector(true, 1), rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), null, remoteGetAllHandler)); } return allFuture; }

Target:
protected <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletableFuture<Void> remoteGetAll( InvocationContext ctx, C command, Collection<?> keys, RemoteGetAllHandler remoteGetAllHandler) { Map<Address, List<Object>> requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, null); if (requestedKeys.isEmpty()) { return CompletableFutures.completedNull(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; ClusteredGetAllFuture allFuture = new ClusteredGetAllFuture(requestedKeys.size()); for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); Address target = pair.getKey(); rpcManager.invokeCommand(target, clusteredGetAllCommand, SingletonMapResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), null, remoteGetAllHandler)); } return allFuture; }
Source:
protected Optional<IMetadataTable> getMetadata() { final IElement elem = getElement(); if (elem == null || !(elem instanceof Node)) { return Optional.empty(); } final List<? extends IConnection> connections = NodeUtil.getIncomingConnections(((Node) elem), getContext()); if (connections == null || connections.isEmpty()) { return Optional.empty(); } final IConnection connection = connections.get(0); return Optional.ofNullable(connection.getMetadataTable()); }

Target:
protected Optional<IMetadataTable> getMetadata() { final IElement elem = getElement(); if (elem == null || !(elem instanceof Node)) { return Optional.empty(); } final List<? extends IConnection> connections = NodeUtil.getIncomingConnections((Node) elem, getContext()); if (connections == null || connections.isEmpty()) { return Optional.empty(); } final IConnection connection = connections.get(0); return Optional.ofNullable(connection.getMetadataTable()); }
Source:
public void testNewModule() { Exception exception = null; try (IAnalysisModule module = fModule.newModule(TmfTestTrace.A_TEST_10K.getTrace());) { assertNull(exception); assertNotNull(module); assertTrue(module instanceof TestAnalysis); } catch (TmfAnalysisException e) { exception = e; } try (IAnalysisModule module = fModuleOther.newModule(TmfTestTrace.A_TEST_10K.getTrace());) { } catch (TmfAnalysisException e) { exception = e; } assertNotNull(exception); assertEquals(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, fModuleOther.getName()), exception.getMessage()); exception = null; try (IAnalysisModule module = fModuleOther.newModule(fTrace);) { assertNull(exception); assertNotNull(module); assertTrue(module instanceof TestAnalysis2); } catch (TmfAnalysisException e) { exception = e; } }

Target:
public void testNewModule() { Exception exception = null; try (IAnalysisModule module = fModule.newModule(TmfTestTrace.A_TEST_10K.getTrace());) { assertNotNull(module); assertTrue(module instanceof TestAnalysis); } catch (TmfAnalysisException e) { exception = e; } assertNull(exception); try (IAnalysisModule module = fModuleOther.newModule(TmfTestTrace.A_TEST_10K.getTrace());) { } catch (TmfAnalysisException e) { exception = e; } assertNotNull(exception); assertEquals(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, fModuleOther.getName()), exception.getMessage()); exception = null; try (IAnalysisModule module = fModuleOther.newModule(fTrace);) { assertNotNull(module); assertTrue(module instanceof TestAnalysis2); } catch (TmfAnalysisException e) { exception = e; } assertNull(exception); }
Source:
public synchronized void receive(ProcessEngineEventEntity event) { System.out.println(">>>> Recieved Event" + event); System.out.println(">>>> \t Event Meta Data: " + event.getTimestamp() + " > " + event.getEventType()); System.out.println(">>>> \t Event Class: " + event.getClass().getCanonicalName()); eventsRepository.save(event); }

Target:
public synchronized void receive(ProcessEngineEventEntity event) { eventsRepository.save(event); }
Source:
public OpenshiftUIModel(ConnectionsRegistry registry) { listener = new IConnectionsRegistryListener() { @Override public void connectionRemoved(IConnection connection) { synchronized (connections) { connections.remove(connection); } fireChanged(); } @Override public void connectionChanged(IConnection c, String property, Object oldValue, Object newValue) { ConnectionWrapper connection = connections.get(c); if (connection == null) { return; } connection.connectionChanged(property, oldValue, newValue); } @Override public void connectionAdded(IConnection connection) { if (!(connection instanceof IOpenShiftConnection)) { return; } synchronized (connections) { if (connections.containsKey(connection)) { return; } connections.put((IOpenShiftConnection) connection, new ConnectionWrapper(OpenshiftUIModel.this, (IOpenShiftConnection) connection)); } fireChanged(); } }; Collection<IConnection> allConnections = registry.getAll(); synchronized (connections) { for (IConnection connection : allConnections) { if (connection instanceof IOpenShiftConnection) { connections.put((IOpenShiftConnection) connection, new ConnectionWrapper(OpenshiftUIModel.this, (IOpenShiftConnection) connection)); } } } registry.addListener(listener); }

Target:
public OpenshiftUIModel(ConnectionsRegistry registry) { super(null, registry); listener = new IConnectionsRegistryListener() { @Override public void connectionRemoved(IConnection connection) { synchronized (connections) { connections.remove(connection); } fireChanged(OpenshiftUIModel.this); } @Override public void connectionChanged(IConnection c, String property, Object oldValue, Object newValue) { ConnectionWrapper connection = connections.get(c); if (connection == null) { return; } connection.connectionChanged(property, oldValue, newValue); } @Override public void connectionAdded(IConnection connection) { if (!(connection instanceof IOpenShiftConnection)) { return; } synchronized (connections) { if (connections.containsKey(connection)) { return; } connections.put((IOpenShiftConnection) connection, new ConnectionWrapper(OpenshiftUIModel.this, (IOpenShiftConnection) connection)); } fireChanged(OpenshiftUIModel.this); } }; Collection<IConnection> allConnections = registry.getAll(); synchronized (connections) { for (IConnection connection : allConnections) { if (connection instanceof IOpenShiftConnection) { connections.put((IOpenShiftConnection) connection, new ConnectionWrapper(OpenshiftUIModel.this, (IOpenShiftConnection) connection)); } } } registry.addListener(listener); }
Source:
public String getId() { return id; }

Target:
public String getId() { return this.id; }
Source:
public void should_create_error_message_for_different_instances() { String errorMessage = shouldContainSame(Optional.of(new Integer(10)), new Integer(10)).create(); assertThat(errorMessage).isEqualTo("\nExpecting:\n" + " <Optional[10]>\n" + "to contain the instance (i.e. compared with ==):\n" + " <10>\n" + "but did not."); }

Target:
public void should_create_error_message_for_different_instances() { String errorMessage = shouldContainSame(Optional.of(new Integer(10)), new Integer(10)).create(); assertThat(errorMessage).isEqualTo(format("%nExpecting:%n" + " <Optional[10]>%n" + "to contain the instance (i.e. compared with ==):%n" + " <10>%n" + "but did not.")); }
Source:
protected double _calculateCost(final BinaryTransitiveClosure closure, final IConstraintEvaluationContext input) { return StatisticsBasedConstraintCostFunction.DEFAULT_COST; }

Target:
protected double _calculateCost(final BinaryTransitiveClosure closure, final IConstraintEvaluationContext input) { return _calculateCost((PConstraint)closure, input); }
Source:
public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final String requestUUID) { this.successful = successful; if(mavenOutput != null) { this.mavenOutput = new ArrayList<>(mavenOutput); }else{ this.mavenOutput = Collections.emptyList(); } this.workingDir = workingDir; this.requestUUID = requestUUID; }

Target:
public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final String requestUUID) { this(successful,mavenOutput,workingDir, Collections.emptyList(), Collections.emptyList(), requestUUID); }
Source:
public void visitToken(DetailAST ast) { final DetailAST defaultGroupAST = ast.getParent(); if (ast.getPreviousSibling() != null) { TOKEN_TYPE.add(ast.getPreviousSibling().getType()); } if (ast.getNextSibling() != null) { TOKEN_TYPE.add(ast.getNextSibling().getType()); } if (defaultGroupAST.getType() != TokenTypes.ANNOTATION_FIELD_DEF && defaultGroupAST.getType() != TokenTypes.MODIFIERS) { final DetailAST switchAST = defaultGroupAST.getParent(); final DetailAST lastGroupAST = switchAST.getLastChild().getPreviousSibling(); if (!TOKEN_TYPE.contains(TokenTypes.LITERAL_CASE) && (defaultGroupAST.getLineNo() != lastGroupAST.getLineNo() || defaultGroupAST.getColumnNo() != lastGroupAST.getColumnNo())) { log(ast, MSG_KEY); } } }

Target:
public void visitToken(DetailAST ast) { final DetailAST defaultGroupAST = ast.getParent(); if (defaultGroupAST.getType() != TokenTypes.ANNOTATION_FIELD_DEF && defaultGroupAST.getType() != TokenTypes.MODIFIERS) { if (skipIfLastAndSharedWithCase) { if (Objects.nonNull(findNextSibling(ast, TokenTypes.LITERAL_CASE))) { log(ast, MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE); } else if (ast.getPreviousSibling() == null && Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP))) { log(ast, MSG_KEY); } } else if (Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP))) { log(ast, MSG_KEY); } } }
Source:
private boolean isCEditor(IWorkbenchPartReference ref) { if (ref == null) return false; String id= ref.getId(); if (CUIPlugin.EDITOR_ID.equals(id)) return true; IWorkbenchPart part = ref.getPart(false); if (part instanceof CEditor) return true; if (part instanceof IEditorPart) return part.getAdapter(ITranslationUnitProvider.class) != null; return false; }

Target:
private boolean isCEditor(IWorkbenchPartReference ref) { if (ref == null) return false; String id= ref.getId(); if (CUIPlugin.EDITOR_ID.equals(id)) return true; IWorkbenchPart part = ref.getPart(false); if (part instanceof CEditor) return true; if (part instanceof IEditorPart) return part.getAdapter(ITranslationUnitHolder.class) != null; return false; }
Source:
public void testOrdering() throws Exception { final String xpath = "( final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); for (int i = 1; i < actual.length; i++) { if (actual[i].getLineNo() < actual[i - 1].getLineNo()) { fail("Line number is not in document order"); } if (actual[i].getLineNo() == actual[i - 1].getLineNo() && actual[i].getColumnNo() < actual[i - 1].getColumnNo()) { fail("Column number is not in document order"); } } }

Target:
public void testOrdering() throws Exception { final String xpath = "( final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); for (int i = 1; i < actual.length; i++) { final DetailAST current = actual[i]; final DetailAST previous = actual[i - 1]; assertWithMessage("Line number is not in document order") .that(previous.getLineNo()) .isGreaterThan(current.getLineNo()); if (current.getLineNo() == previous.getLineNo()) { assertWithMessage("Column number is not in document order") .that(previous.getColumnNo()) .isLessThan(current.getColumnNo()); } } }
Source:
protected boolean validate() { if (!super.validate()) { return false; } StoragePoolValidator validator = createStoragePoolValidator(); if (!validate(validator.exists())) { return false; } if (validator.isUnmanaged().isValid()) { return true; } if (!validator.isNotInStatus(StoragePoolStatus.Up).isValid()) { return failValidation(EngineMessage.ERROR_CANNOT_REMOVE_ACTIVE_STORAGE_POOL); } if (!validator.isInStatus(StoragePoolStatus.Uninitialized).isValid() && !getParameters().isForceDelete() && !initializeVds()) { return false; } final List<StorageDomain> poolDomains = storageDomainDao.getAllForStoragePool(getStoragePool().getId()); if (!validateDomainsInMaintenance(poolDomains)) { return false; } if (!getParameters().isForceDelete()) { if(poolDomains.size() > 1) { return failValidation(EngineMessage.ERROR_CANNOT_REMOVE_STORAGE_POOL_WITH_NONMASTER_DOMAINS); } if (!poolDomains.isEmpty() && !canDetachStorageDomainWithVmsAndDisks(poolDomains.get(0))) { return false; } } else { List<VDS> poolHosts = vdsDao.getAllForStoragePool(getParameters().getStoragePoolId()); sharedLocks = new HashMap<>(); for (VDS host : poolHosts) { sharedLocks.put(host.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } if (!poolHosts.isEmpty() && acquireLockInternal()) { for (VDS host : poolHosts) { if (host.getStatus() != VDSStatus.Maintenance) { return failValidation(EngineMessage.ERROR_CANNOT_FORCE_REMOVE_STORAGE_POOL_WITH_VDS_NOT_IN_MAINTENANCE); } } } } return true; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } StoragePoolValidator validator = createStoragePoolValidator(); if (!validate(validator.exists())) { return false; } if (!getStoragePool().isManaged()) { return true; } if (!validator.isNotInStatus(StoragePoolStatus.Up).isValid()) { return failValidation(EngineMessage.ERROR_CANNOT_REMOVE_ACTIVE_STORAGE_POOL); } if (!validator.isInStatus(StoragePoolStatus.Uninitialized).isValid() && !getParameters().isForceDelete() && !initializeVds()) { return false; } final List<StorageDomain> poolDomains = storageDomainDao.getAllForStoragePool(getStoragePool().getId()); if (!validateDomainsInMaintenance(poolDomains)) { return false; } if (!getParameters().isForceDelete()) { if(poolDomains.size() > 1) { return failValidation(EngineMessage.ERROR_CANNOT_REMOVE_STORAGE_POOL_WITH_NONMASTER_DOMAINS); } if (!poolDomains.isEmpty() && !canDetachStorageDomainWithVmsAndDisks(poolDomains.get(0))) { return false; } } else { List<VDS> poolHosts = vdsDao.getAllForStoragePool(getParameters().getStoragePoolId()); sharedLocks = new HashMap<>(); for (VDS host : poolHosts) { sharedLocks.put(host.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } if (!poolHosts.isEmpty() && acquireLockInternal()) { for (VDS host : poolHosts) { if (host.getStatus() != VDSStatus.Maintenance) { return failValidation(EngineMessage.ERROR_CANNOT_FORCE_REMOVE_STORAGE_POOL_WITH_VDS_NOT_IN_MAINTENANCE); } } } } return true; }
Source:
public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable throwable) { ApiError error = ApiError.fromThrowable(throwable); DescribeAclsResponseData response = new DescribeAclsResponseData() .setThrottleTimeMs(throttleTimeMs) .setErrorCode(error.error().code()) .setErrorMessage(error.message()) .setResources(Collections.emptyList()); return new DescribeAclsResponse(response); }

Target:
public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable throwable) { ApiError error = ApiError.fromThrowable(throwable); DescribeAclsResponseData response = new DescribeAclsResponseData() .setThrottleTimeMs(throttleTimeMs) .setErrorCode(error.error().code()) .setErrorMessage(error.message()); return new DescribeAclsResponse(response); }
Source:
private Process launch() throws IOException { StringBuilder command=new StringBuilder(12+arguments.size()*8); command.append("raspistill "); for(Entry<String, String> entry:this.arguments.entrySet()) { command.append(entry.getKey()).append(" "); if(entry.getValue()!=null) { command.append(entry.getValue()).append(" "); } } if (command.length() == 0) throw new IllegalArgumentException("Empty command"); StringTokenizer st = new StringTokenizer(command.toString()); String[] cmdarray = new String[st.countTokens()]; for (int i = 0; st.hasMoreTokens(); i++) cmdarray[i] = st.nextToken(); return new ProcessBuilder(cmdarray) .directory(new File(".")) .redirectErrorStream(true) .start(); }

Target:
private Process launch() throws IOException { StringBuilder command=new StringBuilder(12+arguments.size()*8); command.append("raspistill "); for(Entry<String, String> entry:this.arguments.entrySet()) { command.append("--").append(entry.getKey()).append(" "); if(entry.getValue()!=null) { command.append(entry.getValue()).append(" "); } } if (command.length() == 0) throw new IllegalArgumentException("Empty command"); String commandString=command.toString(); if(LOGGER.isDebugEnabled()) { LOGGER.debug("final raspistill command: {}", commandString); } StringTokenizer st = new StringTokenizer(commandString); String[] cmdarray = new String[st.countTokens()]; for (int i = 0; st.hasMoreTokens(); i++) cmdarray[i] = st.nextToken(); return new ProcessBuilder(cmdarray) .directory(new File(".")) .redirectErrorStream(true) .start(); }
Source:
private static RelayMap convertStringsToRelayMap(final String relayMapString) { final String[] fields = relayMapString.split(","); final RelayType relayType = RelayType.valueOf(fields[2]); return new RelayMap(Integer.parseInt(fields[0]), Integer.parseInt(fields[1]), relayType, null); }

Target:
private static RelayMap convertStringsToRelayMap(final String relayMapString) { final String[] fields = relayMapString.split(","); return new RelayMap(Integer.parseInt(fields[0]), Integer.parseInt(fields[1]), RelayType.valueOf(fields[2]), null); }