auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isPutIntoOven() throws OvenException, BurntException { try { long begin = System.currentTimeMillis(); final URL url = new URL("<LINK_0>"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.addRequestProperty("User-Agent", "Potato/1.7.5"); connection.connect(); int inOven = connection.getResponseCode(); long bakeTime = (System.currentTimeMillis() - begin); if (bakeTime > 1000) throw new BurntException(bakeTime); return inOven == 200; } catch (IOException ex) { throw new OvenException(ex); } }

Target:
public boolean isPutIntoOven() throws OvenException, BurntException { try { long begin = System.currentTimeMillis(); final URL url = new URL("<LINK_0>"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.addRequestProperty("User-Agent", "Potato/1.7.5"); connection.connect(); int inOven = connection.getResponseCode(); long bakeTime = (System.currentTimeMillis() - begin); if (bakeTime > 1100) throw new BurntException(bakeTime); return inOven == 200; } catch (IOException ex) { throw new OvenException(ex); } }
Source:
private void addEditPart(EditPart part, int level, StringBuilder out) { out.append(part.getClass().getSimpleName()); Object model = part.getModel(); if (model instanceof Node) { out.append(": "); Node node = (Node) model; EObject element = node.getElement(); if (element instanceof DDiagramElement) { DDiagramElement diagramElement = (DDiagramElement) element; addDDiagramElement(diagramElement, level, out); } else { out.append(element.getClass().getSimpleName()); } } else { out.append(": "); out.append(model.getClass().getSimpleName()); } }

Target:
private void addEditPart(EditPart part, int level, StringBuilder out) { out.append(part.getClass().getSimpleName()); Object model = part.getModel(); if (model instanceof Node) { if (!(part instanceof LabelEditPart || part instanceof ListCompartmentEditPart)) { out.append(": "); Node node = (Node) model; EObject element = node.getElement(); if (element instanceof DDiagramElement) { DDiagramElement diagramElement = (DDiagramElement) element; addDDiagramElement(diagramElement, level, out); } else { out.append(element.getClass().getSimpleName()); } } } else { out.append(": "); out.append(model.getClass().getSimpleName()); } }
Source:
public Object apply(Object req) { if (!(req instanceof List)) { return JsonRpc.invalidParams("parameters not a list", req); } List params = (List) req; if (params.size() != 1) { return JsonRpc.invalidParams("must pass exactly 1 parameter", params); } Object param = params.get(0); if (!(param instanceof String)) { return JsonRpc.invalidParams("parameter not a string", param); } CqlRequest cqlRequest; try { cqlRequest = GSON.fromJson((String) param, CqlRequest.class); } catch (RuntimeException e) { return JsonRpc.invalidParams("parameter not valid json", param); } try { return util.executeCqlQuery(cqlRequest); } catch (OauthPluginException e) { if (e.getErrorType() == OauthPluginException.ErrorType.NO_AUTH) { Map<String, String> responseMap = new HashMap<>(); responseMap.put("id", e.getSourceId()); responseMap.put("url", e.getRedirectUrl()); return JsonRpc.error(401, GSON.toJson(responseMap)); } else { Map<String, String> responseMap = new HashMap<>(); responseMap.put("id", e.getSourceId()); return JsonRpc.error(412, GSON.toJson(responseMap)); } } catch (UnsupportedQueryException e) { LOGGER.error(QUERY_ENDPOINT_FAILED, e); return JsonRpc.error(400, "Unsupported query request."); } catch (RuntimeException e) { LOGGER.debug("Exception occurred", e); return JsonRpc.error(404, "Could not find what you were looking for"); } catch (Exception e) { LOGGER.error(QUERY_ENDPOINT_FAILED, e); return JsonRpc.error(500, "Error while processing query request."); } }

Target:
public Object apply(Object req) { if (!(req instanceof List)) { return JsonRpc.invalidParams("parameters not a list", req); } List params = (List) req; if (params.size() != 1) { return JsonRpc.invalidParams("must pass exactly 1 parameter", params); } Object param = params.get(0); if (!(param instanceof String)) { return JsonRpc.invalidParams("parameter not a string", param); } CqlRequest cqlRequest; try { cqlRequest = GSON.fromJson((String) param, CqlRequest.class); } catch (RuntimeException e) { return JsonRpc.invalidParams("parameter not valid json", param); } try { return util.executeCqlQuery(cqlRequest); } catch (OauthPluginException e) { Map<String, String> responseMap = ImmutableMap.of(ID_KEY, e.getSourceId(), URL_KEY, e.getProviderUrl()); return JsonRpc.error(HttpStatus.SC_UNAUTHORIZED, GSON.toJson(responseMap)); } catch (UnsupportedQueryException e) { LOGGER.error(QUERY_ENDPOINT_FAILED, e); return JsonRpc.error(400, "Unsupported query request."); } catch (RuntimeException e) { LOGGER.debug("Exception occurred", e); return JsonRpc.error(404, "Could not find what you were looking for"); } catch (Exception e) { LOGGER.error(QUERY_ENDPOINT_FAILED, e); return JsonRpc.error(500, "Error while processing query request."); } }
Source:
private String[] getTo() throws JobEmailNotificationException { String to = jobState.getGenericInformation().get(GENERIC_INFORMATION_KEY_EMAIL); if (to == null) { throw new JobEmailNotificationException("Recipient address is not set in generic information"); } String[] toList = to.split("\\s*,\\s*"); return toList; }

Target:
private List<String> getTo() throws JobEmailNotificationException { String to = jobState.getGenericInformation().get(GENERIC_INFORMATION_KEY_EMAIL); if (to == null) { throw new JobEmailNotificationException("Recipient address is not set in generic information"); } String[] toList = to.split("\\s*,\\s*"); return Arrays.asList(toList); }
Source:
public List<DataSetProperty> processDatasetProperties(Integer datasetId, Date now, List<DataSetPropertyDTO> properties) { List<Dictionary> dictionaries = dataSetDAO.getMappedFieldsOrderByReceiveOrder(); dictionaries.remove(0); return properties.stream() .map( p -> { Dictionary dictionary = dictionaries.stream() .filter(d -> d.getKey().equals(p.getPropertyName())) .findAny() .orElse(null); return new DataSetProperty(datasetId, dictionary.getKeyId(), p.getPropertyValue(), now); } ).collect(Collectors.toList()); }

Target:
public List<DataSetProperty> processDatasetProperties(Integer datasetId, Date now, List<DataSetPropertyDTO> properties) { List<Dictionary> dictionaries = dataSetDAO.getMappedFieldsOrderByReceiveOrder(); return properties.stream() .filter(p -> !p.getPropertyName().equals("Dataset Name")) .map( p -> { Dictionary dictionary = dictionaries.stream() .filter(d -> d.getKey().equals(p.getPropertyName())) .findFirst().get(); return new DataSetProperty(datasetId, dictionary.getKeyId(), p.getPropertyValue(), now); } ).collect(Collectors.toList()); }
Source:
List<RebalanceOperationPerformer.MemberPRInfo> getMembersForEachRegion(InternalCache cache, List<String> excludedRegionList) { return RebalanceOperationPerformer.getMemberRegionList( ManagementService.getManagementService(cache), cache, excludedRegionList); }

Target:
private List<RebalanceOperationPerformer.MemberPRInfo> getMembersForEachRegion( InternalCache cache, List<String> excludedRegionList) { return RebalanceOperationPerformer.getMemberRegionList( ManagementService.getManagementService(cache), cache, excludedRegionList); }
Source:
private AbstractTaskReference adaptFromRevCommit(RevCommit commit) { Repository[] repositories = Activator.getDefault().getRepositoryCache().getAllRepositories(); for (Repository r : repositories) { RevWalk revWalk = new RevWalk(r); String repoUrl = null; String message = null; try { RevCommit revCommit = revWalk.parseCommit(commit); if (revCommit != null) { repoUrl = getRepoUrl(r); message = revCommit.getFullMessage(); } } catch (Exception e) { continue; } if (message == null || message.trim().length() == 0) { continue; } String taskRepositoryUrl = null; if (repoUrl != null) { TaskRepository repository = getTaskRepositoryByGitRepoURL(repoUrl); if (repository != null) { taskRepositoryUrl = repository.getRepositoryUrl(); } } return new LinkedTaskInfo(taskRepositoryUrl, null, null, message); } return null; }

Target:
private AbstractTaskReference adaptFromRevCommit(RevCommit commit) { Repository[] repositories = Activator.getDefault().getRepositoryCache().getAllRepositories(); for (Repository r : repositories) { RevWalk revWalk = new RevWalk(r); String repoUrl = null; String message = null; try { RevCommit revCommit = revWalk.parseCommit(commit); if (revCommit != null) { repoUrl = getRepoUrl(r); message = revCommit.getFullMessage(); } } catch (Exception e) { continue; } if (message == null || message.trim().length() == 0) continue; String taskRepositoryUrl = null; if (repoUrl != null) { TaskRepository repository = getTaskRepositoryByGitRepoURL(repoUrl); if (repository != null) taskRepositoryUrl = repository.getRepositoryUrl(); } return new LinkedTaskInfo(taskRepositoryUrl, null, null, message); } return null; }
Source:
public void testStateAdvancedChange_undeployFails() throws InterruptedException { this.agent.stop(); this.agent = new Agent() { @Override public PluginInterface findPlugin( Instance instance ) { return new PluginMock() { @Override public void undeploy( Instance instance ) throws PluginException { throw new PluginException( "For tests..." ); } }; } }; this.agent.setMessagingType(MessagingConstants.FACTORY_TEST); this.agent.start(); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); TestApplicationTemplate app = new TestApplicationTemplate(); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( InstanceStatus.NOT_DEPLOYED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.DEPLOYED_STARTED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.DEPLOYED_STOPPED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STOPPED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.NOT_DEPLOYED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STOPPED, app.getTomcat().getStatus()); }

Target:
public void testStateAdvancedChange_undeployFails() { this.agent.stop(); this.agent = new Agent() { @Override public PluginInterface findPlugin( Instance instance ) { return new PluginMock() { @Override public void undeploy( Instance instance ) throws PluginException { throw new PluginException( "For tests..." ); } }; } }; this.agent.setMessagingType(MessagingConstants.FACTORY_TEST); this.agent.start(); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); TestApplicationTemplate app = new TestApplicationTemplate(); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( InstanceStatus.NOT_DEPLOYED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.DEPLOYED_STARTED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.DEPLOYED_STOPPED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STOPPED, app.getTomcat().getStatus()); processor.processMessage( new MsgCmdChangeInstanceState( app.getTomcat(), InstanceStatus.NOT_DEPLOYED )); Assert.assertEquals( InstanceStatus.DEPLOYED_STOPPED, app.getTomcat().getStatus()); }
Source:
private String parseMode(String value) { if (value.equals("AUTO")) return "Auto"; if (value.equals("DRY")) return "Dry"; if (value.equals("COOL")) return "Cool"; if (value.equals("HEAT")) return "Heat"; if (value.equals("ONLYFUN")) return "OnlyFun"; if (value.equals("NIGHT")) return "Night"; return "None"; }

Target:
private DaikinMode parseMode(String value) { if (value.equals("AUTO")) return DaikinMode.Auto; if (value.equals("DRY")) return DaikinMode.Dry; if (value.equals("COOL")) return DaikinMode.Cool; if (value.equals("HEAT")) return DaikinMode.Heat; if (value.equals("ONLYFUN")) return DaikinMode.OnlyFun; if (value.equals("NIGHT")) return DaikinMode.Night; return DaikinMode.None; }
Source:
private Object convert(Object payload, Collection<MediaType> to) { if (this.conversionService != null) { MediaType requiredMediaType = findJavaObjectType(to); if (requiredMediaType != null) { String requiredType = requiredMediaType.getParameter("type"); if (requiredType == null) { return payload; } Class<?> clazz = null; try { clazz = Class.forName(requiredType); } catch (ClassNotFoundException e) { if (logger.isDebugEnabled()) { logger.debug("Class not found", e); } } if (clazz != null) { if (this.conversionService.canConvert(payload.getClass(), clazz)) { return this.conversionService.convert(payload, clazz); } } } else { if (this.acceptsString(to)) { if (this.conversionService.canConvert(payload.getClass(), String.class)) { return this.conversionService.convert(payload, String.class); } } } } return null; }

Target:
private Object convert(Object payload, Collection<MediaType> to) { if (this.conversionService != null) { MediaType requiredMediaType = findJavaObjectType(to); if (requiredMediaType != null) { String requiredType = requiredMediaType.getParameter("type"); if (requiredType == null) { return payload; } Class<?> clazz = null; try { clazz = this.beanClassloader.loadClass(requiredType); } catch (ClassNotFoundException e) { if (logger.isDebugEnabled()) { logger.debug("Class not found", e); } } if (clazz != null) { if (this.conversionService.canConvert(payload.getClass(), clazz)) { return this.conversionService.convert(payload, clazz); } } } else { if (this.acceptsString(to)) { if (this.conversionService.canConvert(payload.getClass(), String.class)) { return this.conversionService.convert(payload, String.class); } } } } return null; }
Source:
boolean isValidMetaKey(int key) { if (key == BluetoothDevice.METADATA_MANUFACTURER_NAME || key == BluetoothDevice.METADATA_MODEL_NAME || key == BluetoothDevice.METADATA_SOFTWARE_VERSION || key == BluetoothDevice.METADATA_HARDWARE_VERSION || key == BluetoothDevice.METADATA_COMPANION_APP || key == BluetoothDevice.METADATA_MAIN_ICON || key == BluetoothDevice.METADATA_IS_UNTHETHERED_HEADSET || key == BluetoothDevice.METADATA_UNTHETHERED_LEFT_ICON || key == BluetoothDevice.METADATA_UNTHETHERED_RIGHT_ICON || key == BluetoothDevice.METADATA_UNTHETHERED_CASE_ICON || key == BluetoothDevice.METADATA_UNTHETHERED_LEFT_BATTERY || key == BluetoothDevice.METADATA_UNTHETHERED_RIGHT_BATTERY || key == BluetoothDevice.METADATA_UNTHETHERED_CASE_BATTERY || key == BluetoothDevice.METADATA_ENHANCED_SETTINGS_UI_URI) { return true; } return false; }

Target:
boolean isValidMetaKey(int key) { switch (key) { case BluetoothDevice.METADATA_MANUFACTURER_NAME: case BluetoothDevice.METADATA_MODEL_NAME: case BluetoothDevice.METADATA_SOFTWARE_VERSION: case BluetoothDevice.METADATA_HARDWARE_VERSION: case BluetoothDevice.METADATA_COMPANION_APP: case BluetoothDevice.METADATA_MAIN_ICON: case BluetoothDevice.METADATA_IS_UNTHETHERED_HEADSET: case BluetoothDevice.METADATA_UNTHETHERED_LEFT_ICON: case BluetoothDevice.METADATA_UNTHETHERED_RIGHT_ICON: case BluetoothDevice.METADATA_UNTHETHERED_CASE_ICON: case BluetoothDevice.METADATA_UNTHETHERED_LEFT_BATTERY: case BluetoothDevice.METADATA_UNTHETHERED_RIGHT_BATTERY: case BluetoothDevice.METADATA_UNTHETHERED_CASE_BATTERY: case BluetoothDevice.METADATA_ENHANCED_SETTINGS_UI_URI: return true; } Log.w(TAG, "Invalid metadata key " + key); return false; }
Source:
public String getHelpText() { return new String(); }

Target:
public String getHelpText() { return ""; }
Source:
private void checkPage() { try { if (remoteConfig == null) { setErrorMessage(UIText.PushBranchPage_ChooseRemoteError); return; } String branchName = remoteBranchNameText.getText(); String branchNameMessage = null; if (branchName.length() == 0) { branchNameMessage = MessageFormat.format( UIText.PullWizardPage_ChooseReference, remoteConfig.getName()); } else if (!Repository .isValidRefName(Constants.R_HEADS + branchName)) { branchNameMessage = UIText.PushBranchPage_InvalidBranchNameError; return; } if (branchNameMessage != null) { setErrorMessage(branchNameMessage); if (this.missingBranchDecorator == null) { this.missingBranchDecorator = new ControlDecoration(this.remoteBranchNameText, SWT.TOP | SWT.LEFT); this.missingBranchDecorator .setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration( FieldDecorationRegistry.DEC_ERROR) .getImage()); } this.missingBranchDecorator .setDescriptionText(branchNameMessage); this.missingBranchDecorator.show(); return; } else if (this.missingBranchDecorator != null) { this.missingBranchDecorator.hide(); } if (overrideUpstreamConfiguration() && hasDifferentUpstreamConfiguration()) { setMessage(UIText.PushBranchPage_UpstreamConfigOverwriteWarning, IMessageProvider.WARNING); } else { setMessage(UIText.PullWizardPage_PageMessage); } setErrorMessage(null); } finally { setPageComplete(getErrorMessage() == null); } }

Target:
private void checkPage() { try { if (remoteConfig == null) { setErrorMessage(UIText.PushBranchPage_ChooseRemoteError); return; } String branchName = remoteBranchNameText.getText(); String branchNameMessage = null; if (branchName.length() == 0) { branchNameMessage = MessageFormat.format( UIText.PullWizardPage_ChooseReference, remoteConfig.getName()); } if (branchNameMessage != null) { setErrorMessage(branchNameMessage); if (this.missingBranchDecorator == null) { this.missingBranchDecorator = new ControlDecoration(this.remoteBranchNameText, SWT.TOP | SWT.LEFT); this.missingBranchDecorator .setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration( FieldDecorationRegistry.DEC_ERROR) .getImage()); } this.missingBranchDecorator .setDescriptionText(branchNameMessage); this.missingBranchDecorator.show(); return; } else if (this.missingBranchDecorator != null) { this.missingBranchDecorator.hide(); } if (overrideUpstreamConfiguration() && hasDifferentUpstreamConfiguration()) { setMessage(UIText.PushBranchPage_UpstreamConfigOverwriteWarning, IMessageProvider.WARNING); } else { setMessage(UIText.PullWizardPage_PageMessage); } setErrorMessage(null); } finally { setPageComplete(getErrorMessage() == null); } }
Source:
public void testDeviceConversion() throws UnknownHostException { final Device device = new Device("id", "alias", "city", "postal", "street", "nr", "munic", 12f, 13f); device.updateRegistrationData(InetAddress.getByName("localhost"), "type"); final com.alliander.osgp.adapter.ws.schema.core.devicemanagement.Device jaxbDevice = this.deviceManagementMapper .map(device, com.alliander.osgp.adapter.ws.schema.core.devicemanagement.Device.class); Assert.assertEquals("id", jaxbDevice.getDeviceIdentification()); Assert.assertEquals("alias", jaxbDevice.getAlias()); Assert.assertEquals("city", jaxbDevice.getContainerCity()); Assert.assertEquals("postal", jaxbDevice.getContainerPostalCode()); Assert.assertEquals("street", jaxbDevice.getContainerStreet()); Assert.assertEquals("nr", jaxbDevice.getContainerNumber()); Assert.assertEquals("munic", jaxbDevice.getContainerMunicipality()); Assert.assertEquals("12.0", jaxbDevice.getGpsLatitude()); Assert.assertEquals("13.0", jaxbDevice.getGpsLongitude()); Assert.assertEquals("localhost/127.0.0.1", jaxbDevice.getNetworkAddress()); Assert.assertEquals("type", jaxbDevice.getDeviceType()); }

Target:
public void testDeviceConversion() throws UnknownHostException { final Device device = new Device("id", "alias", "city", "postal", "street", "nr", "munic", 12f, 13f); device.updateRegistrationData(InetAddress.getByName("localhost"), "type"); final com.alliander.osgp.adapter.ws.schema.core.devicemanagement.Device jaxbDevice = this.deviceManagementMapper .map(device, com.alliander.osgp.adapter.ws.schema.core.devicemanagement.Device.class); assertEquals("id", jaxbDevice.getDeviceIdentification()); assertEquals("alias", jaxbDevice.getAlias()); assertEquals("city", jaxbDevice.getContainerCity()); assertEquals("postal", jaxbDevice.getContainerPostalCode()); assertEquals("street", jaxbDevice.getContainerStreet()); assertEquals("nr", jaxbDevice.getContainerNumber()); assertEquals("munic", jaxbDevice.getContainerMunicipality()); assertEquals("12.0", jaxbDevice.getGpsLatitude()); assertEquals("13.0", jaxbDevice.getGpsLongitude()); assertEquals("localhost/127.0.0.1", jaxbDevice.getNetworkAddress()); assertEquals("type", jaxbDevice.getDeviceType()); }
Source:
ProcedureRunner(VoltProcedure procedure, SiteProcedureConnection site, SystemProcedureExecutionContext sysprocContext, Procedure catProc, CatalogSpecificPlanner csp) { assert(m_inputCRC.getValue() == 0L); String language = catProc.getLanguage(); if (language != null && !language.trim().isEmpty()) { m_language = Language.valueOf(language.trim().toUpperCase()); } else if (procedure instanceof StmtProcedure){ m_language = null; } else { m_language = Language.JAVA; } if (procedure instanceof StmtProcedure) { m_procedureName = catProc.getTypeName().intern(); } else { m_procedureName = m_language.accept(procedureNameRetriever, procedure); } m_procedure = procedure; m_isSysProc = procedure instanceof VoltSystemProcedure; m_catProc = catProc; m_hasJava = catProc.getHasjava(); m_isReadOnly = catProc.getReadonly(); m_isSinglePartition = m_catProc.getSinglepartition(); if (m_isSinglePartition) { ProcedurePartitionInfo ppi = (ProcedurePartitionInfo)m_catProc.getAttachment(); m_partitionColumn = ppi.index; m_partitionColumnType = ppi.type; } else { m_partitionColumn = 0; m_partitionColumnType = null; } m_site = site; m_systemProcedureContext = sysprocContext; m_csp = csp; m_procedure.init(this); m_statsCollector = new ProcedureStatsCollector( m_site.getCorrespondingSiteId(), m_site.getCorrespondingPartitionId(), m_catProc); m_statsCollector = VoltDB.instance().getStatsAgent().registerProcedureStatsSource( site.getCorrespondingSiteId(), m_statsCollector); reflect(); }

Target:
ProcedureRunner(VoltProcedure procedure, SiteProcedureConnection site, SystemProcedureExecutionContext sysprocContext, Procedure catProc, CatalogSpecificPlanner csp) { assert(m_inputCRC.getValue() == 0L); String language = catProc.getLanguage(); if (language != null && !language.trim().isEmpty()) { m_language = Language.valueOf(language.trim().toUpperCase()); } else if (procedure instanceof StmtProcedure){ m_language = null; } else { m_language = Language.JAVA; } if (procedure instanceof StmtProcedure) { m_procedureName = catProc.getTypeName().intern(); } else { m_procedureName = m_language.accept(procedureNameRetriever, procedure); } m_procedure = procedure; m_isSysProc = procedure instanceof VoltSystemProcedure; m_catProc = catProc; m_hasJava = catProc.getHasjava(); m_isReadOnly = catProc.getReadonly(); m_isSinglePartition = m_catProc.getSinglepartition(); if (m_isSinglePartition) { ProcedurePartitionInfo ppi = (ProcedurePartitionInfo)m_catProc.getAttachment(); m_partitionColumn = ppi.index; m_partitionColumnType = ppi.type; } else { m_partitionColumn = 0; m_partitionColumnType = null; } m_site = site; m_systemProcedureContext = sysprocContext; m_csp = csp; m_procedure.init(this); m_statsCollector = VoltDB.instance().getStatsAgent().registerProcedureStatsSource( site.getCorrespondingSiteId(), new ProcedureStatsCollector( m_site.getCorrespondingSiteId(), m_site.getCorrespondingPartitionId(), m_catProc) ); reflect(); }
Source:
boolean excludeMatchBean(Configuration conf) { Filter exclude = conf.getExclude(); ArrayList<String> beanNames = exclude.getBeanNames(); if(beanNames.contains(beanName)){ return true; } for (String bean_attr : exclude.keySet()) { if (EXCLUDED_BEAN_PARAMS.contains(bean_attr)) { continue; } ArrayList<String> beanValues = exclude.getParameterValues(bean_attr); for (String beanVal : beanValues) { if (beanParameters.get(bean_attr) != null && beanParameters.get(bean_attr).equals(beanVal)) { return true; } } } return false; }

Target:
boolean excludeMatchBean(Configuration conf) { Filter exclude = conf.getExclude(); ArrayList<String> beanNames = exclude.getBeanNames(); if(beanNames.contains(beanName)){ return true; } for (String bean_attr : exclude.keySet()) { if (EXCLUDED_BEAN_PARAMS.contains(bean_attr)) { continue; } if (beanParameters.get(bean_attr) == null) { continue; } ArrayList<String> beanValues = exclude.getParameterValues(bean_attr); for (String beanVal : beanValues) { if (beanParameters.get(bean_attr).equals(beanVal)) { return true; } } } return false; }
Source:
private Map<String, String> createGroups(List<String> groups) { return GroupsHelper.createGroups(groups, m_metaGroups); }

Target:
private Map<String, String> createGroups(List<String> groups) { return GroupsHelper.createGroups(m_metaGroups, groups); }
Source:
public void verifyPreviewPageHeader(String targetText) { Assertion.assertStringContains(targetText, getPageHeaderText()); PageObjectLogging.log("verifyPreviewPageHeader", "verifying the summary shows " + targetText, true); }

Target:
public void verifyPreviewPageHeader(String targetText) { Assertion.assertStringContains(targetText, selectedPageHeader.getText()); PageObjectLogging.log( "verifyPreviewPageHeader", "The summary shows " + targetText, true ); }
Source:
protected boolean subjectAndCandidateMatch(Item subject, Item candidate) { ImmutableSet<String> aliasesOfCandidateBroadcasts = FluentIterable.from(candidate.flattenBroadcasts()) .transformAndConcat(BROADCAST_TO_ALIAS_STRING_ITERABLE) .toSet(); ImmutableSet<String> aliasesOfSubjectBroadcasts = FluentIterable.from(subject.flattenBroadcasts()) .transformAndConcat(BROADCAST_TO_ALIAS_STRING_ITERABLE) .toSet(); if (!Sets.intersection(aliasesOfCandidateBroadcasts, aliasesOfSubjectBroadcasts).isEmpty()) { return true; } return false; }

Target:
protected boolean subjectAndCandidateMatch(Item subject, Item candidate) { ImmutableSet<String> aliasesOfCandidateBroadcasts = FluentIterable.from(candidate.flattenBroadcasts()) .transformAndConcat(BROADCAST_TO_ALIAS_STRING_ITERABLE) .toSet(); ImmutableSet<String> aliasesOfSubjectBroadcasts = FluentIterable.from(subject.flattenBroadcasts()) .transformAndConcat(BROADCAST_TO_ALIAS_STRING_ITERABLE) .toSet(); return !Sets.intersection(aliasesOfCandidateBroadcasts, aliasesOfSubjectBroadcasts).isEmpty(); }
Source:
private boolean isColumnEligibleToScale(Column column, List<String> scaleRequestedColumnNames) { return (column.isNumeric() && column.getColumnClass() != ColumnClass.FACTOR && ((scaleRequestedColumnNames == null) || scaleRequestedColumnNames.isEmpty() || scaleRequestedColumnNames.contains(column.getName()))); }

Target:
private boolean isColumnEligibleToScale(Column column, List<String> scaleRequestedColumnNames) { return (column.isNumeric() && column.getColumnClass() != ColumnClass.FACTOR && ((scaleRequestedColumnNames == null) || scaleRequestedColumnNames.contains(column.getName()))); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RpcOptions options = (RpcOptions) o; if (timeout != options.timeout) return false; if (deliverOrder != options.deliverOrder) return false; return unit == options.unit; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RpcOptions options = (RpcOptions) o; return timeout == options.timeout && deliverOrder == options.deliverOrder && unit == options.unit; }
Source:
public byte[] toBytes(TimeSeriesKey<K> timeSeriesKey) { K key = timeSeriesKey.getKey(); long timestamp = timeSeriesKey.getTimestamp(); int seqNum = timeSeriesKey.getSeqNum(); byte[] serializedKey = keySerde.toBytes(key); int keySize = serializedKey == null ? 0 : serializedKey.length; ByteBuffer buf = ByteBuffer.allocate(keySize + TIMESTAMP_SIZE + SEQNUM_SIZE); if (serializedKey != null) { buf.put(serializedKey); } buf.putLong(timestamp); buf.putInt(seqNum); return buf.array(); }

Target:
public byte[] toBytes(TimeSeriesKey<K> timeSeriesKey) { K key = timeSeriesKey.getKey(); long timestamp = timeSeriesKey.getTimestamp(); long seqNum = timeSeriesKey.getSeqNum(); byte[] serializedKey = keySerde.toBytes(key); int keySize = serializedKey == null ? 0 : serializedKey.length; ByteBuffer buf = ByteBuffer.allocate(keySize + TIMESTAMP_SIZE + SEQNUM_SIZE); if (serializedKey != null) { buf.put(serializedKey); } buf.putLong(timestamp); buf.putLong(seqNum & SEQUENCE_NUM_MASK); return buf.array(); }
Source:
public void shouldProvidePopulatorThatEnforcesUniqueConstraints() throws Exception { String value = "value1"; int nodeId1 = 1; int nodeId2 = 2; IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, indexSamplingConfig ); populator.create(); populator.add( Arrays.asList( IndexEntryUpdate.add( nodeId1, descriptor, value ), IndexEntryUpdate.add( nodeId2, descriptor, value ) ) ); try { PropertyAccessor propertyAccessor = mock( PropertyAccessor.class ); int propertyKeyId = descriptor.schema().getPropertyId(); when( propertyAccessor.getProperty( nodeId1, propertyKeyId )).thenReturn( stringProperty( propertyKeyId, value ) ); when( propertyAccessor.getProperty( nodeId2, propertyKeyId )).thenReturn( stringProperty( propertyKeyId, value ) ); populator.verifyDeferredConstraints( propertyAccessor ); fail( "expected exception" ); } catch ( IndexEntryConflictException conflict ) { assertEquals( nodeId1, conflict.getExistingNodeId() ); assertEquals( new OrderedPropertyValues( value ), conflict.getPropertyValues() ); assertEquals( nodeId2, conflict.getAddedNodeId() ); } }

Target:
public void shouldProvidePopulatorThatEnforcesUniqueConstraints() throws Exception { String value = "value1"; int nodeId1 = 1; int nodeId2 = 2; IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, indexSamplingConfig ); populator.create(); populator.add( Arrays.asList( IndexEntryUpdate.add( nodeId1, descriptor, value ), IndexEntryUpdate.add( nodeId2, descriptor, value ) ) ); try { PropertyAccessor propertyAccessor = mock( PropertyAccessor.class ); int propertyKeyId = descriptor.schema().getPropertyId(); when( propertyAccessor.getProperty( nodeId1, propertyKeyId )).thenReturn( stringProperty( propertyKeyId, value ) ); when( propertyAccessor.getProperty( nodeId2, propertyKeyId )).thenReturn( stringProperty( propertyKeyId, value ) ); populator.verifyDeferredConstraints( propertyAccessor ); fail( "expected exception" ); } catch ( IndexEntryConflictException conflict ) { assertEquals( nodeId1, conflict.getExistingNodeId() ); assertEquals( OrderedPropertyValues.of( value ), conflict.getPropertyValues() ); assertEquals( nodeId2, conflict.getAddedNodeId() ); } }
Source:
protected ModelAndView uploadReportTemplate(HttpServletRequest request, @RequestParam MultipartFile templateFile) throws IOException, SAXException { if (templateFile.isEmpty()) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "radiology.MrrtReportTemplate.not.imported.empty"); return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); } try { mrrtReportTemplateService.importMrrtReportTemplate(templateFile.getInputStream()); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.MrrtReportTemplate.imported"); } catch (IOException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } catch (APIException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); }

Target:
protected ModelAndView uploadReportTemplate(HttpServletRequest request, @RequestParam MultipartFile templateFile) throws IOException { if (templateFile.isEmpty()) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "radiology.MrrtReportTemplate.not.imported.empty"); return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); } try { mrrtReportTemplateService.importMrrtReportTemplate(templateFile.getInputStream()); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.MrrtReportTemplate.imported"); } catch (IOException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } catch (APIException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); }
Source:
public OrcZstdDecompressor(OrcDataSourceId orcDataSourceId, int maxBufferSize) { this.orcDataSourceId = orcDataSourceId; this.maxBufferSize = maxBufferSize; }

Target:
public OrcZstdDecompressor(OrcDataSourceId orcDataSourceId, int maxBufferSize) { this.orcDataSourceId = requireNonNull(orcDataSourceId, "orcDataSourceId is null"); this.maxBufferSize = maxBufferSize; }
Source:
protected ContextBuilder builder(Properties overrides) { MockWebServer defaultServer = regionToServers.get(DEFAULT_REGION); overrides.setProperty(Constants.PROPERTY_MAX_RETRIES, "1"); return ContextBuilder.newBuilder(new AWSEC2ProviderMetadata()) .credentials(ACCESS_KEY, SECRET_KEY) .endpoint("http://" + defaultServer.getHostName() + ":" + defaultServer.getPort()) .overrides(overrides) .modules(modules); }

Target:
protected ContextBuilder builder(Properties overrides) { MockWebServer defaultServer = regionToServers.get(DEFAULT_REGION); overrides.setProperty(Constants.PROPERTY_MAX_RETRIES, "1"); return ContextBuilder.newBuilder(new AWSEC2ProviderMetadata()) .credentials(ACCESS_KEY, SECRET_KEY) .endpoint(defaultServer.getUrl("").toString()) .overrides(overrides) .modules(modules); }
Source:
protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes(UTF8)); } } return digest; }

Target:
protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes(StandardCharsets.UTF_8)); } } return digest; }
Source:
public static ClientConfiguration of(ServiceConfiguration config) { return ImmutableClientConfiguration.builder() .sslSocketFactory(SslSocketFactories.createSslSocketFactory(config.security())) .trustManager(SslSocketFactories.createX509TrustManager(config.security())) .uris(config.uris()) .connectTimeout(config.connectTimeout().orElse(DEFAULT_CONNECT_TIMEOUT)) .readTimeout(config.readTimeout().orElse(DEFAULT_READ_TIMEOUT)) .writeTimeout(config.writeTimeout().orElse(DEFAULT_WRITE_TIMEOUT)) .enableGcmCipherSuites(config.enableGcmCipherSuites().orElse(DEFAULT_ENABLE_GCM_CIPHERS)) .proxy(createProxySelector(config.proxy())) .proxyCredentials(config.proxy().flatMap(ProxyConfiguration::credentials)) .maxNumRetries(DEFAULT_MAX_NUM_RETRIES) .build(); }

Target:
public static ClientConfiguration of(ServiceConfiguration config) { return ClientConfiguration.builder() .sslSocketFactory(SslSocketFactories.createSslSocketFactory(config.security())) .trustManager(SslSocketFactories.createX509TrustManager(config.security())) .uris(config.uris()) .connectTimeout(config.connectTimeout().orElse(DEFAULT_CONNECT_TIMEOUT)) .readTimeout(config.readTimeout().orElse(DEFAULT_READ_TIMEOUT)) .writeTimeout(config.writeTimeout().orElse(DEFAULT_WRITE_TIMEOUT)) .enableGcmCipherSuites(config.enableGcmCipherSuites().orElse(DEFAULT_ENABLE_GCM_CIPHERS)) .proxy(createProxySelector(config.proxy())) .proxyCredentials(config.proxy().flatMap(ProxyConfiguration::credentials)) .maxNumRetries(DEFAULT_MAX_NUM_RETRIES) .build(); }
Source:
private void computeContainerStructure() { if (DEBUG_INITIALIZATION) System.out.println("\n*** Computing Container Structure ***\n"); initializeContainerStructure(); if (DEBUG_INITIALIZATION) dumpContainerStructure(); while (!fWorkList2.isEmpty()) { ConstraintVariable2 v= fWorkList2.pop(); List<ITypeConstraint2> usedIn= fTCModel.getUsedIn(v); for (ITypeConstraint2 iTypeConstraint2 : usedIn) { SubTypeConstraint2 stc= (SubTypeConstraint2) iTypeConstraint2; ConstraintVariable2 lhs= stc.getLeft(); ConstraintVariable2 rhs= stc.getRight(); unifyContainerStructure(lhs, rhs); } TypeEquivalenceSet typeEquivalenceSet= v.getTypeEquivalenceSet(); if (typeEquivalenceSet != null) { ConstraintVariable2[] contributingVariables= typeEquivalenceSet.getContributingVariables(); for (int i= 0; i + 1 < contributingVariables.length; i++) { ConstraintVariable2 first= contributingVariables[i]; ConstraintVariable2 second= contributingVariables[i + 1]; unifyContainerStructure(first, second); } } } if (DEBUG_INITIALIZATION) dumpContainerStructure(); }

Target:
private void computeContainerStructure() { if (DEBUG_INITIALIZATION) System.out.println("\n*** Computing Container Structure ***\n"); initializeContainerStructure(); if (DEBUG_INITIALIZATION) dumpContainerStructure(); while (!fWorkList2.isEmpty()) { ConstraintVariable2 v= fWorkList2.pop(); for (ITypeConstraint2 constraint : fTCModel.getUsedIn(v)) { SubTypeConstraint2 stc= (SubTypeConstraint2) constraint; ConstraintVariable2 lhs= stc.getLeft(); ConstraintVariable2 rhs= stc.getRight(); unifyContainerStructure(lhs, rhs); } TypeEquivalenceSet typeEquivalenceSet= v.getTypeEquivalenceSet(); if (typeEquivalenceSet != null) { ConstraintVariable2[] contributingVariables= typeEquivalenceSet.getContributingVariables(); for (int i= 0; i + 1 < contributingVariables.length; i++) { ConstraintVariable2 first= contributingVariables[i]; ConstraintVariable2 second= contributingVariables[i + 1]; unifyContainerStructure(first, second); } } } if (DEBUG_INITIALIZATION) dumpContainerStructure(); }
Source:
protected void setTestTag(IBuildInfo info, IConfiguration config) { if (!"stub".equals(config.getCommandOptions().getTestTag())) { info.setTestTag(getTestTag(config)); } else if (info.getTestTag() == null || info.getTestTag().isEmpty()) { info.setTestTag("stub"); } else { CLog.w( "Using the test-tag from the build_provider. Consider updating your config to" + " have no alias/namespace in front of test-tag."); } }

Target:
protected void setTestTag(IBuildInfo info, IConfiguration config) { if (!"stub".equals(config.getCommandOptions().getTestTag())) { info.setTestTag(getTestTag(config)); } else if (Strings.isNullOrEmpty(info.getTestTag())) { info.setTestTag("stub"); } else { CLog.w( "Using the test-tag from the build_provider. Consider updating your config to" + " have no alias/namespace in front of test-tag."); } }
Source:
public void testListAllTargets() { assertEquals("pants.ini file should have no targets", PantsUtil.listAllTargets(pantsIniFilePath), Lists.newArrayList()); assertEquals("made up file path should have no targets", PantsUtil.listAllTargets(nonexistentFilePath), Lists.newArrayList()); try { PantsUtil.listAllTargets(nonexistentBuildFilePath); fail(String.format("%s should have been thrown", PantsException.class)); } catch (PantsException ignored) { } try { PantsUtil.listAllTargets(invalidBuildFilePath); fail(String.format("%s should have been thrown")); } catch (PantsException ignored) { } }

Target:
public void testListAllTargets() { assertEquals("pants.ini file should have no targets", PantsUtil.listAllTargets(pantsIniFilePath), Lists.newArrayList()); assertEquals("made up non-BUILD file path should have no targets", PantsUtil.listAllTargets(nonexistentFilePath), Lists.newArrayList()); try { PantsUtil.listAllTargets(nonexistentBuildFilePath); fail(String.format("%s should have been thrown", PantsException.class)); } catch (PantsException ignored) { } try { PantsUtil.listAllTargets(invalidBuildFilePath); fail(String.format("%s should have been thrown", PantsException.class)); } catch (PantsException ignored) { } }
Source:
public void onDestroy() { if (mQueue != null && mQueue.size() > 0) { for (MediaModel oneUpload : mQueue) { cancelUpload(oneUpload); } } mDispatcher.unregister(this); AppLog.i(AppLog.T.MEDIA, "Media Upload Service > destroyed"); super.onDestroy(); }

Target:
public void onDestroy() { List<MediaModel> queue = getUploadQueue(); for (MediaModel oneUpload : queue) { cancelUpload(oneUpload); } mDispatcher.unregister(this); AppLog.i(AppLog.T.MEDIA, "Media Upload Service > destroyed"); super.onDestroy(); }
Source:
public boolean execute(CommandSender sender, String label, String[] args) { if (!testPermission(sender)) return false; final World world = CommandUtils.getWorld(sender); if (world == null) { return false; } else { if (world.hasStorm()) { world.setThundering(false); world.setStorm(false); } else { world.setThundering(true); world.setStorm(true); } } return true; }

Target:
public boolean execute(CommandSender sender, String label, String[] args) { if (!testPermission(sender)) return false; final World world = CommandUtils.getWorld(sender); if (world == null) { return false; } else { world.setThundering(!world.hasStorm()); world.setStorm(!world.hasStorm()); } return true; }
Source:
protected boolean copyBlob(String key, S3BlobStore sourceBlobStore, String sourceKey, boolean move) throws IOException, AmazonServiceException { String sourceBucketName = sourceBlobStore.bucketName; String sourceBucketKey = sourceBlobStore.bucketPrefix + sourceKey; String bucketKey = bucketPrefix + key; long t0 = 0; if (log.isDebugEnabled()) { t0 = System.currentTimeMillis(); log.debug("Copying s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey); } if (getKeyStrategy().useDeDuplication() && exists(bucketKey)) { return true; } logTrace("->", "getObjectMetadata"); ObjectMetadata sourceMetadata = amazonS3.getObjectMetadata(sourceBucketName, sourceBucketKey); long length = sourceMetadata.getContentLength(); logTrace("<-", length + " bytes"); try { copyBlob(sourceBlobStore.config, sourceBucketKey, config, bucketKey, move); if (log.isDebugEnabled()) { long dtms = System.currentTimeMillis() - t0; log.debug("Copied s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey + " in " + dtms + "ms"); } return true; } catch (AmazonServiceException e) { logTrace("<--", "ERROR"); String message = "Direct copy failed from s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey + " (" + length + " bytes)"; log.warn(message + ", falling back to slow copy: " + e.getMessage()); log.debug(message, e); return false; } }

Target:
protected boolean copyBlob(String key, S3BlobStore sourceBlobStore, String sourceKey, boolean move) throws AmazonServiceException { String sourceBucketName = sourceBlobStore.bucketName; String sourceBucketKey = sourceBlobStore.bucketPrefix + sourceKey; String bucketKey = bucketPrefix + key; long t0 = 0; if (log.isDebugEnabled()) { t0 = System.currentTimeMillis(); log.debug("Copying s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey); } if (getKeyStrategy().useDeDuplication() && exists(bucketKey)) { return true; } logTrace("->", "getObjectMetadata"); ObjectMetadata sourceMetadata = amazonS3.getObjectMetadata(sourceBucketName, sourceBucketKey); long length = sourceMetadata.getContentLength(); logTrace("<-", length + " bytes"); try { copyBlob(sourceBlobStore.config, sourceBucketKey, config, bucketKey, move); if (log.isDebugEnabled()) { long dtms = System.currentTimeMillis() - t0; log.debug("Copied s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey + " in " + dtms + "ms"); } return true; } catch (AmazonServiceException e) { logTrace("<--", "ERROR"); String message = "Direct copy failed from s3://" + sourceBucketName + "/" + sourceBucketKey + " to s3://" + bucketName + "/" + bucketKey + " (" + length + " bytes)"; log.warn(message + ", falling back to slow copy: " + e.getMessage()); log.debug(message, e); return false; } }
Source:
protected Object encodeCommand(Command command) { initDevicePassword(command, ""); switch (command.getType()) { case Command.TYPE_CUSTOM: return encodeContent(command.getString(Command.KEY_DATA)); case Command.TYPE_ENGINE_STOP: return encodeContent("AT$IOGP3=1"); case Command.TYPE_ENGINE_RESUME: return encodeContent("AT$IOGP3=0"); default: Log.warning(new UnsupportedOperationException(command.getType())); break; } return null; }

Target:
protected Object encodeCommand(Command command) { switch (command.getType()) { case Command.TYPE_CUSTOM: return encodeContent(command.getString(Command.KEY_DATA)); case Command.TYPE_ENGINE_STOP: return encodeContent("AT$IOGP3=1"); case Command.TYPE_ENGINE_RESUME: return encodeContent("AT$IOGP3=0"); default: Log.warning(new UnsupportedOperationException(command.getType())); break; } return null; }
Source:
protected Map<Long, Tuple2<Double, ColumnStatisticsImpl>> mergeResults( List<Tuple2<Long, Tuple2<Double, ColumnStatisticsImpl>>> tuples) throws StandardException{ Map<Long, ColumnStatisticsMerge> sm = new HashMap<>(); Map<Long, Double> sizeMap = new HashMap<>(); for (Tuple2<Long,Tuple2<Double, ColumnStatisticsImpl>> t : tuples) { Long conglomId = t._1; Double size = t._2._1; if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "conglomerate=%d, size=%f", conglomId, size); } ColumnStatisticsImpl cs = t._2._2; ColumnStatisticsMerge columnStatisticsMerge = sm.get(conglomId); if (columnStatisticsMerge == null) { columnStatisticsMerge = new ColumnStatisticsMerge(); sm.put(conglomId, columnStatisticsMerge); } columnStatisticsMerge.accumulate(cs); Double totalSize = sizeMap.get(conglomId); if (totalSize == null) totalSize = new Double(0); totalSize += size; if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "totalSize=%s", totalSize); } sizeMap.put(conglomId, totalSize); } Map<Long, Tuple2<Double, ColumnStatisticsImpl>> statisticsMap = new HashMap<>(); for (Long conglomId : sm.keySet()) { Double totalSize = sizeMap.get(conglomId); ColumnStatisticsImpl columnStatistics = sm.get(conglomId).terminate(); statisticsMap.put(conglomId, new Tuple2(totalSize, columnStatistics)); } return statisticsMap; }

Target:
protected Map<Long, Tuple2<Double, ColumnStatisticsImpl>> mergeResults( List<Tuple2<Long, Tuple2<Double, ColumnStatisticsImpl>>> tuples) throws StandardException{ Map<Long, ColumnStatisticsMerge> sm = new HashMap<>(); Map<Long, Double> sizeMap = new HashMap<>(); for (Tuple2<Long,Tuple2<Double, ColumnStatisticsImpl>> t : tuples) { Long conglomId = t._1; Double size = t._2._1; if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "conglomerate=%d, size=%f", conglomId, size); } ColumnStatisticsImpl cs = t._2._2; ColumnStatisticsMerge columnStatisticsMerge = sm.get(conglomId); if (columnStatisticsMerge == null) { columnStatisticsMerge = new ColumnStatisticsMerge(); sm.put(conglomId, columnStatisticsMerge); } columnStatisticsMerge.accumulate(cs); Double totalSize = sizeMap.get(conglomId); if (totalSize == null) totalSize = new Double(0); totalSize += size; if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "totalSize=%f", totalSize); } sizeMap.put(conglomId, totalSize); } Map<Long, Tuple2<Double, ColumnStatisticsImpl>> statisticsMap = new HashMap<>(); for (Long conglomId : sm.keySet()) { Double totalSize = sizeMap.get(conglomId); ColumnStatisticsImpl columnStatistics = sm.get(conglomId).terminate(); statisticsMap.put(conglomId, new Tuple2(totalSize, columnStatistics)); } return statisticsMap; }