auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void createAdditionalControls(Composite parent) { Composite apiKeyContainer = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(3, false); gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; apiKeyContainer.setLayout(gridLayout); Label shortLoginLabel = new Label(apiKeyContainer, SWT.NONE); shortLoginLabel.setText("use API Key"); useApiKey = new Button(apiKeyContainer, SWT.CHECK | SWT.LEFT); apiKey = new Text(apiKeyContainer, SWT.BORDER); GridDataFactory.fillDefaults() .grab(true, false) .align(SWT.FILL, SWT.CENTER) .hint(300, SWT.DEFAULT) .applyTo(apiKey); if (repository != null) { useApiKey.setSelection( Boolean.parseBoolean(repository.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))); String apiKeyValue = repository.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY); apiKey.setText(apiKeyValue == null ? "" : apiKeyValue); } }

Target:
protected void createAdditionalControls(Composite parent) { Composite apiKeyContainer = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().margins(0, 0).numColumns(3).applyTo(apiKeyContainer); Label apiKeyLabel = new Label(apiKeyContainer, SWT.NONE); apiKeyLabel.setText(Messages.BugzillaRestRepositorySettingsPage_use_api_key); useApiKey = new Button(apiKeyContainer, SWT.CHECK | SWT.LEFT); apiKey = new Text(apiKeyContainer, SWT.BORDER); GridDataFactory.fillDefaults() .grab(true, false) .align(SWT.FILL, SWT.CENTER) .hint(300, SWT.DEFAULT) .applyTo(apiKey); if (repository != null) { useApiKey.setSelection( Boolean.parseBoolean(repository.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))); String apiKeyValue = repository.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY); apiKey.setText(apiKeyValue == null ? "" : apiKeyValue); } }
Source:
public void noDormantCheckOnModifies() throws Exception { AgendaEventListener ael = mock(AgendaEventListener.class); session.addEventListener(ael); List<Command<?>> commands = new ArrayList<Command<?>>(); commands.add(KieServices.Factory.get().getCommands().newInsert(new Person("Bob", 19))); commands.add(KieServices.Factory.get().getCommands().newInsert(new Cheese("brie", 10))); commands.add(KieServices.Factory.get().getCommands().newFireAllRules()); session.execute(KieServices.Factory.get().getCommands().newBatchExecution(commands, null)); verify(ael, times(2)).afterMatchFired(any(AfterMatchFiredEvent.class)); verify(ael, never()).matchCancelled(any(MatchCancelledEvent.class)); }

Target:
public void noDormantCheckOnModifies() throws Exception { AgendaEventListener ael = mock(AgendaEventListener.class); session.addEventListener(ael); session.setGlobal("LOGGER", LOGGER); List<Command<?>> commands = new ArrayList<Command<?>>(); commands.add(getCommands().newInsert(new Person("Bob", 19))); commands.add(getCommands().newInsert(new Cheese("brie", 10))); commands.add(getCommands().newFireAllRules()); session.execute(getCommands().newBatchExecution(commands, null)); verify(ael, times(2)).afterMatchFired(any(AfterMatchFiredEvent.class)); verify(ael, never()).matchCancelled(any(MatchCancelledEvent.class)); }
Source:
public void storeBlock(BlockState blockState, int amount) throws BlockBagException { if (blockState.getBlockType() == BlockTypes.AIR) { throw new IllegalArgumentException("Can't store air block"); } if (!blockState.getBlockType().hasItemType()) { throw new IllegalArgumentException("This block cannot be stored"); } loadInventory(); int freeSlot = -1; for (int slot = 0; slot < items.length; ++slot) { ItemStack bukkitItem = items[slot]; if (bukkitItem == null) { if (freeSlot == -1) { freeSlot = slot; } continue; } if (!bukkitItem.getType().getKey().toString().equals(blockState.getBlockType().getId())) { continue; } int currentAmount = bukkitItem.getAmount(); if (currentAmount < 0) { return; } if (currentAmount >= 64) { continue; } int spaceLeft = 64 - currentAmount; if (spaceLeft >= amount) { bukkitItem.setAmount(currentAmount + amount); return; } bukkitItem.setAmount(64); amount -= spaceLeft; } if (freeSlot > -1) { items[freeSlot] = new ItemStack(BukkitUtil.toItemStack(new BaseItemStack(blockState.getBlockType().getItemType(), amount))); return; } throw new OutOfSpaceException(blockState.getBlockType()); }

Target:
public void storeBlock(BlockState blockState, int amount) throws BlockBagException { if (blockState.getBlockType() == BlockTypes.AIR) { throw new IllegalArgumentException("Can't store air block"); } if (!blockState.getBlockType().hasItemType()) { throw new IllegalArgumentException("This block cannot be stored"); } loadInventory(); int freeSlot = -1; for (int slot = 0; slot < items.length; ++slot) { ItemStack bukkitItem = items[slot]; if (bukkitItem == null) { if (freeSlot == -1) { freeSlot = slot; } continue; } if (!BukkitAdapter.equals(blockState.getBlockType(), bukkitItem.getType())) { continue; } int currentAmount = bukkitItem.getAmount(); if (currentAmount < 0) { return; } if (currentAmount >= 64) { continue; } int spaceLeft = 64 - currentAmount; if (spaceLeft >= amount) { bukkitItem.setAmount(currentAmount + amount); return; } bukkitItem.setAmount(64); amount -= spaceLeft; } if (freeSlot > -1) { items[freeSlot] = BukkitAdapter.adapt(new BaseItemStack(blockState.getBlockType().getItemType(), amount)); return; } throw new OutOfSpaceException(blockState.getBlockType()); }
Source:
public static void call() { try { URL url = new URL(URL_STRING); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = getHtppPost(url); if (user != null) { httpPost.addHeader("Authorization", "Bearer " + Helios.getAccessToken(user)); } if (nvps != null) { httpPost.setEntity(new UrlEncodedFormEntity(nvps, StandardCharsets.UTF_8)); } httpClient.execute(httpPost); PageObjectLogging .log("CONTENT PUSH", "Content posted to: " + URL_STRING, true); } catch (ClientProtocolException e) { PageObjectLogging.log("EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } catch (IOException e) { PageObjectLogging.log("IO EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } catch (URISyntaxException e) { PageObjectLogging.log("URI_SYNTAX EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } }

Target:
public void call() { try { URL url = new URL(getURL()); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = getHtppPost(url); if (getUser() != null) { httpPost.addHeader("Authorization", "Bearer " + Helios.getAccessToken(getUser())); } if (getParams() != null) { httpPost.setEntity(new UrlEncodedFormEntity(getParams(), StandardCharsets.UTF_8)); } httpClient.execute(httpPost); PageObjectLogging.log("CONTENT PUSH", "Content posted to: " + URL_STRING, true); } catch (ClientProtocolException e) { PageObjectLogging.log("EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } catch (IOException e) { PageObjectLogging.log("IO EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } catch (URISyntaxException e) { PageObjectLogging.log("URI_SYNTAX EXCEPTION", e.toString(), false); throw new WebDriverException(ERROR_MESSAGE); } }
Source:
public static byte[] hexStringToBytes(String data) { if (data == null || data.length() < 2) return EMPTY_BYTE_ARRAY; if (data.startsWith("0x")) data = data.substring(2); if (data.length() % 2 == 1) data = "0" + data; return Hex.decode(data); }

Target:
public static byte[] hexStringToBytes(String data) { if (data == null) return EMPTY_BYTE_ARRAY; if (data.startsWith("0x")) data = data.substring(2); if (data.length() % 2 == 1) data = "0" + data; return Hex.decode(data); }
Source:
public Set<MacroId> getMacroIds(Syntax syntax) throws MacroLookupException { Set<MacroId> result = new HashSet<MacroId>(); Map<String, Macro> allMacros; try { allMacros = this.componentManager.get().getInstanceMap(Macro.class); } catch (ComponentLookupException e) { throw new MacroLookupException("Failed to lookup Macros", e); } for (Map.Entry<String, Macro> entry : allMacros.entrySet()) { MacroId macroId; try { macroId = this.macroIdFactory.createMacroId(entry.getKey()); } catch (ParseException e) { this.logger.warn("Invalid Macro descriptor format for hint [ {}" + entry.getKey() + " ]. The hint should contain either the macro name only or the macro name followed by " + "the syntax for which it is valid. In that case the macro name should be followed by a " + "\"/\" followed by the syntax name followed by another \"/\" followed by the syntax version. " + "For example \"html/xwiki/2.0\". This macro will not be available in the system."); continue; } if (syntax == null || macroId.getSyntax() == null || syntax.equals(macroId.getSyntax())) { result.add(macroId); } } return result; }

Target:
public Set<MacroId> getMacroIds(Syntax syntax) throws MacroLookupException { Set<MacroId> result = new HashSet<MacroId>(); Map<String, Macro> allMacros; try { allMacros = this.componentManager.get().getInstanceMap(Macro.class); } catch (ComponentLookupException e) { throw new MacroLookupException("Failed to lookup Macros", e); } for (Map.Entry<String, Macro> entry : allMacros.entrySet()) { MacroId macroId; try { macroId = this.macroIdFactory.createMacroId(entry.getKey()); } catch (ParseException e) { this.logger.warn("Invalid Macro descriptor format for hint [{}" + "]. The hint should contain either the macro name only or the macro name followed by " + "the syntax for which it is valid. In that case the macro name should be followed by a " + "\"/\" followed by the syntax name followed by another \"/\" followed by the syntax version. " + "For example \"html/xwiki/2.0\"." + "This macro will not be available in the system.", entry.getKey()); continue; } if (syntax == null || macroId.getSyntax() == null || syntax.equals(macroId.getSyntax())) { result.add(macroId); } } return result; }
Source:
public void verify_JSON_bind_work_with_setter_that_accept_object_type() throws Exception { final Stapler stapler = new Stapler(); stapler.setWebApp(new WebApp(Mockito.mock(ServletContext.class))); final MockRequest mockRequest = mockRequest(generateMultipartData()); RequestImpl req = new RequestImpl(stapler, mockRequest, Collections.<AncestorImpl>emptyList(), null); JSONObject json = new JSONObject(); json.put("stapler-class", SetterObject.class.getName()); json.put("$class", SetterObject.class.getName()); json.put("choices", "1\n2\n3"); SetterObject o = req.bindJSON(SetterObject.class, json); Assert.assertEquals(o.getChoices(), Arrays.asList("1", "2", "3")); }

Target:
public void verify_JSON_bind_work_with_setter_that_accept_object_type() throws Exception { final Stapler stapler = new Stapler(); stapler.setWebApp(new WebApp(Mockito.mock(ServletContext.class))); HttpServletRequest request = Mockito.mock(HttpServletRequest.class); RequestImpl req = new RequestImpl(stapler, request, Collections.<AncestorImpl>emptyList(), null); JSONObject json = new JSONObject(); json.put("$class", SetterObject.class.getName()); json.put("choices", "1\n2\n3"); SetterObject o = req.bindJSON(SetterObject.class, json); Assert.assertEquals(o.getChoices(), Arrays.asList("1", "2", "3")); }
Source:
public void testLoadConfigWithoutLoader() { Map<String, String> config = new HashMap<>(); config.put(JobConfig.JOB_NAME, "new-test-job"); Config actual = ConfigUtil.loadConfig(new MapConfig(config)); assertEquals(config.size(), actual.size()); assertEquals("new-test-job", actual.get(JobConfig.JOB_NAME)); }

Target:
public void testLoadConfigWithoutLoader() { Map<String, String> config = new HashMap<>(); config.put(JobConfig.JOB_NAME, "new-test-job"); ConfigUtil.loadConfig(new MapConfig(config)); }
Source:
List<Object> projectRow(Row row) throws TranslatorException { ArrayList<Object> output = new ArrayList<Object>(this.visitor.getProjectedColumns().size()); int id = row.getRowNum()+1; int i = -1; for (int index:this.visitor.getProjectedColumns()) { i++; if (index == -1) { output.add(id); continue; } Cell cell = row.getCell(index-1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK); if (cell == null) { output.add(null); continue; } switch (this.evaluator.evaluateInCell(cell).getCellType()) { case Cell.CELL_TYPE_NUMERIC: output.add(convertFromExcelType(cell.getNumericCellValue(), cell, this.expectedColumnTypes[i])); break; case Cell.CELL_TYPE_STRING: output.add(convertFromExcelType(cell.getStringCellValue(), this.expectedColumnTypes[i])); break; case Cell.CELL_TYPE_BOOLEAN: output.add(convertFromExcelType(cell.getBooleanCellValue(), this.expectedColumnTypes[i])); break; default: output.add(null); break; } } return output; }

Target:
List<Object> projectRow(Row row) throws TranslatorException { ArrayList<Object> output = new ArrayList<Object>(this.visitor.getProjectedColumns().size()); int id = row.getRowNum()+1; int i = -1; for (int index:this.visitor.getProjectedColumns()) { i++; if (index == -1) { output.add(id); continue; } Cell cell = row.getCell(index-1, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL); if (cell == null) { output.add(null); continue; } switch (this.evaluator.evaluateInCell(cell).getCellType()) { case Cell.CELL_TYPE_NUMERIC: output.add(convertFromExcelType(cell.getNumericCellValue(), cell, this.expectedColumnTypes[i])); break; case Cell.CELL_TYPE_STRING: output.add(convertFromExcelType(cell.getStringCellValue(), this.expectedColumnTypes[i])); break; case Cell.CELL_TYPE_BOOLEAN: output.add(convertFromExcelType(cell.getBooleanCellValue(), this.expectedColumnTypes[i])); break; default: output.add(null); break; } } return output; }
Source:
private void loadVitalsFromServer() { if (NetworkUtils.isOnline()) { new VisitApi().syncLastVitals(mPatient.getUuid(), new DefaultResponseCallbackListener() { @Override public void onResponse() { loadVitalsFromDB(); } @Override public void onErrorResponse() { } }); } }

Target:
private void loadVitalsFromServer() { if (NetworkUtils.isOnline()) { new VisitApi().syncLastVitals(mPatient.getUuid(), new DefaultResponseCallbackListener() { @Override public void onResponse() { loadVitalsFromDB(); } @Override public void onErrorResponse(String errorMessage) { mPatientVitalsView.showErrorToast(errorMessage); } }); } }
Source:
public RadioGroup getView() { return (RadioGroup) super.getView(); }

Target:
public TimePicker getView() { return (TimePicker) super.getView(); }
Source:
public LogReplicationSourceManager(LogReplicationRuntimeParameters params, LogReplicationMetadataManager metadataManager, DataSender dataSender) { this.runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .trustStore(params.getTrustStore()) .tsPasswordFile(params.getTsPasswordFile()) .keyStore(params.getKeyStore()) .ksPasswordFile(params.getKsPasswordFile()) .tlsEnabled(params.isTlsEnabled()).build()); runtime.parseConfigurationString(params.getLocalCorfuEndpoint()).connect(); this.parameters = params; this.config = parameters.getReplicationConfig(); if (config.getStreamsToReplicate() == null || config.getStreamsToReplicate().isEmpty()) { throw new IllegalArgumentException("Invalid Log Replication: Streams to replicate is EMPTY"); } ExecutorService logReplicationFSMWorkers = Executors.newFixedThreadPool(DEFAULT_FSM_WORKER_THREADS, new ThreadFactoryBuilder().setNameFormat("state-machine-worker").build()); ReadProcessor readProcessor = new DefaultReadProcessor(runtime); this.logReplicationFSM = new LogReplicationFSM(this.runtime, config, params.getRemoteClusterDescriptor(), dataSender, readProcessor, logReplicationFSMWorkers); this.logReplicationFSM.setTopologyConfigId(params.getTopologyConfigId()); this.metadataManager = metadataManager; lastAckedTsPoller = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder().setNameFormat("Last Ackd Ts Reader").build()); lastAckedTsPoller.scheduleWithFixedDelay(new TsPollingTask(), 0, ACKED_TS_READ_INTERVAL_SECONDS, TimeUnit.SECONDS); }

Target:
public LogReplicationSourceManager(LogReplicationRuntimeParameters params, LogReplicationMetadataManager metadataManager, DataSender dataSender) { this.runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .trustStore(params.getTrustStore()) .tsPasswordFile(params.getTsPasswordFile()) .keyStore(params.getKeyStore()) .ksPasswordFile(params.getKsPasswordFile()) .tlsEnabled(params.isTlsEnabled()).build()); runtime.parseConfigurationString(params.getLocalCorfuEndpoint()).connect(); this.parameters = params; this.config = parameters.getReplicationConfig(); if (config.getStreamsToReplicate() == null || config.getStreamsToReplicate().isEmpty()) { throw new IllegalArgumentException("Invalid Log Replication: Streams to replicate is EMPTY"); } ExecutorService logReplicationFSMWorkers = Executors.newFixedThreadPool(DEFAULT_FSM_WORKER_THREADS, new ThreadFactoryBuilder().setNameFormat("state-machine-worker").build()); ReadProcessor readProcessor = new DefaultReadProcessor(runtime); this.metadataManager = metadataManager; ackReader = new LogReplicationAckReader(this.metadataManager, config, runtime, params.getRemoteClusterDescriptor().getClusterId()); this.logReplicationFSM = new LogReplicationFSM(this.runtime, config, params.getRemoteClusterDescriptor(), dataSender, readProcessor, logReplicationFSMWorkers, ackReader); this.logReplicationFSM.setTopologyConfigId(params.getTopologyConfigId()); }
Source:
public void getTemplateContent_localFileTemplateExists_useLocalFileContent() { LitTemplateParser instance = LitTemplateParserImpl.getInstance(); TemplateData templateContent = instance.getTemplateContent( MyLitElementView.class, "my-lit-element-view", service); Assert.assertEquals("Parent element ID not the expected one.", "my-lit-element-view", templateContent.getTemplateElement().parent().id()); Assert.assertEquals("Expected template element to have 3 children", 3, templateContent.getTemplateElement().childNodeSize()); Assert.assertEquals( "Template element should have contained a div element with the id 'test'", "div", templateContent.getTemplateElement() .getElementById("label").tag().toString()); }

Target:
public void getTemplateContent_localFileTemplateExists_useLocalFileContent() { LitTemplateParser instance = LitTemplateParserImpl.getInstance(); TemplateData templateContent = instance.getTemplateContent( MyLitElementView.class, "my-lit-element-view", service); Assert.assertEquals("Parent element ID not the expected one.", "my-lit-element-view", templateContent.getTemplateElement().parent().id()); Assert.assertEquals("Expected template element to have 3 children", 3, templateContent.getTemplateElement().childNodeSize()); Assert.assertEquals( "Template element should have contained a div element with the id 'label'", "div", templateContent.getTemplateElement() .getElementById("label").tag().toString()); }
Source:
public static void computeXTextSize(XText xText) { if (Widgets.isAccessible(xText.getStyledText())) { int lineCount = xText.getStyledText().getLineCount(); int lineLimit = Integer.valueOf(OseeInfo.getValue(ATTR_FORM_PART_LINE_LIMIT)); lineCount = lineCount > lineLimit ? lineLimit : lineCount; int height = lineCount * xText.getStyledText().getLineHeight(); GridData formTextGd = new GridData(SWT.FILL, SWT.FILL, true, true); if (xText.isFillVertically() && height < 60) { formTextGd.heightHint = 60; } else { formTextGd.heightHint = height; } formTextGd.widthHint = 200; xText.getStyledText().setLayoutData(formTextGd); } }

Target:
public static void computeXTextSize(XText xText) { if (Widgets.isAccessible(xText.getStyledText())) { int lineCount = xText.getStyledText().getLineCount(); int lineLimit = Integer.valueOf(OseeInfo.getCachedValue(ATTR_FORM_PART_LINE_LIMIT)); lineCount = lineCount > lineLimit ? lineLimit : lineCount; int height = lineCount * xText.getStyledText().getLineHeight(); GridData formTextGd = new GridData(SWT.FILL, SWT.FILL, true, true); if (xText.isFillVertically() && height < 60) { formTextGd.heightHint = 60; } else { formTextGd.heightHint = height; } formTextGd.widthHint = 200; xText.getStyledText().setLayoutData(formTextGd); } }
Source:
private static boolean inSameSubtree(long bitsA, long bitsB, int level) { return (bitsA >>> level) == (bitsB >>> level) || level == MAX_BITS; }

Target:
private static boolean inSameSubtree(long bitsA, long bitsB, int level) { return level == MAX_BITS || (bitsA >>> level) == (bitsB >>> level); }
Source:
public Date getStartTime() { return Date.from(zonedStartTime.toInstant()); }

Target:
public ZonedDateTime getStartTime() { return startTime; }
Source:
private void generateFollowMethod() { javaBuffer.addImport("org.ovirt.engine.api.model.ActionableResource"); javaBuffer.addLine("default public void follow (ActionableResource entity) {"); javaBuffer.addLine("}"); javaBuffer.addLine(""); }

Target:
private void generateFollowMethod() { javaBuffer.addImport(javaPackages.getXjcPackageName(), "ActionableResource"); javaBuffer.addLine("default public void follow (ActionableResource entity) {"); javaBuffer.addLine("}"); javaBuffer.addLine(); }
Source:
public List<Drug> getDrugsByMapping(String code, ConceptSource conceptSource, Collection<ConceptMapType> withAnyOfTheseTypes, boolean includeRetired) throws DAOException { Criteria searchCriteria = sessionFactory.getCurrentSession().createCriteria(DrugReferenceMap.class); searchCriteria.setProjection(Projections.property("drug")); searchCriteria.createAlias("conceptReferenceTerm", "term"); searchCriteria.add(Restrictions.eq("term.code", code)); searchCriteria.createAlias("term.conceptSource", "source"); searchCriteria.add(Restrictions.or(Restrictions.eq("source.name", conceptSource.getName()), Restrictions.eq("source.hl7Code", conceptSource.getHl7Code()))); for(ConceptMapType conceptMapType : withAnyOfTheseTypes) { if(conceptMapType != null) { searchCriteria.add(Restrictions.eq("conceptMapType", conceptMapType)); break; } } searchCriteria.createAlias("drug", "drug"); if (!includeRetired) { searchCriteria.add(Restrictions.eq("drug.retired", false)); } return (List<Drug>) searchCriteria.list(); }

Target:
public List<Drug> getDrugsByMapping(String code, ConceptSource conceptSource, Collection<ConceptMapType> withAnyOfTheseTypes, boolean includeRetired) throws DAOException { Criteria criteria = createSearchDrugByMappingCriteria(code,conceptSource,includeRetired); if(withAnyOfTheseTypes !=null) { criteria.add(Restrictions.in("map.conceptMapType", withAnyOfTheseTypes)); } return (List<Drug>) criteria.list(); }
Source:
public ContentValues mapToContentValues(@NonNull BoxedTypesMethodsConstructorIgnoreNull object) { ContentValues contentValues = new ContentValues(6); if (object.getFloatField() != null) { contentValues.put("floatField", object.getFloatField()); } if (object.getLongField() != null) { contentValues.put("longField", object.getLongField()); } if (object.getDoubleField() != null) { contentValues.put("doubleField", object.getDoubleField()); } if (object.isBooleanField() != null) { contentValues.put("booleanField", object.isBooleanField()); } if (object.getIntField() != null) { contentValues.put("intField", object.getIntField()); } if (object.getShortField() != null) { contentValues.put("shortField", object.getShortField()); } return contentValues; }

Target:
public ContentValues mapToContentValues(@NonNull BoxedTypesMethodsConstructorIgnoreNull object) { ContentValues contentValues = new ContentValues(6); if (object.getField1() != null) { contentValues.put("field1", object.getField1()); } if (object.getField6() != null) { contentValues.put("field6", object.getField6()); } if (object.getField3() != null) { contentValues.put("field3", object.getField3()); } if (object.getField2() != null) { contentValues.put("field2", object.getField2()); } if (object.getField5() != null) { contentValues.put("field5", object.getField5()); } if (object.getField4() != null) { contentValues.put("field4", object.getField4()); } return contentValues; }
Source:
public String getModerationHintButtonText() { WebElement moderatorionHintButton = browser.driver.findElement(By.id("moderationHintButton")); return moderatorionHintButton.getText(); }

Target:
public String getModerationHintButtonText() { WebElement moderationHintButton = browser.driver.findElement(By.id("moderationHintButton")); return moderationHintButton.getText(); }
Source:
private boolean needBootstrapAcidTablesDuringIncrementalDump() { return (work.oldReplScope != null) || conf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES); }

Target:
private boolean needBootstrapAcidTablesDuringIncrementalDump() { return (ReplUtils.includeAcidTableInDump(conf) && ((work.oldReplScope != null) || conf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES))); }
Source:
private URIish redirect(String location, String checkFor, int redirects) throws TransportException { if (location == null || location.isEmpty()) { throw new TransportException(MessageFormat.format( JGitText.get().redirectLocationMissing, uri, baseUrl)); } if (redirects >= http.maxRedirects) { throw new TransportException(MessageFormat.format( JGitText.get().redirectLimitExceeded, uri, Integer.valueOf(http.maxRedirects), baseUrl, location)); } try { if (!isValidRedirect(baseUrl, location, checkFor)) { throw new TransportException( MessageFormat.format(JGitText.get().redirectBlocked, uri, baseUrl, location)); } location = location.substring(0, location.indexOf(checkFor)); URIish result = new URIish(location); LOG.info(MessageFormat.format(JGitText.get().redirectHttp, uri, Integer.valueOf(redirects), baseUrl, result)); return result; } catch (URISyntaxException e) { throw new TransportException(MessageFormat.format( JGitText.get().invalidRedirectLocation, uri, baseUrl, location), e); } }

Target:
private URIish redirect(String location, String checkFor, int redirects) throws TransportException { if (location == null || location.isEmpty()) { throw new TransportException(MessageFormat.format( JGitText.get().redirectLocationMissing, uri, baseUrl)); } if (redirects >= http.maxRedirects) { throw new TransportException(MessageFormat.format( JGitText.get().redirectLimitExceeded, uri, Integer.valueOf(http.maxRedirects), baseUrl, location)); } try { if (!isValidRedirect(baseUrl, location, checkFor)) { throw new TransportException( MessageFormat.format(JGitText.get().redirectBlocked, uri, baseUrl, location)); } location = location.substring(0, location.indexOf(checkFor)); URIish result = new URIish(location); if (LOG.isInfoEnabled()) { LOG.info(MessageFormat.format(JGitText.get().redirectHttp, uri, Integer.valueOf(redirects), baseUrl, result)); } return result; } catch (URISyntaxException e) { throw new TransportException(MessageFormat.format( JGitText.get().invalidRedirectLocation, uri, baseUrl, location), e); } }
Source:
public void onEvent(Event e) { try { Map<Type, TopicPublisher> m = this.producerMap.get(e.getTarget()); if (m != null) { TopicPublisher tp = m.get(e.getType()); if (tp != null) { log.debug("Sending event to tp"); tp.send(session.createTextMessage(this.apply(e))); } else { log.warn("TopicPublisher is NULL!"); } } } catch (JMSException ex) { log.warn("Unable to send event :" + e + " via AMQPBus", ex); } catch (JsonProcessingException jpe) { log.warn("Unable to send event :" + jpe + " via AMQPBus", jpe); } }

Target:
public void onEvent(Event e) { try { Map<Type, TopicPublisher> m = this.producerMap.get(e.getTarget()); if (m != null) { TopicPublisher tp = m.get(e.getType()); if (tp != null) { log.debug("Sending event to tp"); tp.send(session.createTextMessage(this.apply(e))); } else { log.warn("TopicPublisher is NULL!"); } } } catch (JMSException ex) { log.warn("Unable to send event :" + e + " via AMQPBus", ex); } catch (JsonProcessingException jpe) { log.warn("Unable to send event :" + e + " via AMQPBus", jpe); } }
Source:
private int indexOfVersionForDate(final Date date) { for (int i = versions.size() - 1; i >= 0; i--) { final StaticCatalog c = versions.get(i); if (c.getEffectiveDate().getTime() <= date.getTime()) { return i; } } if (!versions.isEmpty()) { return 0; } throw new IllegalStateException("No existing versions in the VersionedCatalog catalog ??"); }

Target:
private int indexOfVersionForDate(final Date date) { for (int i = versions.size() - 1; i >= 0; i--) { final StaticCatalog c = versions.get(i); if (c.getEffectiveDate().getTime() <= date.getTime()) { return i; } } if (!versions.isEmpty()) { return 0; } throw new IllegalStateException(String.format("No existing versions in the VersionedCatalog catalog for input date %s", date)); }
Source:
public boolean onRestart(Scheduler.RestartTopologyRequest request) { return false; }

Target:
public boolean onRestart(Scheduler.RestartTopologyRequest request) { int appId = request.getContainerIndex(); return controller.restartApp(appId); }
Source:
protected void post2(BuildListener listener) throws Exception { if(getResult()== Result.SUCCESS) getStatus().onSuccessfulPromotion(Promotion.this); getTarget().save(); if (getResult() == Result.SUCCESS) { PromotedBuildAction pba = getTarget().getAction(PromotedBuildAction.class); for (PromotionProcess pp : pba.getPendingPromotions()) { pp.considerPromotion2(getTarget()); } Jenkins jenkins = Jenkins.getInstance(); if(jenkins != null){ for (AbstractProject<?,?> p : jenkins.getAllItems(AbstractProject.class)) { PromotionTrigger pt = p.getTrigger(PromotionTrigger.class); if (pt!=null) pt.consider(Promotion.this); } } } }

Target:
protected void post2(BuildListener listener) throws Exception { if(getResult()== Result.SUCCESS) getStatus().onSuccessfulPromotion(Promotion.this); getTarget().save(); if (getResult() == Result.SUCCESS) { PromotedBuildAction pba = getTarget().getAction(PromotedBuildAction.class); for (PromotionProcess pp : pba.getPendingPromotions()) { pp.considerPromotion2(getTarget()); } for (AbstractProject<?,?> p : Jenkins.getInstance().getAllItems(AbstractProject.class)) { PromotionTrigger pt = p.getTrigger(PromotionTrigger.class); if (pt!=null) pt.consider(Promotion.this); } } }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( methodValidationConfiguration == null ) ? 0 : methodValidationConfiguration.hashCode() ); result = prime * result + ( ( parameterNameProvider == null ) ? 0 : parameterNameProvider.hashCode() ); result = prime * result + ( ( valueExtractorManager == null ) ? 0 : valueExtractorManager.hashCode() ); return result; }

Target:
public int hashCode() { return hashCode; }
Source:
public Set<FrameworkField> getAnnotatedFields() { return createTreeSetWithMapValues(fFieldsForAnnotations, FIELD_COMPARATOR); }

Target:
public List<FrameworkField> getAnnotatedFields() { return collectValues(fFieldsForAnnotations); }
Source:
public List<BibEntry> performSearch(String query) throws FetcherException { TreeSet<String> plainReferences = new TreeSet<>(); String[] plainReferencesArray = query.split(";;"); for (int i = 0; i < plainReferencesArray.length; i++) { plainReferences.add(plainReferencesArray[i].trim()); } plainReferences.remove(""); if (plainReferences.size() == 0) { throw new FetcherException("Your entered References are empty."); } else { ArrayList<BibEntry> resultsList = new ArrayList<>(); for (String reference: plainReferences) { parseBibToBibEntry(parseUsingGrobid(reference)).ifPresentOrElse(resultsList::add, () -> failedEntries.add(reference)); } return resultsList; } }

Target:
public List<BibEntry> performSearch(String query) { List<String> plainReferences = Arrays.stream( query.split( "\\r\\r+|\\n\\n+|\\r\\n(\\r\\n)+" ) ) .map(String::trim) .filter(str -> !str.isBlank()) .collect(Collectors.toCollection(ArrayList::new)); if (plainReferences.isEmpty()) { return Collections.emptyList(); } else { return plainReferences.stream() .map(reference -> parseBibToBibEntry(parseUsingGrobid(reference))) .flatMap(Optional::stream) .collect(Collectors.toList()); } }
Source:
private static void appendTime(StringBuilder sb, int hours, int minutes, int seconds, int nanos) { sb.append(NUMBERS[hours]); sb.append(':'); sb.append(NUMBERS[minutes]); sb.append(':'); sb.append(NUMBERS[seconds]); int microseconds = (int) Math.round(nanos / 1000.0); if (microseconds == 0) { return; } sb.append('.'); int len = sb.length(); sb.append(microseconds); int needZeros = 6 - (sb.length() - len); if (needZeros > 0) { sb.insert(len, ZEROS, 0, needZeros); } int end = sb.length() - 1; while (sb.charAt(end) == '0') { sb.deleteCharAt(end); end--; } }

Target:
private static void appendTime(StringBuilder sb, int hours, int minutes, int seconds, int nanos) { sb.append(NUMBERS[hours]); sb.append(':'); sb.append(NUMBERS[minutes]); sb.append(':'); sb.append(NUMBERS[seconds]); int microseconds = (nanos / 1000) + (((nanos % 1000) + 500) / 1000); if (microseconds == 0) { return; } sb.append('.'); int len = sb.length(); sb.append(microseconds); int needZeros = 6 - (sb.length() - len); if (needZeros > 0) { sb.insert(len, ZEROS, 0, needZeros); } int end = sb.length() - 1; while (sb.charAt(end) == '0') { sb.deleteCharAt(end); end--; } }
Source:
public int presentAsFile(final File file, final CertifiedProductDownloadResponse cpList) { try { Writer writer = null; XMLStreamWriter streamWriter = null; try { XMLOutputFactory factory = XMLOutputFactory.newInstance(); writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); streamWriter = new IndentingXMLStreamWriter(factory.createXMLStreamWriter(writer)); streamWriter.writeStartDocument("UTF-8", "1.0"); streamWriter.writeStartElement("ns2:results"); streamWriter.writeNamespace("ns2", "<LINK_0>"); CertifiedProductSearchDetailsXmlGenerator.add(cpList.getListings(), "listings", streamWriter); streamWriter.writeEndElement(); streamWriter.writeEndDocument(); } catch(Exception e) { e.printStackTrace(); LOGGER.error(e); } finally { if (streamWriter != null) { streamWriter.close(); } if (writer != null) { writer.close(); } } } catch (Exception e) { LOGGER.error("Error while writing XML file.", e); } return cpList.getListings().size(); }

Target:
public int presentAsFile(final File file, final CertifiedProductDownloadResponse cpList) { try { Writer writer = null; XMLStreamWriter streamWriter = null; try { XMLOutputFactory factory = XMLOutputFactory.newInstance(); writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); streamWriter = factory.createXMLStreamWriter(writer); streamWriter.writeStartDocument("UTF-8", "1.0"); streamWriter.writeStartElement("ns2:results"); streamWriter.writeNamespace("ns2", "<LINK_0>"); CertifiedProductSearchDetailsXmlGenerator.add(cpList.getListings(), "listings", streamWriter); streamWriter.writeEndElement(); streamWriter.writeEndDocument(); } catch(Exception e) { e.printStackTrace(); LOGGER.error(e); } finally { if (streamWriter != null) { streamWriter.close(); } if (writer != null) { writer.close(); } } } catch (Exception e) { LOGGER.error("Error while writing XML file.", e); } return cpList.getListings().size(); }
Source:
public CostaRicaProviderLiveTest() { super(new CostaRicaProvider(secretProperty("navitia.authorization"))); }

Target:
public CostaRicaProviderLiveTest() { super(new CostaRicaProvider(null)); }
Source:
public Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(buildMetricName("numDatastreamTasks"), _numDatastreamTasks); metrics.putAll(MysqlBinlogEventListener.getMetrics()); metrics.putAll(MysqlSourceBinlogRowEventFilter.getMetrics()); return Collections.unmodifiableMap(metrics); }

Target:
public Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(buildMetricName("numDatastreamTasks"), _numDatastreamTasks); Optional.of(MysqlBinlogEventListener.getMetrics()).ifPresent(metrics::putAll); Optional.of(MysqlSourceBinlogRowEventFilter.getMetrics()).ifPresent(metrics::putAll); return Collections.unmodifiableMap(metrics); }
Source:
public void initMethod() { session.execute("TRUNCATE tenants"); session.execute("TRUNCATE data"); session.execute(String.format("TRUNCATE %s", DataAccessImpl.OUT_OF_ORDER_TABLE_NAME)); session.execute("TRUNCATE data_compressed"); session.execute("TRUNCATE metrics_idx"); session.execute("TRUNCATE retentions_idx"); session.execute("TRUNCATE metrics_tags_idx"); session.execute("TRUNCATE leases"); for (TableMetadata tableMetadata : session.getCluster().getMetadata().getKeyspace(session.getLoggedKeyspace()) .getTables()) { if(tableMetadata.getName().startsWith(DataAccessImpl.TEMP_TABLE_NAME_PROTOTYPE)) { try { session.execute(String.format("TRUNCATE %s", tableMetadata.getName())); } catch (Exception e) { } } } NumericDataPointCollector.createPercentile = defaultCreatePercentile; }

Target:
public void initMethod() { session.execute("TRUNCATE tenants"); session.execute("TRUNCATE data"); session.execute(String.format("TRUNCATE %s", DataAccessImpl.OUT_OF_ORDER_TABLE_NAME)); session.execute("TRUNCATE data_compressed"); session.execute("TRUNCATE metrics_idx"); session.execute("TRUNCATE retentions_idx"); session.execute("TRUNCATE metrics_tags_idx"); session.execute("TRUNCATE leases"); for (TableMetadata tableMetadata : session.getCluster().getMetadata().getKeyspace(session.getLoggedKeyspace()) .getTables()) { if(tableMetadata.getName().startsWith(DataAccessImpl.TEMP_TABLE_NAME_PROTOTYPE)) { session.execute(String.format("TRUNCATE %s", tableMetadata.getName())); } } NumericDataPointCollector.createPercentile = defaultCreatePercentile; }
Source:
public void readData(ObjectDataInput in) throws IOException { key = IOUtil.readObject(in); value = IOUtil.readObject(in); creationTime = in.readLong(); hits = in.readLong(); lastAccessTime = in.readLong(); lastUpdateTime = in.readLong(); ttl = in.readLong(); maxIdle = in.readLong(); }

Target:
public void readData(ObjectDataInput in) throws IOException { key = IOUtil.readObject(in); value = IOUtil.readObject(in); creationTime = in.readLong(); hits = in.readLong(); lastAccessTime = in.readLong(); lastUpdateTime = in.readLong(); ttl = in.readLong(); if (in.getVersion().isGreaterOrEqual(V3_11)) { maxIdle = in.readLong(); } }
Source:
private DataTypeHelper() { }

Target:
private DataTypeHelper() { throw new IllegalAccessError(); }
Source:
private SortedMap<byte[], RowResult<byte[]>> filterRowResults(TableReference tableRef, Map<Cell, Value> rawResults, ImmutableMap.Builder<Cell, byte[]> result) { getWithPostFiltering(tableRef, rawResults, result, Value.GET_VALUE); Map<Cell, byte[]> withDeletedValues = result.build(); Map<Cell, byte[]> filterDeletedValues = Maps.filterValues(result.build(), Predicates.not(Value.IS_EMPTY)); getMeter(AtlasDbMetricNames.CellFilterMetrics.EMPTY_VALUE, tableRef) .mark(withDeletedValues.size() - filterDeletedValues.size()); return RowResults.viewOfSortedMap(Cells.breakCellsUpByRow(filterDeletedValues)); }

Target:
private SortedMap<byte[], RowResult<byte[]>> filterRowResults(TableReference tableRef, Map<Cell, Value> rawResults, ImmutableMap.Builder<Cell, byte[]> result) { getWithPostFiltering(tableRef, rawResults, result, Value.GET_VALUE); Map<Cell, byte[]> filterDeletedValues = removeEmptyColumns(result.build(), tableRef); return RowResults.viewOfSortedMap(Cells.breakCellsUpByRow(filterDeletedValues)); }
Source:
public void init() { criteriaNoQuerySize = Integer.valueOf(properties.getProperty(CRITERIA_NO_QUERY_SIZE, CRITERIA_NO_QUERY_SIZE_ENV, CRITERIA_NO_QUERY_SIZE_DEFAULT)); batchSize = Integer.valueOf(properties.getProperty(BATCH_SIZE, BATCH_SIZE_ENV, BATCH_SIZE_DEFAULT)); String propTypeValue = properties.getProperty(BATCH_TYPE, BATCH_TYPE_ENV, BATCH_TYPE_DEFAULT); switch (propTypeValue) { case "LOGGED": batchType = BatchStatement.Type.LOGGED; break; case "COUNTER": batchType = BatchStatement.Type.COUNTER; break; default: batchType = BatchStatement.Type.UNLOGGED; } }

Target:
public void init() { criteriaNoQuerySize = Integer.valueOf(properties.getProperty(CRITERIA_NO_QUERY_SIZE, CRITERIA_NO_QUERY_SIZE_ENV, CRITERIA_NO_QUERY_SIZE_DEFAULT)); batchSize = Integer.valueOf(properties.getProperty(BATCH_SIZE, BATCH_SIZE_ENV, BATCH_SIZE_DEFAULT)); }
Source:
private SlaOption parseSlaSetting(final String set, String flowName, List<String> emails) throws ScheduleManagerException { logger.info("Trying to set sla with the following set: " + set); final String[] parts = set.split(",", -1); final String id = parts[0]; final String rule = parts[1]; final String duration = parts[2]; final String emailAction = parts[3]; final String killAction = parts[4]; SlaType type; if (id.length() == 0) { if (rule.equals(SLA_STATUS_SUCCESS)) { type = SlaType.FLOW_SUCCEED; } else { type = SlaType.FLOW_FINISH; } } else { if (rule.equals(SLA_STATUS_SUCCESS)) { type = SlaType.JOB_SUCCEED; } else { type = SlaType.JOB_FINISH; } } HashSet<SlaAction> actions = new HashSet<>(); if (emailAction.equals("true")) { actions.add(SlaAction.ALERT); } if (killAction.equals("true")) { actions.add(SlaAction.KILL); } final Duration dur; try { dur = parseDuration(duration); } catch (final Exception e) { throw new ScheduleManagerException( "Unable to parse duration for a SLA that needs to take actions!", e); } if (actions.size() == 0) { throw new ScheduleManagerException("Unable to create SLA as there is no action set"); } logger.info("Parsing sla as id:" + id + " type:" + type + " sla:" + rule + " Duration:" + duration + " actions:" + actions); return new SlaOptionBuilder(type, flowName, dur).setJobName(id).setActions(actions) .setEmails(emails).createSlaOption(); }

Target:
private SlaOption parseSlaSetting(final String set, String flowName, List<String> emails) throws ScheduleManagerException { logger.info("Trying to set sla with the following set: " + set); final String[] parts = set.split(",", -1); final String id = parts[0]; final String rule = parts[1]; final String duration = parts[2]; final String emailAction = parts[3]; final String killAction = parts[4]; SlaType type; if (id.length() == 0) { if (rule.equals(SLA_STATUS_SUCCESS)) { type = SlaType.FLOW_SUCCEED; } else { type = SlaType.FLOW_FINISH; } } else { if (rule.equals(SLA_STATUS_SUCCESS)) { type = SlaType.JOB_SUCCEED; } else { type = SlaType.JOB_FINISH; } } HashSet<SlaAction> actions = new HashSet<>(); if (emailAction.equals("true")) { actions.add(SlaAction.ALERT); } if (killAction.equals("true")) { actions.add(SlaAction.KILL); } final Duration dur; try { dur = parseDuration(duration); } catch (final Exception e) { throw new ScheduleManagerException( "Unable to parse duration for a SLA that needs to take actions!", e); } if (actions.isEmpty()) { throw new ScheduleManagerException("Unable to create SLA as there is no action set"); } logger.info("Parsing sla as id:" + id + " type:" + type + " sla:" + rule + " Duration:" + duration + " actions:" + actions); return new SlaOptionBuilder(type, flowName, dur).setJobName(id).setActions(actions) .setEmails(emails).createSlaOption(); }
Source:
public void setOnHeaderClickListener(OnHeaderClickListener listener) { mOnHeaderClickListener = listener; if (mAdapter != null) { if (mOnHeaderClickListener != null) { mAdapter.setOnHeaderClickListener(new AdapterWrapperHeaderClickHandler()); } else { mAdapter.setOnHeaderClickListener(null); } } if (mHeader != null && mOnHeaderClickListener != null) { mHeader.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mOnHeaderClickListener.onHeaderClick( StickyListHeadersListView.this, mHeader, mHeaderPosition, mHeaderId, true); } }); } }

Target:
public void setOnHeaderClickListener(OnHeaderClickListener listener) { mOnHeaderClickListener = listener; if (mAdapter != null) { if (mOnHeaderClickListener != null) { mAdapter.setOnHeaderClickListener(new AdapterWrapperHeaderClickHandler()); if (mHeader != null) { mHeader.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mOnHeaderClickListener.onHeaderClick( StickyListHeadersListView.this, mHeader, mHeaderPosition, mHeaderId, true); } }); } } else { mAdapter.setOnHeaderClickListener(null); } } }
Source:
public void init() { initState(); AsyncDataProvider.getRedirectServletReportsPage(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { setReportBaseUrl((String) returnValue); parseReportsXML(); } })); }

Target:
public void init() { initState(); setReportBaseUrl((String) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.RedirectServletReportsPage)); parseReportsXML(); }
Source:
public IMUAngularPositionMessage(double[][] rotMat) { this.timestamp = new Date().getTime(); this.rot = rotMat.clone(); this.IMU = 0; }

Target:
public IMUAngularPositionMessage(double[][] rotMat) { this.timestamp = new Date().getTime(); this.rot = rotMat.clone(); this.imuID = -1; }
Source:
public static com.couchbase.client.java.query.dsl.Sort[] createSort(Sort sort, CouchbaseConverter converter) { List<com.couchbase.client.java.query.dsl.Sort> cbSortList = new ArrayList<com.couchbase.client.java.query.dsl.Sort>(); for (Sort.Order order : sort) { String orderProperty = order.getProperty(); Expression orderFieldName = i(orderProperty); if (order.isIgnoreCase()) { orderFieldName = lower(orderFieldName); } if (order.isAscending()) { cbSortList.add(com.couchbase.client.java.query.dsl.Sort.asc(orderFieldName)); } else { cbSortList.add(com.couchbase.client.java.query.dsl.Sort.desc(orderFieldName)); } } return cbSortList.toArray(new com.couchbase.client.java.query.dsl.Sort[cbSortList.size()]); }

Target:
public static com.couchbase.client.java.query.dsl.Sort[] createSort(Sort sort, CouchbaseConverter converter) { List<com.couchbase.client.java.query.dsl.Sort> cbSortList = new ArrayList<com.couchbase.client.java.query.dsl.Sort>(); for (Sort.Order order : sort) { String orderProperty = order.getProperty(); Expression orderFieldName = i(orderProperty); if (order.isIgnoreCase()) { orderFieldName = lower(TypeFunctions.toString(orderFieldName)); } if (order.isAscending()) { cbSortList.add(com.couchbase.client.java.query.dsl.Sort.asc(orderFieldName)); } else { cbSortList.add(com.couchbase.client.java.query.dsl.Sort.desc(orderFieldName)); } } return cbSortList.toArray(new com.couchbase.client.java.query.dsl.Sort[cbSortList.size()]); }
Source:
private void setupHelixClusterConstraints() { String maxMessageLimit = _config.getString(CommonConstants.Helix.CONFIG_OF_HELIX_INSTANCE_MAX_MESSAGES, CommonConstants.Helix.DEFAULT_HELIX_INSTANCE_MAX_MESSAGES); Map<ClusterConstraints.ConstraintAttribute, String> constraintAttributes = Maps.newHashMap(); constraintAttributes.put(ClusterConstraints.ConstraintAttribute.INSTANCE, ".*"); constraintAttributes.put(ClusterConstraints.ConstraintAttribute.MESSAGE_TYPE, "STATE_TRANSITION"); ConstraintItem constraintItem = new ConstraintItem(constraintAttributes, maxMessageLimit); getHelixAdmin().setConstraint(_helixClusterName, ClusterConstraints.ConstraintType.MESSAGE_CONSTRAINT, MAX_MESSAGES_PER_INSTANCE_NAME, constraintItem); }

Target:
private void setupHelixClusterConstraints() { String maxStateTransitions = _config .getProperty(CommonConstants.Helix.CONFIG_OF_HELIX_INSTANCE_MAX_STATE_TRANSITIONS, CommonConstants.Helix.DEFAULT_HELIX_INSTANCE_MAX_STATE_TRANSITIONS); Map<ClusterConstraints.ConstraintAttribute, String> constraintAttributes = new HashMap<>(); constraintAttributes.put(ClusterConstraints.ConstraintAttribute.INSTANCE, ".*"); constraintAttributes .put(ClusterConstraints.ConstraintAttribute.MESSAGE_TYPE, Message.MessageType.STATE_TRANSITION.name()); ConstraintItem constraintItem = new ConstraintItem(constraintAttributes, maxStateTransitions); _helixControllerManager.getClusterManagmentTool() .setConstraint(_helixClusterName, ClusterConstraints.ConstraintType.MESSAGE_CONSTRAINT, MAX_STATE_TRANSITIONS_PER_INSTANCE, constraintItem); }
Source:
public void renderHtml(String htmlOutput) { if (StringUtil.isNullOrEmpty(htmlOutput)) return; final RenderTimer renderTimer = new RenderTimer(); presenter_.showCallbackHtml(htmlOutput); }

Target:
public void renderHtml(String htmlOutput) { if (StringUtil.isNullOrEmpty(htmlOutput)) return; presenter_.showCallbackHtml(htmlOutput); }