auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void setDefaultNetwork(Long accountId) { Account account = objectManager.loadResource(Account.class, accountId); if (account == null) { return; } Long defaultNetworkId = account.getDefaultNetworkId(); Long newDefaultNetworkId = null; for (Network network : networkDao.getActiveNetworks(account.getId())) { if (network.getKind().startsWith(NetworkConstants.PREFIX_KIND_DOCKER) || network.getKind().equals("hostOnlyNetwork")) { continue; } if (network.getId().equals(defaultNetworkId)) { newDefaultNetworkId = defaultNetworkId; break; } <START> if (CommonStatesConstants.ACTIVATING.equals(network.getState()) && newDefaultNetworkId == null) { <END> newDefaultNetworkId = network.getId(); } else if (CommonStatesConstants.UPDATING_ACTIVE.equals(network.getState()) && newDefaultNetworkId == null) { newDefaultNetworkId = network.getId(); } else if (CommonStatesConstants.ACTIVE.equals(network.getState())) { newDefaultNetworkId = network.getId(); } } if (!ObjectUtils.equals(defaultNetworkId, newDefaultNetworkId)) { objectManager.setFields(account, AccountConstants.FIELD_DEFAULT_NETWORK_ID, newDefaultNetworkId); } }</code><technical_language>lines 62 64 merged</technical_language>

Target:
protected void setDefaultNetwork(Long accountId) { Account account = objectManager.loadResource(Account.class, accountId); if (account == null) { return; } Long defaultNetworkId = account.getDefaultNetworkId(); Long newDefaultNetworkId = null; for (Network network : networkDao.getActiveNetworks(account.getId())) { if (network.getKind().startsWith(NetworkConstants.PREFIX_KIND_DOCKER) || network.getKind().equals("hostOnlyNetwork")) { continue; } if (network.getId().equals(defaultNetworkId)) { newDefaultNetworkId = defaultNetworkId; break; } if ((CommonStatesConstants.ACTIVATING.equals(network.getState()) || CommonStatesConstants.UPDATING_ACTIVE.equals(network.getState())) && newDefaultNetworkId == null) { newDefaultNetworkId = network.getId(); } else if (CommonStatesConstants.ACTIVE.equals(network.getState())) { newDefaultNetworkId = network.getId(); } } if (!ObjectUtils.equals(defaultNetworkId, newDefaultNetworkId)) { objectManager.setFields(account, AccountConstants.FIELD_DEFAULT_NETWORK_ID, newDefaultNetworkId); } }
Source:
<code>public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source) { <START> return source.getUserProvidedIdentifier() != null ? source.getUserProvidedIdentifier() : toIdentifier( <END> NamingHelper.INSTANCE.generateHashedFkName( "FK", source.getTableName(), source.getReferencedTableName(), source.getColumnNames() ), source.getBuildingContext() ); }</code><technical_language>Assign return of getUserProvidedIdentifier() a local variable, built twice</technical_language>

Target:
public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source) { Identifier userProvidedIdentifier = source.getUserProvidedIdentifier(); return userProvidedIdentifier != null ? userProvidedIdentifier : toIdentifier( NamingHelper.INSTANCE.generateHashedFkName( "FK", source.getTableName(), source.getReferencedTableName(), source.getColumnNames() ), source.getBuildingContext() ); }
Source:
<code>public void shouldNotifyEventWhenRemoveComment() { Comment comment = createComment(commentedDocumentModel); DocumentModel commentDocModel = session.getDocument(new IdRef(comment.getId())); <START> commentDocModel.detach(true); <END> transactionalFeature.nextTransaction(); try (CapturingEventListener listener = new CapturingEventListener(COMMENT_REMOVED)) { commentManager.deleteComment(session, comment.getId()); DocumentModel commentParentDocumentModel = session.getDocument( new IdRef((String) commentDocModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); Event expectedEvent = listener.streamCapturedEvents() .findFirst() .orElseThrow(() -> new AssertionError("Event wasn't fired")); checkDocumentEventContext(expectedEvent, commentDocModel, commentParentDocumentModel, commentedDocumentModel); } }</code><technical_language>detach done info retrieved deletion. I swapped retrieved info fine</technical_language>

Target:
public void shouldNotifyEventWhenRemoveComment() { Comment comment = createComment(commentedDocumentModel); transactionalFeature.nextTransaction(); try (CapturingEventListener listener = new CapturingEventListener(COMMENT_REMOVED)) { DocumentModel commentDocModel = session.getDocument(new IdRef(comment.getId())); commentManager.deleteComment(session, comment.getId()); transactionalFeature.nextTransaction(); DocumentModel commentParentDocumentModel = session.getDocument( new IdRef((String) commentDocModel.getPropertyValue(COMMENT_PARENT_ID))); Event expectedEvent = listener.streamCapturedEvents() .findFirst() .orElseThrow(() -> new AssertionError("Event wasn't fired")); checkDocumentEventContext(expectedEvent, commentDocModel, commentParentDocumentModel, commentedDocumentModel); } }
Source:
<code>public boolean isPotionApplicable(PotionEffect potioneffectIn) { if (potioneffectIn.getPotion() == MobEffects.POISON && getFaction().equals("lizardman|coven")) { <START> net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, potioneffectIn); <END> net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); return event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW; } return super.isPotionApplicable(potioneffectIn); }</code><technical_language>full package name for class is unnecessary, import class name is here, for EVENT_BUS call below</technical_language>

Target:
public boolean isPotionApplicable(PotionEffect potioneffectIn) { if (potioneffectIn.getPotion() == MobEffects.POISON && getFaction().equals("lizardman|coven")) { PotionEvent.PotionApplicableEvent event = new PotionEvent.PotionApplicableEvent(this, potioneffectIn); EVENT_BUS.post(event); return event.getResult() == ALLOW; } return super.isPotionApplicable(potioneffectIn); }
Source:
<code>public void silentlyMigrateConfigsTest() throws Exception { j.jenkins.save(); assertThat(j.jenkins.getLabelString(), is("I am a label")); <START> File configFile = new File(j.jenkins.getRootPath().getRemote() + File.separator + "config.xml"); <END> assertThat(configFile.exists(), is(true)); BufferedReader config = new BufferedReader(new FileReader(configFile)); assertThat(config.readLine(), is("<?xml version='1.1' encoding='UTF-8'?>")); config.close(); }</code><technical_language>NIT: File a constructor params for this kind of usage: java new File(j.jenkins.getRootDir(), "config.xml"); equivalent FWIW</technical_language>

Target:
public void silentlyMigrateConfigsTest() throws Exception { j.jenkins.save(); assertThat(j.jenkins.getLabelString(), is("I am a label")); File configFile = new File(j.jenkins.getRootDir(), "config.xml"); assertThat(configFile.exists(), is(true)); try (BufferedReader config = new BufferedReader(new FileReader(configFile))) { assertThat(config.readLine(), is("<?xml version='1.1' encoding='UTF-8'?>")); config.close(); } }
Source:
<code>public void onFailure(Exception e) { <START> Timber.d("Resources fetching failed. 1"); <END> }</code><technical_language>instead of numerics. cure string correct corresponds : Feeds in this case</technical_language>

Target:
public void onFailure(Exception e) { Timber.d("Resources fetching failed."); }
Source:
<code>public GroupByStrategy strategize(GroupByQuery query) { <START> final String strategyString = getStrategy(query); <END> switch (strategyString) { case STRATEGY_V2: return strategyV2; case STRATEGY_V1: return strategyV1; default: throw new ISE("No such strategy[%s]", strategyString); } }</code><technical_language>again, if is advantage in separating this a method</technical_language>

Target:
public GroupByStrategy strategize(GroupByQuery query) { final String strategyString = config.withOverrides(query).getDefaultStrategy(); switch (strategyString) { case STRATEGY_V2: return strategyV2; case STRATEGY_V1: return strategyV1; default: throw new ISE("No such strategy[%s]", strategyString); } }
Source:
<code>protected Integer calculateRecordsJSON(String jsonStr) { Integer rec; try { JSONObject j = new JSONObject(jsonStr); <START> try { <END> rec = j.getJSONArray("data").length(); } catch (JSONException e2) { rec = null; } } catch (JSONException e) { rec = null; } return rec; }</code><technical_language>need a separate try-catch block here. rec = j.getJSONArray("data").length(); try catch block itself</technical_language>

Target:
protected Integer calculateRecordsJSON(String jsonStr) { Integer rec; try { JSONObject j = new JSONObject(jsonStr); rec = j.getJSONArray("data").length(); } catch (JSONException e) { rec = null; } return rec; }
Source:
<code>protected void onError(HttpField field, Throwable t) { LOG.warn("Exception while processing {}", field, t); <START> throw new BadMessageException("Bad header value for " + field.getName()); <END> }</code><technical_language>add Throwable t of this exception</technical_language>

Target:
protected void onError(HttpField field, Throwable t) { throw new BadMessageException("Bad header value for " + field.getName(), t); }
Source:
<code>public static LoadBalancer getDefault(String urls) { String[] endpoints = new String[0]; if (urls != null) { <START> endpoints = urls.split("\\|"); <END> } return getDefault(Arrays.asList(endpoints)); }</code><technical_language>define delimiter char a constant prevent repetition (see forStrategy() method)</technical_language>

Target:
public static LoadBalancer getDefault(String urls) { String[] endpoints = new String[0]; if (urls != null) { endpoints = urls.split(URL_SEP); } return getDefault(Arrays.asList(endpoints)); }
Source:
<code>public MinMaxStats(@NonNull INDArray lower, @NonNull INDArray upper) { INDArray diff = upper.sub(lower); INDArray withEpsilon = Transforms.max(diff, Nd4j.EPS_THRESHOLD); <START> INDArray addedPadding = withEpsilon.sub(diff); <END> if (addedPadding.sumNumber().doubleValue() > 0) { logger.info("API_INFO: max val minus min val found to be zero. Transform will round up to epsilon to avoid nans."); upper.addi(addedPadding); } this.lower = lower; this.upper = upper; }</code><technical_language>This in place else</technical_language>

Target:
public MinMaxStats(@NonNull INDArray lower, @NonNull INDArray upper) { INDArray diff = upper.sub(lower); INDArray addedPadding = Transforms.max(diff, Nd4j.EPS_THRESHOLD).subi(diff); if (addedPadding.sumNumber().doubleValue() > 0) { logger.info("API_INFO: max val minus min val found to be zero. Transform will round up to epsilon to avoid nans."); upper.addi(addedPadding); } this.lower = lower; this.upper = upper; }
Source:
<code>private void launch() { if(zibaseListener!=null) { zibaseListener.shutdown(); } try { zibase = new Zibase(ip); logger.info("connected to zibase for command sending"); } catch(Throwable th) { logger.info("Error connecting to zibase using specified ip address"); } try { logger.info("Starting zibase listener thread..."); zibaseListener = new ZibaseListener(); zibaseListener.setZibase(zibase); zibaseListener.setEventPubisher(eventPublisher); zibaseListener.setListenerHost(listenerHost); <START> zibaseListener.setListenerPort(listenerPort); <END> zibaseListener.start(); } catch(Throwable th) { logger.info("Error connecting to zibase for listening"); } }</code><technical_language>setter implies (to me) values changed is surely case for Listener. constructor parameters create a Listener instance</technical_language>

Target:
private void launch() { if(zibaseListener!=null) { zibaseListener.shutdown(); } zibase = new Zibase(ip); logger.info("connected to zibase for command sending"); logger.info("Starting zibase listener thread..."); zibaseListener = new ZibaseListener(); zibaseListener.setZibase(zibase); zibaseListener.setEventPubisher(eventPublisher); zibaseListener.setListenerHost(listenerHost); zibaseListener.setListenerPort(listenerPort); zibaseListener.start(); }
Source:
<code>public Widget setHidden(boolean hidden) { this.hidden = hidden; if (content != null && content instanceof Form) { ((Form) content).setHidden(hidden); } else if (content != null && content instanceof Property) { Property prop = (Property) content; if (hidden) { prop.addFlag(Property.Flags.HIDDEN); } else { prop.removeFlag(Property.Flags.HIDDEN); } <START> } else if (content != null && content instanceof PropertiesImpl) { <END> Arrays.stream(content.getClass().getFields()).forEach(field -> { if (!field.isAccessible()) { field.setAccessible(true); } try { Object o = field.get(content); if (o instanceof Property) { if (hidden) { ((Property) o).addFlag(Property.Flags.HIDDEN); } else { ((Property) o).removeFlag(Property.Flags.HIDDEN); } } } catch (IllegalArgumentException | IllegalAccessException e) { } }); } return this; }</code><technical_language>check Properties type</technical_language>

Target:
public Widget setHidden(boolean hidden) { this.hidden = hidden; if (content == null) { return this; } if (content instanceof Form) { ((Form) content).setHidden(hidden); } else { setHiddenProperty(content, hidden); } return this; }
Source:
<code><START> public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern arg0) { <END> throw new UnsupportedOperationException("updateConfiguration"); }</code><technical_language>this method implementable</technical_language>

Target:
public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern arg0) { throw new UnsupportedOperationException("listSnapshots"); }
Source:
<code>private synchronized Map<String, String> scheduleTasks(List<String> tableNamesWithType, boolean isLeader) { _controllerMetrics.addMeteredGlobalValue(ControllerMeter.NUMBER_TIMES_SCHEDULE_TASKS_CALLED, 1L); Set<String> taskTypes = _taskGeneratorRegistry.getAllTaskTypes(); Map<String, List<TableConfig>> enabledTableConfigMap = new HashMap<>(); for (String tableNameWithType : tableNamesWithType) { TableConfig tableConfig = _pinotHelixResourceManager.getTableConfig(tableNameWithType); if (tableConfig != null && tableConfig.getTaskConfig() != null) { Set<String> enabledTaskTypes = tableConfig.getTaskConfig().getTaskTypeConfigsMap().keySet(); for (String enabledTaskType : enabledTaskTypes) { if (taskTypes.contains(enabledTaskType)) { enabledTableConfigMap.computeIfAbsent(enabledTaskType, k -> new ArrayList<>()).add(tableConfig); } else { <START> LOGGER.warn("Task type: is not registered, cannot enable it for table: {}", enabledTaskType, <END> tableNameWithType); } } } } Map<String, String> tasksScheduled = new HashMap<>(); for (Map.Entry<String, List<TableConfig>> entry : enabledTableConfigMap.entrySet()) { String taskType = entry.getKey(); _helixTaskResourceManager.ensureTaskQueueExists(taskType); String taskName = scheduleTask(_taskGeneratorRegistry.getTaskGenerator(taskType), entry.getValue(), isLeader); if (taskName != null) { tasksScheduled.put(taskType, taskName); } } return tasksScheduled; }</code><technical_language>Is return this info client-side? I feel this information is useful for users test debug</technical_language>

Target:
private synchronized Map<String, String> scheduleTasks(List<String> tableNamesWithType, boolean isLeader) { _controllerMetrics.addMeteredGlobalValue(ControllerMeter.NUMBER_TIMES_SCHEDULE_TASKS_CALLED, 1L); Map<String, List<TableConfig>> enabledTableConfigMap = new HashMap<>(); for (String tableNameWithType : tableNamesWithType) { TableConfig tableConfig = _pinotHelixResourceManager.getTableConfig(tableNameWithType); if (tableConfig != null && tableConfig.getTaskConfig() != null) { Set<String> enabledTaskTypes = tableConfig.getTaskConfig().getTaskTypeConfigsMap().keySet(); for (String enabledTaskType : enabledTaskTypes) { enabledTableConfigMap.computeIfAbsent(enabledTaskType, k -> new ArrayList<>()).add(tableConfig); } } } Map<String, String> tasksScheduled = new HashMap<>(); for (Map.Entry<String, List<TableConfig>> entry : enabledTableConfigMap.entrySet()) { String taskType = entry.getKey(); List<TableConfig> enabledTableConfigs = entry.getValue(); PinotTaskGenerator taskGenerator = _taskGeneratorRegistry.getTaskGenerator(taskType); if (taskGenerator != null) { _helixTaskResourceManager.ensureTaskQueueExists(taskType); tasksScheduled.put(taskType, scheduleTask(taskGenerator, enabledTableConfigs, isLeader)); } else { List<String> enabledTables = new ArrayList<>(enabledTableConfigs.size()); for (TableConfig enabledTableConfig : enabledTableConfigs) { enabledTables.add(enabledTableConfig.getTableName()); } LOGGER.warn("Task type: is not registered, cannot enable it for tables: {}", taskType, enabledTables); tasksScheduled.put(taskType, null); } } return tasksScheduled; }
Source:
<code>public void partitioned(Map<Integer, Partition<T>> partitions) { logger.debug("Partitioned Map: {}", partitions); partitionedInstanceStatus.clear(); for (Map.Entry<Integer, Partition<T>> entry : partitions.entrySet()) { if (partitionedInstanceStatus.containsKey(entry.getKey())) { logger.debug("entry: {}", entry); } else { partitionedInstanceStatus.put(entry.getKey(), null); <START> logger.debug("partitionedInstanceStatus: {}", partitionedInstanceStatus); <END> } } }</code><technical_language>please remove debug messages necessary</technical_language>

Target:
public void partitioned(Map<Integer, Partition<T>> partitions) { logger.debug("Partitioned Map: {}", partitions); partitionedInstanceStatus.clear(); for (Map.Entry<Integer, Partition<T>> entry : partitions.entrySet()) { if (partitionedInstanceStatus.containsKey(entry.getKey())) { } else { partitionedInstanceStatus.put(entry.getKey(), null); } } }
Source:
<code>public void registerTables() { tableEnv.executeSql("create table MyTable (a int, b bigint, c varchar(32)) " + <START> "with ('connector' = 'filesystem', 'path' = '/non')"); <END> tableEnv.executeSql("create table MyOtherTable (a int, b bigint) " + "with ('connector' = 'filesystem', 'path' = '/non')"); tableEnv.executeSql("create table MySink (a int, c varchar(32)) with ('connector' = 'COLLECTION' )"); }</code><technical_language>invoke registerTable(String createTableStmt) instead</technical_language>

Target:
public void registerTables() { registerTable("create table MyTable (a int, b bigint, c varchar(32)) " + "with ('connector' = 'filesystem', 'path' = '/non')"); registerTable("create table MyOtherTable (a int, b bigint) " + "with ('connector' = 'filesystem', 'path' = '/non')"); registerTable("create table MySink (a int, c varchar(32)) with ('connector' = 'COLLECTION' )"); }
Source:
<code>public boolean stop(long executionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException { JobExecution jobExecution = findExecutionById(executionId); BatchStatus status = jobExecution.getStatus(); if (!(status == BatchStatus.STARTED || status == BatchStatus.STARTING)) { throw new JobExecutionNotRunningException("JobExecution must be running so that it can be stopped: "+jobExecution); } jobExecution.setStatus(BatchStatus.STOPPING); jobRepository.update(jobExecution); Job job; try { job = jobRegistry.getJob(jobExecution.getJobInstance().getJobName()); if (job instanceof AbstractJob) { Collection<String> stepNames = ((AbstractJob)job).getStepNames(); for (String stepName : stepNames) { Step step = ((AbstractJob)job).getStep(stepName); if (step instanceof TaskletStep) { Tasklet tasklet = ((TaskletStep) step).getTasklet(); if (tasklet instanceof StoppableTasklet) { <START> ((StoppableTasklet)tasklet).stop(); <END> } } } } } catch (NoSuchJobException e) { logger.error("Couldn't find Job for the execution:" + jobExecution.getJobInstance().getJobName()); } return true; }</code><technical_language>here: 1. I need if is a get a handle steps. 2. calling StoppableTasklet#stop() a tasklet is running. If is not, unnecessary exceptions thrown</technical_language>

Target:
public boolean stop(long executionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException { JobExecution jobExecution = findExecutionById(executionId); BatchStatus status = jobExecution.getStatus(); if (!(status == BatchStatus.STARTED || status == BatchStatus.STARTING)) { throw new JobExecutionNotRunningException("JobExecution must be running so that it can be stopped: "+jobExecution); } jobExecution.setStatus(BatchStatus.STOPPING); jobRepository.update(jobExecution); try { Job job = jobRegistry.getJob(jobExecution.getJobInstance().getJobName()); if (job instanceof StepLocator) { for (StepExecution stepExecution : jobExecution.getStepExecutions()) { if (stepExecution.getStatus().isRunning()) { try { Step step = ((StepLocator)job).getStep(stepExecution.getStepName()); if (step instanceof TaskletStep) { Tasklet tasklet = ((TaskletStep)step).getTasklet(); if (tasklet instanceof StoppableTasklet) { ((StoppableTasklet)tasklet).stop(); } } } catch (NoSuchStepException e) { logger.warn("Step not found",e); } } } } } catch (NoSuchJobException e) { logger.warn("Cannot find Job object",e); } return true; }
Source:
<code>public void testMoveCostMultiplier() throws Exception { Configuration conf = HBaseConfiguration.create(); StochasticLoadBalancer.CostFunction costFunction = new StochasticLoadBalancer.MoveCostFunction(conf); BaseLoadBalancer.Cluster cluster = mockCluster(clusterStateMocks[0]); costFunction.init(cluster); costFunction.cost(); <START> assertEquals(7, costFunction.getMultiplier(), 0.01); <END> conf.setInt("hbase.offpeak.start.hour",0); conf.setInt("hbase.offpeak.end.hour",23); costFunction = new StochasticLoadBalancer.MoveCostFunction(conf); costFunction.init(cluster); costFunction.cost(); assertEquals(3, costFunction.getMultiplier(), 0.01); }</code><technical_language>if want replace 7 DEFAULT_MOVE_COST, currently is private...same DEFAULT_MOVE_COST_OFFPEAK</technical_language>

Target:
public void testMoveCostMultiplier() throws Exception { Configuration conf = HBaseConfiguration.create(); StochasticLoadBalancer.CostFunction costFunction = new StochasticLoadBalancer.MoveCostFunction(conf); BaseLoadBalancer.Cluster cluster = mockCluster(clusterStateMocks[0]); costFunction.init(cluster); costFunction.cost(); assertEquals(StochasticLoadBalancer.MoveCostFunction.DEFAULT_MOVE_COST, costFunction.getMultiplier(), 0.01); conf.setInt("hbase.offpeak.start.hour",0); conf.setInt("hbase.offpeak.end.hour",23); costFunction = new StochasticLoadBalancer.MoveCostFunction(conf); costFunction.init(cluster); costFunction.cost(); assertEquals(StochasticLoadBalancer.MoveCostFunction.DEFAULT_MOVE_COST_OFFPEAK , costFunction.getMultiplier(), 0.01); }
Source:
<code>public void when_resetIsCalled_expect_poolContentFlushed() { CircularFifoObservationPool sut = CircularFifoObservationPool.builder().build(); sut.add(Nd4j.create(new double[] { 0.0 })); sut.add(Nd4j.create(new double[] { 1.0 })); sut.add(Nd4j.create(new double[] { 2.0 })); sut.add(Nd4j.create(new double[] { 3.0 })); sut.add(Nd4j.create(new double[] { 4.0 })); sut.add(Nd4j.create(new double[] { 5.0 })); <START> sut.add(Nd4j.create(new double[] { 6.0 })); <END> sut.reset(); INDArray[] result = sut.get(); assertEquals(0, result.length); }</code><technical_language>verbose: Nd4j.createFromArray(0.0) varargs method. creates a rank 1 length 1 double array, create(double[])</technical_language>

Target:
public void when_resetIsCalled_expect_poolContentFlushed() { CircularFifoObservationPool sut = CircularFifoObservationPool.builder().build(); sut.add(Nd4j.createFromArray(0.0)); sut.add(Nd4j.createFromArray(1.0)); sut.add(Nd4j.createFromArray(2.0)); sut.add(Nd4j.createFromArray(3.0)); sut.add(Nd4j.createFromArray(4.0)); sut.add(Nd4j.createFromArray(5.0)); sut.add(Nd4j.createFromArray(6.0)); sut.reset(); INDArray[] result = sut.get(); assertEquals(0, result.length); }
Source:
<code>private void register() { registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectArenas"), (Gauge<Integer>) () -> getNumDirectArenas()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapArenas"), (Gauge<Integer>) () -> getNumHeapArenas()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberThreadLocalCaches"), (Gauge<Integer>) () -> getNumThreadLocalCaches()); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedHeapMemory"), (Gauge<Long>) () -> getUsedHeapMemory()); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedDirectMemory"), (Gauge<Long>) () -> getUsedDirectMemory()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalAlloocations"), (Gauge<Long>) () -> getNumHeapTotalAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalDealloocations"), (Gauge<Long>) () -> getNumHeapTotalDeallocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalActiveAlloocations"), (Gauge<Long>) () -> getNumHeapTotalActiveAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalAlloocations"), (Gauge<Long>) () -> getNumDirectTotalAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalDealloocations"), (Gauge<Long>) () -> getNumDirectTotalDeallocations()); <START> registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalActiveAlloocations"), <END> (Gauge<Long>) () -> getNumDirectTotalActiveAllocations()); }</code><technical_language>line 135 ~ 145, typos in "Allocations" spelling</technical_language>

Target:
private void register() { registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectArenas"), (Gauge<Integer>) this::getNumDirectArenas); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapArenas"), (Gauge<Integer>) this::getNumHeapArenas); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberThreadLocalCaches"), (Gauge<Integer>) this::getNumThreadLocalCaches); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedHeapMemory"), (Gauge<Long>) this::getUsedHeapMemory); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedDirectMemory"), (Gauge<Long>) this::getUsedDirectMemory); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalAllocations"), (Gauge<Long>) this::getNumHeapTotalAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalDeallocations"), (Gauge<Long>) this::getNumHeapTotalDeallocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalActiveAllocations"), (Gauge<Long>) this::getNumHeapTotalActiveAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalAllocations"), (Gauge<Long>) this::getNumDirectTotalAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalDeallocations"), (Gauge<Long>) this::getNumDirectTotalDeallocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalActiveAllocations"), (Gauge<Long>) this::getNumDirectTotalActiveAllocations); }
Source:
<code>private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Label lbl = p.getAssignedLabel(); <START> String fullDisplayName = p.task.getFullDisplayName(); <END> if (lbl != null && lbl.equals(h.getSelfLabel())) { if (h.canTake(p) == null) { return createFlyWeightTaskRunnable(p, fullDisplayName, h.toComputer()); } else { return null; } } Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); for (Node n : hash.list(fullDisplayName)) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } return createFlyWeightTaskRunnable(p, fullDisplayName, c); } } return null; }</code><technical_language><LINK_0> avoid calling getFullDisplayName logger Level.FINEST -- this method some unexpected overheads due Action evaluations</technical_language>

Target:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Label lbl = p.getAssignedLabel(); if (lbl != null && lbl.equals(h.getSelfLabel())) { if (h.canTake(p) == null) { return createFlyWeightTaskRunnable(p, h.toComputer()); } else { return null; } } Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); String fullDisplayName = p.task.getFullDisplayName(); for (Node n : hash.list(fullDisplayName)) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } return createFlyWeightTaskRunnable(p, c); } } return null; }
Source:
<code>public ProcessDefinition processDefinition(String processDefinitionId) { <START> org.activiti.engine.repository.ProcessDefinition processDefinition = null; <END> try { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } catch (Exception internalEx) { } if (processDefinition == null) { List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionId).list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { throw new NotFoundException("Unable to find process definition for the given key:'" + processDefinitionId + "'"); } } if (!securityPoliciesManager.canRead(processDefinition.getKey())) { throw new ActivitiObjectNotFoundException("Unable to find process definition for the given id:'" + processDefinitionId + "'"); } return processDefinitionConverter.from(processDefinition); }</code><technical_language>@erdemedeiros do mean? reduce it</technical_language>

Target:
public ProcessDefinition processDefinition(String processDefinitionId) { org.activiti.engine.repository.ProcessDefinition processDefinition; List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService .createProcessDefinitionQuery() .processDefinitionKey(processDefinitionId) .orderByProcessDefinitionVersion() .asc() .list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } if (!securityPoliciesManager.canRead(processDefinition.getKey())) { throw new ActivitiObjectNotFoundException("Unable to find process definition for the given id:'" + processDefinitionId + "'"); } return processDefinitionConverter.from(processDefinition); }
Source:
<code>public void setMinimum(final String minimum) { if (minimum == null) { this.minimum = null; <START> } else if (isPercent(minimum)) { <END> this.minimum = percentToBigDecimal(minimum); } else { this.minimum = new BigDecimal(minimum); } }</code><technical_language>parsing logic in setMinimum() setMaximum() in a common method</technical_language>

Target:
public void setMinimum(final String minimum) { this.minimum = parseValue(minimum); }
Source:
<code>private ClassData build(EntityDto entity, List<FieldDto> fields, EntityType type, Bundle bundle) { try { CtClass declaring = makeClass(entity, fields, type, bundle); switch (type) { case HISTORY: String className = type.getClassName(entity.getClassName()); String simpleName = ClassName.getSimpleName(className); TypeDto idType = TypeDto.LONG; addProperty( declaring, idType.getTypeClass(), simpleName + Constants.HistoryTrash.CURRENT_VERSION, null ); addProperty( declaring, Long.class.getName(), simpleName + Constants.HistoryTrash.SCHEMA_VERSION, null ); break; case TRASH: <START> addProperty(declaring, Long.class.getName(), Constants.HistoryTrash.SCHEMA_VERSION, null); <END> break; default: } return new ClassData( declaring.getName(), entity.getModule(), entity.getNamespace(), declaring.toBytecode(), type ); } catch (ReflectiveOperationException | CannotCompileException | IOException | NotFoundException e) { throw new EntityCreationException("Unable to create entity " + entity.getName(), e); } }</code><technical_language>Constants.Util.SCHEMA_VERSION_FIELD_NAME = "schemaVersion" Constants.HistoryTrash.SCHEMA_VERSION = "SchemaVersion" ? worki database, i smashes Trash</technical_language>

Target:
private ClassData build(EntityDto entity, List<FieldDto> fields, EntityType type, Bundle bundle) { try { CtClass declaring = makeClass(entity, fields, type, bundle); switch (type) { case HISTORY: String className = type.getClassName(entity.getClassName()); String simpleName = ClassName.getSimpleName(className); TypeDto idType = TypeDto.LONG; addProperty( declaring, idType.getTypeClass(), simpleName + Constants.Util.CURRENT_VERSION, null ); addProperty( declaring, Long.class.getName(), simpleName + StringUtils.capitalize(Constants.Util.SCHEMA_VERSION_FIELD_NAME), null ); break; case TRASH: addProperty(declaring, Long.class.getName(), Constants.Util.SCHEMA_VERSION_FIELD_NAME, null); break; default: } return new ClassData( declaring.getName(), entity.getModule(), entity.getNamespace(), declaring.toBytecode(), type ); } catch (ReflectiveOperationException | CannotCompileException | IOException | NotFoundException e) { throw new EntityCreationException("Unable to create entity " + entity.getName(), e); } }
Source:
<code>private FilterCache() { loader = new Thread(this::loadFromPreferences); loader.setDaemon(true); loader.start(); <START> } <END></code><technical_language>Is background loading reason, loading is done in constructor (and a separate thread)? I thought compared loading content for view, entries expensive. measure time lost for this one-time initialization</technical_language>

Target:
private FilterCache() { }
Source:
<code>public void handleEventFromOperator(int subtask, OperatorEvent event) throws Exception { Preconditions.checkArgument( <START> event instanceof CollectSinkAddressEvent, "Operator event must be a CollectSinkAddressEvent"); <END> address = ((CollectSinkAddressEvent) event).getAddress(); LOG.debug("Received sink socket server address: " + address); socket = null; }</code><technical_language>shutdown service</technical_language>

Target:
public void handleEventFromOperator(int subtask, OperatorEvent event) throws Exception { Preconditions.checkArgument( event instanceof CollectSinkAddressEvent, "Operator event must be a CollectSinkAddressEvent"); address = ((CollectSinkAddressEvent) event).getAddress(); LOG.info("Received sink socket server address: " + address); }
Source:
<code>public Pair<String, String> postRequestWithParams(String restPath, List<NameValuePair> params){ HttpPost httpPost = new HttpPost(prepareRequestURL(restPath, params)); CloseableHttpResponse response = null; try { httpPost.setEntity(new UrlEncodedFormEntity(params)); response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); String content = ""; int status = response.getStatusLine().getStatusCode(); if(status == 200) { content = EntityUtils.toString(entity); }else{ content =response.getStatusLine().getReasonPhrase(); } EntityUtils.consume(entity); return new Pair<String, String>(String.valueOf(status), content); } catch (UnsupportedEncodingException e) { <START> e.printStackTrace(); <END> return null; } catch (ClientProtocolException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; }finally { try { response.close(); } catch (IOException e) { e.printStackTrace(); return new Pair<>("500", "Post Exception for: " + httpPost.toString()); } } }</code><technical_language>logger ignore exceptions</technical_language>

Target:
public Pair<String, String> postRequestWithParams(String restPath, List<NameValuePair> params){ log.info("Posting request for " + this.serviceURL + restPath); HttpPost httpPost = new HttpPost(prepareRequestURL(restPath, params)); CloseableHttpResponse response = null; try { httpPost.setEntity(new UrlEncodedFormEntity(params)); response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); String content = ""; int status = response.getStatusLine().getStatusCode(); if(status == 200) { content = EntityUtils.toString(entity); }else{ content =response.getStatusLine().getReasonPhrase(); } EntityUtils.consume(entity); log.info("Post success"); return new Pair<String, String>(String.valueOf(status), content); } catch (UnsupportedEncodingException e) { log.error(e.getCause().getMessage(), e); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } catch (ClientProtocolException e) { log.error("ClientProtocolException"); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } catch (IOException e) { log.error("IOException"); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); }finally { try { response.close(); } catch (IOException e) { log.error("IOException", e); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } } }
Source:
<code>public void start() throws Exception { System.setProperty( "java.net.preferIPv4Stack", "true" ); System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) { ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); } <START> eventLoops = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); <END> workerEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); File moduleDirectory = new File( "modules" ); moduleManager.load( this, moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); pluginManager.loadPlugins(); config.load(); registerChannel( ForgeConstants.FML_TAG ); registerChannel( ForgeConstants.FML_HANDSHAKE_TAG ); registerChannel( ForgeConstants.FORGE_REGISTER ); isRunning = true; pluginManager.enablePlugins(); connectionThrottle = new ConnectionThrottle( config.getThrottle() ); startListeners(); saveThread.scheduleAtFixedRate( new TimerTask() { @Override public void run() { if ( getReconnectHandler() != null ) { getReconnectHandler().save(); } } }, 0, TimeUnit.MINUTES.toMillis( 5 ) ); metricsThread.scheduleAtFixedRate( new Metrics(), 0, TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); }</code><technical_language>Curious a separate event loop for boss threads, a large that</technical_language>

Target:
public void start() throws Exception { System.setProperty( "java.net.preferIPv4Stack", "true" ); System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) { ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); } bossEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); File moduleDirectory = new File( "modules" ); moduleManager.load( this, moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); pluginManager.loadPlugins(); config.load(); registerChannel( ForgeConstants.FML_TAG ); registerChannel( ForgeConstants.FML_HANDSHAKE_TAG ); registerChannel( ForgeConstants.FORGE_REGISTER ); isRunning = true; pluginManager.enablePlugins(); connectionThrottle = new ConnectionThrottle( config.getThrottle() ); startListeners(); saveThread.scheduleAtFixedRate( new TimerTask() { @Override public void run() { if ( getReconnectHandler() != null ) { getReconnectHandler().save(); } } }, 0, TimeUnit.MINUTES.toMillis( 5 ) ); metricsThread.scheduleAtFixedRate( new Metrics(), 0, TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); }
Source:
<code>public Group groupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, NotMemberOfParentGroupException, WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, NotGroupMemberException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); <START> if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || <END> (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupUnion"); } Group result = getGroupsManagerBl().groupUnion(sess, resultGroup, operandGroup); return result; }</code><technical_language>new lines</technical_language>

Target:
public Group groupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupOperationsException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupUnion"); } return getGroupsManagerBl().groupUnion(sess, resultGroup, operandGroup); }
Source:
<code>public String toString() { return new StringJoiner(", ", TimeDimension.class.getSimpleName() + "[", "]") .add("timeZone=" + getTimeZone().getDisplayName()) .add("timeGrains=" + Arrays.stream(getSupportedGrains()) .map(TimeGrainDefinition::grain) <START> .collect(Collectors.toSet())) <END> .add("columnType=" + getColumnType()) .add("name='" + getName() + "'") .add("longName='" + getLongName() + "'") .add("description='" + getDescription() + "'") .add("dimensionType=" + getDimensionType()) .add("dataType=" + getDataType()) .add("cardinality=" + getCardinality()) .add("friendlyName='" + getFriendlyName() + "'") .toString(); }</code><technical_language>a Set store supportedGrains in place</technical_language>

Target:
public String toString() { return new StringJoiner(", ", TimeDimension.class.getSimpleName() + "[", "]") .add("timeZone=" + getTimeZone().getDisplayName()) .add("timeGrains=" + getSupportedGrains() .stream() .map(TimeGrainDefinition::grain) .collect(Collectors.toSet())) .add("columnType=" + getColumnType()) .add("name='" + getName() + "'") .add("longName='" + getLongName() + "'") .add("description='" + getDescription() + "'") .add("dimensionType=" + getDimensionType()) .add("dataType=" + getDataType()) .add("cardinality=" + getCardinality()) .add("friendlyName='" + getFriendlyName() + "'") .toString(); }
Source:
<code>public AbfsOutputStream( final AbfsClient client, final String path, final long position, final int bufferSize, final boolean supportFlush, final boolean disableOutputStreamFlush, final boolean supportAppendWithFlush, final boolean appendBlob) { this.client = client; this.path = path; this.position = position; this.closed = false; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportFlush = supportFlush; this.supportAppendWithFlush = supportAppendWithFlush; this.lastError = null; this.lastFlushOffset = 0; this.bufferSize = bufferSize; this.buffer = byteBufferPool.getBuffer(false, bufferSize).array(); this.bufferIndex = 0; this.writeOperations = new ConcurrentLinkedDeque<>(); if (appendBlob) { this.maxConcurrentRequestCount = 1; } else { this.maxConcurrentRequestCount = 4 * Runtime.getRuntime().availableProcessors(); } <START> <END> this.threadExecutor = new ThreadPoolExecutor(maxConcurrentRequestCount, maxConcurrentRequestCount, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); this.completionService = new ExecutorCompletionService<>(this.threadExecutor); }</code><technical_language>elaborate a bit more for appendblob max concurrent requests is 1</technical_language>

Target:
public AbfsOutputStream( final AbfsClient client, final String path, final long position, final int bufferSize, final boolean supportFlush, final boolean disableOutputStreamFlush, final boolean supportAppendWithFlush, final boolean appendBlob) { this.client = client; this.path = path; this.position = position; this.closed = false; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportFlush = supportFlush; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportAppendWithFlush = supportAppendWithFlush; this.appendBlob = appendBlob; this.lastError = null; this.lastFlushOffset = 0; this.bufferSize = bufferSize; this.buffer = byteBufferPool.getBuffer(false, bufferSize).array(); this.bufferIndex = 0; this.writeOperations = new ConcurrentLinkedDeque<>(); this.maxConcurrentRequestCount = 4 * Runtime.getRuntime().availableProcessors(); this.threadExecutor = new ThreadPoolExecutor(maxConcurrentRequestCount, maxConcurrentRequestCount, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); this.completionService = new ExecutorCompletionService<>(this.threadExecutor); }
Source:
<code>private SafeHtml createBondTooltipMessage(HostInterfaceLineModel lineModel, InterfaceStatus interfaceStatus) { Bond bond = (Bond) lineModel.getInterface(); <START> SafeHtml bondProperties = templates.plainTextAsSafeHtml(messages.bondStatus(interfaceStatus.toString())); <END> if (!InterfaceStatus.UP.equals(interfaceStatus)) { return bondProperties; } String adPartnerMac = Objects.toString(bond.getAdPartnerMac(), ""); bondProperties = templates.addLineBreak(bondProperties, messages.bondAdPartnerMac(adPartnerMac)); String adAgregatorId = Objects.toString(bond.getAdAggregatorId(), ""); bondProperties = templates.addLineBreak(bondProperties, messages.bondAdAggregatorId(adAgregatorId)); for (HostInterface nic : lineModel.getInterfaces()) { String nicName = nic.getName(); String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); bondProperties = templates.addLineBreak(bondProperties, messages.bondSlaveAdAggregatorId(nicName, nicAggregatorId)); } return bondProperties; }</code><technical_language>of SafeHtmlBuilder more convenient build complex SafeHtml instead of templates</technical_language>

Target:
private SafeHtml createBondTooltipMessage(HostInterfaceLineModel lineModel, InterfaceStatus interfaceStatus) { Bond bond = (Bond) lineModel.getInterface(); StringBuilder bondProperties = new StringBuilder(messages.bondStatus(interfaceStatus.toString())); if (InterfaceStatus.UP.equals(interfaceStatus)) { bondProperties.append("\n").append(createActiveBondTooltipMessage(bond, lineModel)); } return new SafeHtmlBuilder().appendEscapedLines(bondProperties.toString()).toSafeHtml(); }
Source:
<code>public RealmQuery<E> in(String fieldName, String[] values, Case casing) { <START> if (values == null || values.length == 0) { <END> return this; } equalTo(fieldName, values[0], casing); for (int i = 1; i < values.length; ++i) { or().equalTo(fieldName, values[i], casing); } return this; }</code><technical_language>treat null exception</technical_language>

Target:
public RealmQuery<E> in(String fieldName, String[] values, Case casing) { if (values == null || values.length == 0) { throw new IllegalArgumentException(EMPTY_VALUES); } beginGroup().equalTo(fieldName, values[0], casing); for (int i = 1; i < values.length; i++) { or().equalTo(fieldName, values[i], casing); } return endGroup(); }
Source:
<code><START> public static Retry getNoRetry() { <END> return Retry.NO_RETRY; }</code><technical_language>Retry.NO_RETRY is public, this getter is necessary</technical_language>

Target:
public static Retry getNoRetry() { return new ExponentialRetry(Duration.ZERO, Duration.ZERO, 0); }