auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<Revision> execute() throws GitException { reset(); commandLine.add("log") .add("--format=%an#%ae#%cn#%ce#%cd#%H#%s") .add("--date=raw"); if (branch != null) { commandLine.add(branch); } if (count > 0) { commandLine.add("-" + count); } <START> if (fileFilter != null && !fileFilter.isEmpty()) { <END> commandLine.add(fileFilter); } start(); List<Revision> list = new LinkedList<>(); final DtoFactory dtoFactory = DtoFactory.getInstance(); for (String oneRev : lines) { String[] elements = oneRev.split("#"); GitUser committer = dtoFactory.createDto(GitUser.class).withName(elements[2]).withEmail(elements[3]); long commitTime = Long.parseLong(elements[4].substring(0, elements[4].indexOf(" "))) * 1000L; String commitId = elements[5]; StringBuilder commitMessage = new StringBuilder(); for (int i = 6; i < elements.length; i++) { commitMessage.append(elements[i]); } Revision revision = dtoFactory.createDto(Revision.class) .withId(commitId) .withMessage(commitMessage.toString()) .withCommitTime(commitTime) .withCommitter(committer); list.add(revision); } return list; }</code><technical_language>Please a implementation of CommandLine <LINK_0> I miss checkings</technical_language>

Target:
public List<Revision> execute() throws GitException { reset(); commandLine.add("log") .add("--format=%an#%ae#%cn#%ce#%cd#%H#%s") .add("--date=raw"); if (branch != null) { commandLine.add(branch); } if (count > 0) { commandLine.add("-" + count); } commandLine.add(fileFilter); start(); List<Revision> list = new LinkedList<>(); final DtoFactory dtoFactory = DtoFactory.getInstance(); for (String oneRev : lines) { String[] elements = oneRev.split("#"); GitUser committer = dtoFactory.createDto(GitUser.class).withName(elements[2]).withEmail(elements[3]); long commitTime = Long.parseLong(elements[4].substring(0, elements[4].indexOf(" "))) * 1000L; String commitId = elements[5]; StringBuilder commitMessage = new StringBuilder(); for (int i = 6; i < elements.length; i++) { commitMessage.append(elements[i]); } Revision revision = dtoFactory.createDto(Revision.class) .withId(commitId) .withMessage(commitMessage.toString()) .withCommitTime(commitTime) .withCommitter(committer); list.add(revision); } return list; }
Source:
<code>public static void reportException(@Nonnull String name, @Nonnull Throwable e) { name = name.replace('/', '.').trim(); <START> if (isFromMovedPackage(name)) { <END> events.put(name, e); if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, "Added a missed class for Java 11 telemetry. Class: " + name, e); } }</code><technical_language>limits usability of telemetry code removed Java. able discover issues related libraries in Jenkins plugins</technical_language>

Target:
public static void reportException(@Nonnull String name, @Nonnull Throwable e) { if (enabled()) { name = name.replace('/', '.').trim(); if (isFromMovedPackage(name) && !calledFromIgnoredPlace(e)) { events.put(name, e); if (LOGGER.isLoggable(Level.WARNING)) LOGGER.log(Level.WARNING, "Added a missed class for missing class telemetry. Class: " + name, e); } } }
Source:
<code>public ChefClient puppetClientload(String nodeName, String token, String vdc) throws EntityNotFoundException { puppetLog.info("Getting node " + nodeName + " from puppet master"); String url = null; try { url = openStackRegion.getPuppetWrapperEndPoint(token) + "v2/node/" + nodeName; } catch (OpenStackException e2) { puppetLog.warn(e2.getMessage()); } if (url != null) { Map<String, String> headers = new HashMap<String, String>(); headers.put(HttpsClient.HEADER_AUTH, token); headers.put(HttpsClient.HEADER_TENNANT, vdc); try { int statusCode; statusCode = httpsClient.doHttps(HttpMethod.GET, url, "", headers); <START> if (statusCode == HTTP_OK || statusCode == HTTP_NOT_FOUND) { <END> log.info("Node obtained"); return new ChefClient(); } else { String msg = format("[puppet get node] response code was: {0}", statusCode); puppetLog.info(msg); throw new EntityNotFoundException(ChefClient.class, msg, nodeName); } } catch (Exception e) { String msg = format("[puppet get node] response code was: {0}", e.getMessage()); puppetLog.info(e.getMessage()); throw new EntityNotFoundException(ChefClient.class, msg, nodeName); } } return null; }</code><technical_language>node obtained if statusCode is HTTP_NOT_FOUND</technical_language>

Target:
public NodeDto puppetClientload(String nodeName, String token, String vdc) throws EntityNotFoundException { puppetLog.info("Getting node " + nodeName + " from puppet master"); String url = null; NodeDto node = null; try { url = openStackRegion.getPuppetWrapperEndPoint(token) + "v2/node/" + nodeName; } catch (OpenStackException e2) { puppetLog.warn(e2.getMessage()); } if (url != null) { Map<String, String> headers = new HashMap<String, String>(); headers.put(HttpsClient.HEADER_AUTH, token); headers.put(HttpsClient.HEADER_TENNANT, vdc); try { int statusCode; statusCode = httpsClient.doHttps(HttpMethod.GET, url, "", headers); if (statusCode == HTTP_OK) { log.info("Node obtained " + nodeName); node = new NodeDto (); node.setSoftwareName(nodeName); } else { String msg = format("[puppet get node] response code was: {0}", statusCode); puppetLog.info(msg); throw new EntityNotFoundException(ChefClient.class, msg, nodeName); } } catch (Exception e) { String msg = format("[puppet get node] response code was: {0}", e.getMessage()); puppetLog.info(e.getMessage()); throw new EntityNotFoundException(ChefClient.class, msg, nodeName); } } return node; }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree tree) { if (EQUALS_MATCHER.matches(tree)) { <START> if (tree.methodSelect().is(Tree.Kind.MEMBER_SELECT) && isArgument(((MemberSelectExpressionTree) tree.methodSelect()).expression())) { <END> typeChecked = true; } else if (isArgument(tree.arguments().get(0))) { typeChecked = true; } } }</code><technical_language>this line block 175-178. A method extracted</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { for (ExpressionTree argument : tree.arguments()) { if (isArgument(argument, parameterSymbol)) { typeChecked = true; return; } } super.visitMethodInvocation(tree); }
Source:
<code>public void eventReceived(Action action, Pod resource) { Map<String, String> labels = resource.getMetadata().getLabels(); <START> if (workspaceId.equals(labels.get(CHE_WORKSPACE_ID_LABEL))) { <END> future.complete(resource); } }</code><technical_language>I afraid comparing workspace id label is enough. work for multi pods workspaces. able compare deployment specific label ensure created pod belongs needed deployment</technical_language>

Target:
public void eventReceived(Action action, Pod resource) { Map<String, String> labels = resource.getMetadata().getLabels(); if (workspaceId.equals(labels.get(CHE_WORKSPACE_ID_LABEL)) && originalName.equals(labels.get(CHE_DEPLOYMENT_NAME_LABEL))) { future.complete(resource); } }
Source:
<code>public synchronized void updateOnCommunicationFailure(long sendTimeMillis) { if (!recordingOfflineStatus) { if (trace) { <START> log.trace("Start recording failures"); <END> } recordingOfflineStatus = true; firstFailureTime = sendTimeMillis; } failureCount++; if (trace) { log.tracef("Failures count: %s", failureCount); } }</code><technical_language>Is this needed</technical_language>

Target:
public synchronized void updateOnCommunicationFailure(long sendTimeMillis) { if (!recordingOfflineStatus) { recordingOfflineStatus = true; firstFailureTime = sendTimeMillis; } failureCount++; }
Source:
<code>protected void syncSearch() { if(getEntity() != null) { GlusterVolumeEntity volume = (GlusterVolumeEntity) getEntity(); AsyncDataProvider.getInstance().getGlusterVolumeGeoRepStatusForMasterVolume(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<GlusterGeoRepSession> geoRepSessions = (ArrayList<GlusterGeoRepSession>) returnValue; <START> if(getItems() == geoRepSessions) { <END> getItemsChangedEvent().raise(this, EventArgs.EMPTY); } else { Collections.sort(geoRepSessions, new Linq.GlusterVolumeGeoRepSessionComparer()); setItems(geoRepSessions); } } }), volume.getId(), volume.getClusterId()); } else { setItems(null); } }</code><technical_language>this equal '=='</technical_language>

Target:
protected void syncSearch() { if (getEntity() == null) { return; } AsyncDataProvider.getInstance().getGlusterVolumeGeoRepStatusForMasterVolume(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<GlusterGeoRepSession> geoRepSessions = (ArrayList<GlusterGeoRepSession>) returnValue; Collections.sort(geoRepSessions, new Linq.GlusterVolumeGeoRepSessionComparer()); setItems(geoRepSessions); } }), getEntity().getId()); }
Source:
<code>public void testPollSocketsInfo() { mTst.setTcpInfoSupported(false); assertFalse(mTst.pollSocketsInfo()); assertEquals(0, mTst.getLatestPacketFailRate()); mTst.setTcpInfoSupported(true); mTst.setPollingRequest(false, AF_INET6); mTst.setPollingRequest(true, AF_INET); mTst.setMessage(TEST_RESPONSE_BYTES); mTst.setLatestPacketFailRate(-1); assertEquals(0, <START> mTst.getLatestPacketFailRate()); <END> mTst.setSentSinceLastRecv(DEFAULT_DATA_STALL_MIN_PACKETS_THRESHOLD + 1); assertTrue(mTst.pollSocketsInfo()); assertEquals(100, mTst.getLatestPacketFailRate()); }</code><technical_language>This is a good example of I : this tests test code, real implementation</technical_language>

Target:
public void testPollSocketsInfo() throws Exception { when(mDependencies.isTcpInfoParsingSupported()).thenReturn(false); final TcpSocketTracker tst = new TcpSocketTracker(mDependencies); assertFalse(tst.pollSocketsInfo()); when(mDependencies.isTcpInfoParsingSupported()).thenReturn(true); final ByteBuffer invalidBuffer = ByteBuffer.allocate(1); when(mDependencies.recvMesssage(any())).thenReturn(invalidBuffer); assertTrue(tst.pollSocketsInfo()); assertEquals(0, tst.getLatestPacketFailRate()); assertEquals(0, tst.getSentSinceLastRecv()); final ByteBuffer headerBuffer = ByteBuffer.wrap(SOCK_DIAG_MSG_BYTES); when(mDependencies.recvMesssage(any())).thenReturn(headerBuffer); assertTrue(tst.pollSocketsInfo()); assertEquals(0, tst.getSentSinceLastRecv()); assertEquals(0, tst.getLatestPacketFailRate()); final ByteBuffer tcpBuffer = ByteBuffer.wrap(TEST_RESPONSE_BYTES); when(mDependencies.recvMesssage(any())).thenReturn(tcpBuffer); assertTrue(tst.pollSocketsInfo()); assertEquals(0, tst.getSentSinceLastRecv()); assertEquals(100, tst.getLatestPacketFailRate()); assertEquals(10, tst.getSentSinceLastRecv()); }
Source:
<code><START> public Map<String, String> getFileSystemProperties() { <END> if (fileSystemProperties == null) { return new HashMap<>(); } try { return GSON.fromJson(fileSystemProperties, MAP_STRING_STRING_TYPE); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse filesystem properties: " + e.getMessage()); } }</code><technical_language>package private</technical_language>

Target:
Map<String, String> getFileSystemProperties() { if (fileSystemProperties == null) { return new HashMap<>(); } try { return GSON.fromJson(fileSystemProperties, MAP_STRING_STRING_TYPE); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse filesystem properties: " + e.getMessage()); } }
Source:
<code>private void testUseCache( List<Result> expectedResults, Query query, QueryToolChest toolchest ) throws Exception { DefaultObjectMapper objectMapper = new DefaultObjectMapper(); String segmentIdentifier = "segment"; SegmentDescriptor segmentDescriptor = new SegmentDescriptor(Intervals.of("2011/2012"), "version", 0); CacheStrategy cacheStrategy = toolchest.getCacheStrategy(query); Cache.NamedKey cacheKey = CacheUtil.computeSegmentCacheKey( segmentIdentifier, segmentDescriptor, cacheStrategy.computeCacheKey(query) ); Cache cache = MapCache.create(1024 * 1024); CacheUtil.populate( cache, objectMapper, cacheKey, <START> Iterables.transform(expectedResults, cacheStrategy.prepareForCache()), <END> 0 ); CachingQueryRunner runner = new CachingQueryRunner( segmentIdentifier, segmentDescriptor, objectMapper, cache, toolchest, new QueryRunner() { @Override public Sequence run(QueryPlus queryPlus, Map responseContext) { return Sequences.empty(); } }, backgroundExecutorService, new CacheConfig() { @Override public boolean isPopulateCache() { return true; } @Override public boolean isUseCache() { return true; } } ); HashMap<String, Object> context = new HashMap<String, Object>(); List<Result> results = Sequences.toList(runner.run(QueryPlus.wrap(query), context), new ArrayList()); Assert.assertEquals(expectedResults.toString(), results.toString()); }</code><technical_language>above, suggest -1</technical_language>

Target:
private void testUseCache( List<Result> expectedResults, Query query, QueryToolChest toolchest ) { DefaultObjectMapper objectMapper = new DefaultObjectMapper(); String segmentIdentifier = "segment"; SegmentDescriptor segmentDescriptor = new SegmentDescriptor(Intervals.of("2011/2012"), "version", 0); CacheStrategy cacheStrategy = toolchest.getCacheStrategy(query); Cache.NamedKey cacheKey = CacheUtil.computeSegmentCacheKey( segmentIdentifier, segmentDescriptor, cacheStrategy.computeCacheKey(query) ); Cache cache = MapCache.create(1024 * 1024); CacheUtil.populate( cache, objectMapper, cacheKey, Iterables.transform(expectedResults, cacheStrategy.prepareForSegmentLevelCache()) ); CachingQueryRunner runner = new CachingQueryRunner( segmentIdentifier, segmentDescriptor, objectMapper, cache, toolchest, new QueryRunner() { @Override public Sequence run(QueryPlus queryPlus, Map responseContext) { return Sequences.empty(); } }, backgroundExecutorService, new CacheConfig() { @Override public boolean isPopulateCache() { return true; } @Override public boolean isUseCache() { return true; } } ); HashMap<String, Object> context = new HashMap<String, Object>(); List<Result> results = runner.run(QueryPlus.wrap(query), context).toList(); Assert.assertEquals(expectedResults.toString(), results.toString()); }
Source:
<code>public void testStoredKeyTypeMismatch() { ServerStoreConfiguration serverConfiguration = new ServerStoreConfiguration(FIXED_POOL_ALLOCATION, STORED_KEY_TYPE, STORED_VALUE_TYPE, ACTUAL_KEY_TYPE, ACTUAL_VALUE_TYPE, KEY_SERIALIZER_TYPE, VALUE_SERIALIZER_TYPE, Consistency.EVENTUAL); ServerStoreConfiguration clientConfiguration = new ServerStoreConfiguration(FIXED_POOL_ALLOCATION, String.class.getName(), STORED_VALUE_TYPE, ACTUAL_KEY_TYPE, ACTUAL_VALUE_TYPE, KEY_SERIALIZER_TYPE, VALUE_SERIALIZER_TYPE, Consistency.EVENTUAL); ServerStoreCompatibility serverStoreCompatibility = new ServerStoreCompatibility(); try { serverStoreCompatibility.verify(serverConfiguration, clientConfiguration); fail("Expected ClusteredStoreValidationException"); } catch(ClusteredStoreValidationException e) { System.out.println("errorMsg: " + e.getMessage()); <START> Assert.assertTrue("test failed", e.getMessage().equals(ERROR_MESSAGE_BASE + "storedKeyType existing: " + serverConfiguration.getStoredKeyType() + ", desired: " + clientConfiguration.getStoredKeyType())); <END> } }</code><technical_language>assertThat(... , is(true))</technical_language>

Target:
public void testStoredKeyTypeMismatch() { ServerStoreConfiguration serverConfiguration = new ServerStoreConfiguration(FIXED_POOL_ALLOCATION, STORED_KEY_TYPE, STORED_VALUE_TYPE, ACTUAL_KEY_TYPE, ACTUAL_VALUE_TYPE, KEY_SERIALIZER_TYPE, VALUE_SERIALIZER_TYPE, Consistency.EVENTUAL); ServerStoreConfiguration clientConfiguration = new ServerStoreConfiguration(FIXED_POOL_ALLOCATION, String.class.getName(), STORED_VALUE_TYPE, ACTUAL_KEY_TYPE, ACTUAL_VALUE_TYPE, KEY_SERIALIZER_TYPE, VALUE_SERIALIZER_TYPE, Consistency.EVENTUAL); ServerStoreCompatibility serverStoreCompatibility = new ServerStoreCompatibility(); try { serverStoreCompatibility.verify(serverConfiguration, clientConfiguration); fail("Expected ClusteredStoreValidationException"); } catch(ClusteredStoreValidationException e) { assertThat("test failed", e.getMessage().equals(ERROR_MESSAGE_BASE + "storedKeyType existing: " + serverConfiguration.getStoredKeyType() + ", desired: " + clientConfiguration.getStoredKeyType()),is(true)); } }
Source:
<code>void setVisibleB(boolean show) { if (show) { <START> removeStyleName(style.hideB()); <END> } else { addStyleName(style.hideB()); } }</code><technical_language>this: parent.syncScroll(DisplaySide.A); // match viewport</technical_language>

Target:
void setVisibleB(boolean show) { if (show) { removeStyleName(style.hideB()); parent.syncScroll(DisplaySide.A); } else { addStyleName(style.hideB()); } }
Source:
<code>public static void parseDeclarationControls(Element element, BeanDefinitionBuilder builder) { NamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-declare", "shouldDeclare"); String admins = element.getAttribute("declared-by"); if (StringUtils.hasText(admins)) { String[] adminBeanNames = admins.split(","); ManagedList<BeanReference> adminBeanRefs = new ManagedList<BeanReference>(); <START> for (String adminBean : adminBeanNames) { <END> adminBeanRefs.add(new RuntimeBeanReference(adminBean.trim())); } builder.addPropertyValue("adminsThatShouldDeclare", adminBeanRefs); } }</code><technical_language>rename adminBean adminBeanName</technical_language>

Target:
public static void parseDeclarationControls(Element element, BeanDefinitionBuilder builder) { NamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-declare", "shouldDeclare"); String admins = element.getAttribute("declared-by"); if (StringUtils.hasText(admins)) { String[] adminBeanNames = admins.split(","); ManagedList<BeanReference> adminBeanRefs = new ManagedList<BeanReference>(); for (String adminBeanName : adminBeanNames) { adminBeanRefs.add(new RuntimeBeanReference(adminBeanName.trim())); } builder.addPropertyValue("adminsThatShouldDeclare", adminBeanRefs); } }
Source:
<code>protected void init() { updateMigrateOnError(); oldCluster = clusterDao.get(getCluster().getId()); if (oldCluster != null && !Objects.equals(oldCluster.getCompatibilityVersion(), getCluster().getCompatibilityVersion())) { vmsLockedForUpdate = filterVmsInClusterNeedUpdate(); templatesLockedForUpdate = filterTemplatesInClusterNeedUpdate(); } if (oldCluster == null || (oldCluster != null && <START> !oldCluster.getCpuName().equals(getCluster().getCpuName()))) <END> { getParameters().setUpdateCpuFlags(true); } if (getParameters().isUpdateCpuFlags()) { clusterCpuFlagsManager.updateCpuFlags(getCluster()); } }</code><technical_language>this null? Objects.equal</technical_language>

Target:
protected void init() { updateMigrateOnError(); oldCluster = clusterDao.get(getCluster().getId()); if (oldCluster != null && !Objects.equals(oldCluster.getCompatibilityVersion(), getCluster().getCompatibilityVersion())) { vmsLockedForUpdate = filterVmsInClusterNeedUpdate(); templatesLockedForUpdate = filterTemplatesInClusterNeedUpdate(); } if (oldCluster == null || !Objects.equals(oldCluster.getCpuName(), getCluster().getCpuName())) { getParameters().setUpdateCpuFlags(true); } if (getParameters().isUpdateCpuFlags()) { clusterCpuFlagsManager.updateCpuFlags(getCluster()); } }
Source:
<code>public boolean addRule(RelOptRule rule) { if (locked) { return false; } if (ruleSet.contains(rule)) { return false; } final boolean added = ruleSet.add(rule); assert added; final String ruleName = rule.toString(); <START> if (ruleNames.containsKey(ruleName)) { <END> throw new RuntimeException("Rule description '" + ruleName + "' is not unique. "); } else { ruleNames.put(ruleName, rule); } mapRuleDescription(rule); for (RelOptRuleOperand operand : rule.getOperands()) { for (Class<? extends RelNode> subClass : subClasses(operand.getMatchedClass())) { classOperands.put(subClass, operand); } } if (rule instanceof ConverterRule) { ConverterRule converterRule = (ConverterRule) rule; final RelTrait ruleTrait = converterRule.getInTrait(); final RelTraitDef ruleTraitDef = ruleTrait.getTraitDef(); if (traitDefs.contains(ruleTraitDef)) { ruleTraitDef.registerConverterRule(this, converterRule); } } return true; }</code><technical_language>simplify this - if (ruleNames.put(ruleName, rule)) { ... } need else block</technical_language>

Target:
public boolean addRule(RelOptRule rule) { if (locked) { return false; } if (ruleSet.contains(rule)) { return false; } final boolean added = ruleSet.add(rule); assert added; final String ruleName = rule.toString(); if (ruleNames.put(ruleName, rule) != null) { throw new RuntimeException("Rule description '" + ruleName + "' is not unique. "); } mapRuleDescription(rule); for (RelOptRuleOperand operand : rule.getOperands()) { for (Class<? extends RelNode> subClass : subClasses(operand.getMatchedClass())) { classOperands.put(subClass, operand); } } if (rule instanceof ConverterRule) { ConverterRule converterRule = (ConverterRule) rule; final RelTrait ruleTrait = converterRule.getInTrait(); final RelTraitDef ruleTraitDef = ruleTrait.getTraitDef(); if (traitDefs.contains(ruleTraitDef)) { ruleTraitDef.registerConverterRule(this, converterRule); } } return true; }
Source:
<code><START> public EquivalenceGenerators( <END> Iterable<? extends EquivalenceGenerator<T>> generators, Set<String> excludedUris, Set<String> excludedIds ) { this.generators = ImmutableList.copyOf(generators); this.excludedUris = excludedUris; this.excludedIds = excludedIds; this.codec = SubstitutionTableNumberCodec.lowerCaseOnly(); }</code><technical_language>convert private constructor a static create method</technical_language>

Target:
private EquivalenceGenerators( Iterable<? extends EquivalenceGenerator<T>> generators, Set<String> excludedUris, Set<String> excludedIds ) { this.generators = ImmutableList.copyOf(generators); this.excludedUris = excludedUris; this.excludedIds = excludedIds; this.codec = SubstitutionTableNumberCodec.lowerCaseOnly(); }
Source:
<code>void renewMessageLock() { Duration renewAfterSeconds = Duration.ofSeconds(1); long takeTimeToProcessMessageMillis = 10000; final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, "id-1", 0); AtomicReference<Integer> renewMessageLockCounter = new AtomicReference<>(0); StepVerifier.create(sender.send(message).thenMany(receiverManual.receive() .take(1) .delayElements(renewAfterSeconds) .map(receivedMessage -> { Disposable disposable = receiverManual.renewMessageLock(receivedMessage.getLockToken()) .repeat(() -> true) .delayElements(renewAfterSeconds) .doOnNext(instant -> { if (instant != null) { logger.info(" Received new refresh time " + instant); renewMessageLockCounter.set(renewMessageLockCounter.get() + 1); } }) .subscribe(); try { Thread.sleep(takeTimeToProcessMessageMillis); } catch (InterruptedException ignored) { } disposable.dispose(); return receivedMessage; }))) <START> .assertNext(Assertions::assertNotNull) <END> .verifyComplete(); Assertions.assertTrue(renewMessageLockCounter.get() > 0); }</code><technical_language>I said, spec this null</technical_language>

Target:
void renewMessageLock() { Duration renewAfterSeconds = Duration.ofSeconds(1); long takeTimeToProcessMessageMillis = 10000; final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, "id-1", 0); AtomicReference<Integer> renewMessageLockCounter = new AtomicReference<>(0); StepVerifier.create(sender.send(message).thenMany(receiverManual.receive() .take(1) .delayElements(renewAfterSeconds) .map(receivedMessage -> { Disposable disposable = receiverManual.renewMessageLock(receivedMessage.getLockToken()) .repeat() .delayElements(renewAfterSeconds) .doOnNext(instant -> { if (instant != null) { logger.info(" Received new refresh time " + instant); renewMessageLockCounter.set(renewMessageLockCounter.get() + 1); } }) .subscribe(); try { Thread.sleep(takeTimeToProcessMessageMillis); } catch (InterruptedException ignored) { } disposable.dispose(); return receivedMessage; }))) .assertNext(receivedMessage -> { Assertions.assertNotNull(receivedMessage.getLockedUntil()); }) .verifyComplete(); Assertions.assertTrue(renewMessageLockCounter.get() > 0); }
Source:
<code>public IndexUpdater newUpdater( final IndexUpdateMode mode ) { <START> IndexUpdater actual = accessor.newUpdater( <END> mode == IndexUpdateMode.ONLINE && forcedIdempotentMode ? IndexUpdateMode.ONLINE_IDEMPOTENT : mode ); return started ? updateCountingUpdater( actual ) : actual; }</code><technical_language>i this condition moving in wrong direction a step puts valley of assumptions based bugs deeper before. i observe this method signature code accessor able create updater, based correctly supplier accessor factory</technical_language>

Target:
public IndexUpdater newUpdater( final IndexUpdateMode mode ) { IndexUpdater actual = accessor.newUpdater( escalateModeIfNecessary( mode ) ); return started ? updateCountingUpdater( actual ) : actual; }
Source:
<code>private Parser(Module module) throws IOException { if (module.name().endsWith(RuleGrammarGenerator.RULE_CELLS)) { <START> org.kframework.definition.Definition definitionWithBuiltins = Definition.from("require \"domians.k\"", "K"); <END> this.parseInModule = new RuleGrammarGenerator(definitionWithBuiltins, true).getCombinedGrammar(module); } else { this.parseInModule = new ParseInModule(module); } }</code><technical_language>generate parsers kast.k is needed. including builtins</technical_language>

Target:
private Parser(Module module) { if (module.name().endsWith(RuleGrammarGenerator.RULE_CELLS)) { org.kframework.definition.Definition definitionWithBuiltins = Definition.from("require \"domians.k\"", "K"); this.parseInModule = new RuleGrammarGenerator(definitionWithBuiltins, true).getCombinedGrammar(module); } else { this.parseInModule = new ParseInModule(module); } }
Source:
<code>protected LoginPackage preLogin() throws BankException, IOException { try { urlopen = login(); LoginPackage lp = new LoginPackage(urlopen, null, <START> response, "<LINK_0>"); <END> lp.setIsLoggedIn(true); return lp; } catch (LoginException e) { return null; } }</code><technical_language>do moving url strings constants</technical_language>

Target:
protected LoginPackage preLogin() throws BankException, IOException { try { urlopen = login(); LoginPackage lp = new LoginPackage(urlopen, null, response, OVERVIEW_URL); lp.setIsLoggedIn(true); return lp; } catch (LoginException e) { return null; } }
Source:
<code>protected void endVmCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { final boolean taskGroupSucceeded = getParameters().getTaskGroupSuccess(); Snapshot createdSnapshot = getSnapshotDao().get(getVmId(), getParameters().getSnapshotType(), SnapshotStatus.LOCKED); if (taskGroupSucceeded) { getSnapshotDao().updateStatus(createdSnapshot.getId(), SnapshotStatus.OK); if (isLiveSnapshotApplicable()) { performLiveSnapshot(createdSnapshot); } else if (!createdSnapshot.getMemoryVolume().isEmpty() && getVm() != null) { String[] strings = getVm().getHibernationVolHandle().split(","); Guid[] guids = new Guid[strings.length]; for (int i=0; i<strings.length; ++i) { guids[i] = new Guid(strings[i]); } VDSReturnValue vdsRetValue1 = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids[1], guids[0], guids[2], <START> false, false, getVm().getVdsGroupCompatibilityVersion().toString())); <END> if (!vdsRetValue1.getSucceeded()) { } } } else { revertToActiveSnapshot(createdSnapshot.getId()); } incrementVmGeneration(); endActionOnDisks(); setSucceeded(taskGroupSucceeded); getReturnValue().setEndActionTryAgain(false); return null; } }); if (getVm() != null && getVm().isAutoStartup() && isVmDownUnintentionally() && getParameters().getInitialVmStatus() != VMStatus.Down) { Backend.getInstance().runInternalAction(VdcActionType.RunVm, new RunVmParams(getVmId()), ExecutionHandler.createInternalJobContext()); } }</code><technical_language>2 deletes here</technical_language>

Target:
protected void endVmCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { final boolean taskGroupSucceeded = getParameters().getTaskGroupSuccess(); Snapshot createdSnapshot = getSnapshotDao().get(getVmId(), getParameters().getSnapshotType(), SnapshotStatus.LOCKED); if (taskGroupSucceeded) { getSnapshotDao().updateStatus(createdSnapshot.getId(), SnapshotStatus.OK); if (isLiveSnapshotApplicable()) { performLiveSnapshot(createdSnapshot); } } else { revertToActiveSnapshot(createdSnapshot.getId()); } incrementVmGeneration(); endActionOnDisks(); setSucceeded(taskGroupSucceeded); getReturnValue().setEndActionTryAgain(false); return null; } }); if (getVm() != null && getVm().isAutoStartup() && isVmDownUnintentionally() && getParameters().getInitialVmStatus() != VMStatus.Down) { Backend.getInstance().runInternalAction(VdcActionType.RunVm, new RunVmParams(getVmId()), ExecutionHandler.createInternalJobContext()); } }
Source:
<code>public OAuth2InitialClientMessage parseInitialClientMessage(byte[] fromBytes) throws AuthenticationMechanismException { byte[] messageBytes = fromBytes.clone(); ByteIterator byteIterator = ByteIterator.ofBytes(fromBytes.clone()); try { final char cbindFlag = (char) byteIterator.next(); if (cbindFlag != 'n') { throw ElytronMessages.log.mechChannelBindingNotSupported(this.mechanismName); } String authorizationID = null; if (byteIterator.next() == ',') { final int c = byteIterator.next(); if (c == 'a') { if (byteIterator.next() != '=') { throw log.mechInvalidClientMessage(this.mechanismName); } <START> authorizationID = byteIterator.delimitedBy(',').asUtf8String().drainToString(); <END> } else if (c == ',') { throw log.mechInvalidClientMessage(this.mechanismName); } } String oauth2Part = byteIterator.asUtf8String().drainToString(); String[] keyValues = oauth2Part.split(KV_DELIMITER); String auth = getValue("auth", keyValues); if (auth == null) { throw log.mechInvalidClientMessage(this.mechanismName); } return new OAuth2InitialClientMessage(authorizationID, auth, messageBytes); } catch (NoSuchElementException ignored) { throw ElytronMessages.log.mechInvalidMessageReceived(this.mechanismName); } }</code><technical_language>delimiter is consumed here. line 83 I suspect get extra , start of oauth2part, if authorization ID is present</technical_language>

Target:
public OAuth2InitialClientMessage parseInitialClientMessage(byte[] fromBytes) throws AuthenticationMechanismException { byte[] messageBytes = fromBytes.clone(); ByteIterator byteIterator = ByteIterator.ofBytes(fromBytes.clone()); try { final char cbindFlag = (char) byteIterator.next(); if (cbindFlag != 'n') { throw ElytronMessages.log.mechChannelBindingNotSupported(this.mechanismName); } String authorizationID = null; if (byteIterator.next() == ',') { final int c = byteIterator.next(); if (c == 'a') { if (byteIterator.next() != '=') { throw log.mechInvalidClientMessage(this.mechanismName); } authorizationID = byteIterator.delimitedBy(',').asUtf8String().drainToString(); if (byteIterator.next() != ',') { throw ElytronMessages.log.mechInvalidClientMessage(this.mechanismName); } } } String auth = getValue("auth", byteIterator.asUtf8String().drainToString()); if (auth == null) { throw log.mechInvalidClientMessage(this.mechanismName); } return new OAuth2InitialClientMessage(authorizationID, auth, messageBytes); } catch (NoSuchElementException ignored) { throw ElytronMessages.log.mechInvalidMessageReceived(this.mechanismName); } }
Source:
<code>public String toString() { <START> return new StringBuilder() END> .append(getJavaClass().getName()) .append('#').append(getJavaMethodName()) .append('(').append(nullSafeToString(getJavaMethodParameterTypes())).append(')') .toString(); }</code><technical_language>I time move this frequently copied-n-pasted code a core utility</technical_language>

Target:
public String toString() { return new ToStringBuilder(this) .append("javaClass", javaClass) .append("javaMethodName", javaMethodName) .append("javaMethodParameterTypes", nullSafeToString(getJavaMethodParameterTypes())) .toString(); }
Source:
<code>public void addRegionResults(RestoreRedundancyResults results) { satisfiedRedundancyRegionsResults.putAll(results.getSatisfiedRedundancyRegionResults()); underRedundancyRegionsResults.putAll(results.getUnderRedundancyRegionResults()); zeroRedundancyRegionsResults.putAll(results.getZeroRedundancyRegionResults()); totalPrimaryTransfersCompleted += results.getTotalPrimaryTransfersCompleted(); <START> totalPrimaryTransferTime = totalPrimaryTransferTime + results.getTotalPrimaryTransferTime(); <END> }</code><technical_language>This replaced totalPrimaryTransferTime += results.getTotalPrimaryTransferTime();</technical_language>

Target:
public void addRegionResults(RestoreRedundancyResults results) { satisfiedRedundancyRegionsResults.putAll(results.getSatisfiedRedundancyRegionResults()); underRedundancyRegionsResults.putAll(results.getUnderRedundancyRegionResults()); zeroRedundancyRegionsResults.putAll(results.getZeroRedundancyRegionResults()); totalPrimaryTransfersCompleted += results.getTotalPrimaryTransfersCompleted(); totalPrimaryTransferTime += results.getTotalPrimaryTransferTime(); }
Source:
<code>public KinesisClientLibConfiguration(String applicationName, String streamName, AwsCredentialsProvider kinesisCredentialsProvider, AwsCredentialsProvider dynamoDBCredentialsProvider, AwsCredentialsProvider cloudWatchCredentialsProvider, String workerId) { this(applicationName, streamName, null, null, DEFAULT_INITIAL_POSITION_IN_STREAM, kinesisCredentialsProvider, dynamoDBCredentialsProvider, cloudWatchCredentialsProvider, DEFAULT_FAILOVER_TIME_MILLIS, workerId, DEFAULT_MAX_RECORDS, DEFAULT_IDLETIME_BETWEEN_READS_MILLIS, DEFAULT_DONT_CALL_PROCESS_RECORDS_FOR_EMPTY_RECORD_LIST, DEFAULT_PARENT_SHARD_POLL_INTERVAL_MILLIS, DEFAULT_SHARD_SYNC_INTERVAL_MILLIS, DEFAULT_CLEANUP_LEASES_UPON_SHARDS_COMPLETION, <START> DEFAULT_TASK_BACKOFF_TIME_MILLIS, DEFAULT_METRICS_BUFFER_TIME_MILLIS, DEFAULT_METRICS_MAX_QUEUE_SIZE, DEFAULT_VALIDATE_SEQUENCE_NUMBER_BEFORE_CHECKPOINTING, null, DEFAULT_SHUTDOWN_GRACE_MILLIS, DEFAULT_SCHEDULER_INITIALIZATION_RETRY_INTERVAL_MILLIS); } <END></code><technical_language>This is initialization backoff time retry, similar "DEFAULT_TASK_BACKOFF_TIME_MILLIS". naming convention similar, i.e. DEFAULT_SCHEDULER_INITIALIZATION_BACKOFF_TIME_MILLIS</technical_language>

Target:
public KinesisClientLibConfiguration(String applicationName, String streamName, AwsCredentialsProvider kinesisCredentialsProvider, AwsCredentialsProvider dynamoDBCredentialsProvider, AwsCredentialsProvider cloudWatchCredentialsProvider, String workerId) { this(applicationName, streamName, null, null, DEFAULT_INITIAL_POSITION_IN_STREAM, kinesisCredentialsProvider, dynamoDBCredentialsProvider, cloudWatchCredentialsProvider, DEFAULT_FAILOVER_TIME_MILLIS, workerId, DEFAULT_MAX_RECORDS, DEFAULT_IDLETIME_BETWEEN_READS_MILLIS, DEFAULT_DONT_CALL_PROCESS_RECORDS_FOR_EMPTY_RECORD_LIST, DEFAULT_PARENT_SHARD_POLL_INTERVAL_MILLIS, DEFAULT_SHARD_SYNC_INTERVAL_MILLIS, DEFAULT_CLEANUP_LEASES_UPON_SHARDS_COMPLETION, DEFAULT_TASK_BACKOFF_TIME_MILLIS, DEFAULT_METRICS_BUFFER_TIME_MILLIS, DEFAULT_METRICS_MAX_QUEUE_SIZE, DEFAULT_VALIDATE_SEQUENCE_NUMBER_BEFORE_CHECKPOINTING, null, DEFAULT_SHUTDOWN_GRACE_MILLIS, DEFAULT_SCHEDULER_INITIALIZATION_BACKOFF_TIME_MILLIS); }
Source:
<code>protected String doDelete(String apiUrl, Map<String,String> data) throws Exception { String fullUrl = BASE_URL + apiUrl; if (data != null) { if (data.size() > 0) { fullUrl += "?"; } for (Map.Entry<String,String> entry : data.entrySet()) { <START> fullUrl += entry.getKey() + "=" + uriEncode(entry.getValue()) + "&"; <END> } } if (_clientId != null) { if (data == null || data.size() == 0) { fullUrl += "?"; } fullUrl += "clientUUID=" + _clientId; } fullUrl += "&profileIdentifier=" + uriEncode(this._profileName); OkHttpClient okHttpClient = new OkHttpClient(); Request request = new Request.Builder() .url(fullUrl) .delete() .build(); Response response = okHttpClient.newCall(request).execute(); return response.body().string(); }</code><technical_language>do want append & time? if this is item in list</technical_language>

Target:
protected String doDelete(String apiUrl, Map<String,String> data) throws Exception { String fullUrl = getRequestUrlFromMap(apiUrl, data); if (_clientId != null) { if ( data == null || (data.isEmpty())) { fullUrl += "?"; } fullUrl += "clientUUID=" + _clientId; } fullUrl += "&profileIdentifier=" + uriEncode(this._profileName); Request request = new Request.Builder() .url(fullUrl) .delete() .build(); Response response = okHttpClient.newCall(request).execute(); return response.body().string(); }
Source:
<code>private int[] getOrCreatePropertyIds( String[] propertyKeyNames ) throws ProcedureException { int[] propertyKeyIds = new int[propertyKeyNames.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { try { propertyKeyIds[i] = ktx.tokenWrite().propertyKeyGetOrCreateForName( propertyKeyNames[i] ); } catch ( IllegalTokenNameException e ) { <START> throw new ProcedureException( e.status(), e, "" ); <END> } } return propertyKeyIds; }</code><technical_language>Please replace empty string a proper error message</technical_language>

Target:
private int[] getOrCreatePropertyIds( String[] propertyKeyNames ) throws ProcedureException { int[] propertyKeyIds = new int[propertyKeyNames.length]; for ( int i = 0; i < propertyKeyIds.length; i++ ) { try { propertyKeyIds[i] = ktx.tokenWrite().propertyKeyGetOrCreateForName( propertyKeyNames[i] ); } catch ( IllegalTokenNameException e ) { throw new ProcedureException( e.status(), e, e.getMessage() ); } } return propertyKeyIds; }
Source:
<code>public void onNext(CorfuStreamEntries results) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node in the cluster is not the leader.", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); return; } <START> log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", <END> results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener at node put an event to its local discoveryServiceQueue", discoveryService.getLocalNodeDescriptor(), event); discoveryService.input(new DiscoveryServiceEvent(DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId())); } } }</code><technical_language>this message printed a huge blob printed corfu.logs of node receiving it, remove localNodeDescriptor localClusterDescriptor</technical_language>

Target:
public void onNext(CorfuStreamEntries results) { synchronized (discoveryService) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node as it is not the leader.", results); return; } log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener put an event to its local discoveryServiceQueue", event); discoveryService.input(new DiscoveryServiceEvent(DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId())); } } } }
Source:
<code>static <T> CheckedFunction0<T> decorateCheckedSupplier(Timer timer, CheckedFunction0<T> supplier){ return () -> { <START> final Context context = timer.context(); <END> try { T returnValue = supplier.apply(); timer.onSuccess(context); return returnValue; }catch (Throwable e){ timer.onError(context); throw e; } }; }</code><technical_language>is possibility Timer garbage free CircuitBreaker. requires changes contract of Timer.onSuccess Timer.onError discussed this in Issue #117 This is suggestion, skip if want to</technical_language>

Target:
static <T> CheckedFunction0<T> decorateCheckedSupplier(Timer timer, CheckedFunction0<T> supplier){ return () -> { final Timer.Context context = timer.context(); try { T returnValue = supplier.apply(); context.onSuccess(); return returnValue; }catch (Throwable e){ context.onError(); throw e; } }; }
Source:
<code><START> public Field notFound(Class<?> type, boolean isInstanceField) throws FieldNotFoundException { <END> throw new FieldNotFoundException(String.format( "No %s field of type \"%s\" could be found in the class hierarchy of %s.", isInstanceField ? "instance" : "static", expectedFieldType.getName(), type.getName())); }</code><technical_language>Hmm, achieve keeping void in interface</technical_language>

Target:
public void notFound(Class<?> type, boolean isInstanceField) throws FieldNotFoundException { throw new FieldNotFoundException(String.format( "No %s field of type \"%s\" could be found in the class hierarchy of %s.", isInstanceField ? "instance" : "static", expectedFieldType.getName(), type.getName())); }
Source:
<code>public void save(Savable object, OutputStream f) throws IOException { if (!(object instanceof Material)) { throw new IllegalArgumentException("J3MExporter can only save com.jme3.material.Material class"); } try (OutputStreamWriter out = new OutputStreamWriter(f, StandardCharsets.UTF_8); <START> BufferedWriter writer = new BufferedWriter(out)) { <END> rootCapsule.clear(); object.write(this); rootCapsule.writeToStream(writer); } }</code><technical_language>I this. method called write a stream need (or already) buffering cache. I this done in other PR, Buffered*Steam is method writes files</technical_language>

Target:
public void save(Savable object, OutputStream f) throws IOException { if (!(object instanceof Material)) { throw new IllegalArgumentException("J3MExporter can only save com.jme3.material.Material class"); } try (OutputStreamWriter out = new OutputStreamWriter(f, StandardCharsets.UTF_8)) { rootCapsule.clear(); object.write(this); rootCapsule.writeToStream(out); } }
Source:
<code>private void putSketch(final ByteBuffer buffer, final int position, final UpdateDoublesSketch sketch) { Int2ObjectMap<UpdateDoublesSketch> map = sketches.get(buffer); <START> if (map == null) { <END> map = new Int2ObjectOpenHashMap<>(); sketches.put(buffer, map); } map.put(position, sketch); }</code><technical_language>sketches.computeIfAbsent()</technical_language>

Target:
private void putSketch(final ByteBuffer buffer, final int position, final UpdateDoublesSketch sketch) { Int2ObjectMap<UpdateDoublesSketch> map = sketches.computeIfAbsent(buffer, buf -> new Int2ObjectOpenHashMap<>()); map.put(position, sketch); }
Source:
<code>public static void main(String[] args) throws Exception { Args myArgs = new Args(); CmdLineParser parser = new CmdLineParser(myArgs, ParserProperties.defaults().withUsageWidth(90)); try { parser.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } Directory dir = FSDirectory.open(Paths.get(myArgs.index)); IndexReader reader = DirectoryReader.open(dir); PrintStream out = new PrintStream(new FileOutputStream(new File(myArgs.output))); out.println("docid\tnorm"); for (LeafReaderContext context : reader.leaves()) { LeafReader leafReader = context.reader(); <START> NumericDocValues docValues = leafReader.getNormValues("contents"); <END> while (docValues.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) { out.println(String.format("%d\t%d", docValues.docID() + context.docBase, SmallFloat.byte4ToInt((byte) docValues.longValue()))); } } out.close(); }</code><technical_language>want check docValues for null return a error if field exist, if indexed norms</technical_language>

Target:
public static void main(String[] args) throws Exception { Args myArgs = new Args(); CmdLineParser parser = new CmdLineParser(myArgs, ParserProperties.defaults().withUsageWidth(90)); try { parser.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } Directory dir = FSDirectory.open(Paths.get(myArgs.index)); IndexReader reader = DirectoryReader.open(dir); PrintStream out = new PrintStream(new FileOutputStream(new File(myArgs.output))); out.println("docid\tnorm"); for (LeafReaderContext context : reader.leaves()) { LeafReader leafReader = context.reader(); NumericDocValues docValues = leafReader.getNormValues("contents"); if (docValues == null) { throw new Exception("Norms do not appear to have been indexed!"); } while (docValues.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) { out.println(String.format("%d\t%d", docValues.docID() + context.docBase, SmallFloat.byte4ToInt((byte) docValues.longValue()))); } } out.close(); }
Source:
<code>public IccOpenLogicalChannelResponse iccOpenLogicalChannel( int subId, String callingPackage, String aid, int p2) { TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege( mApp, subId, "iccOpenLogicalChannel"); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (DBG) { log("iccOpenLogicalChannel: subId=" + subId + " aid=" + aid + " p2=" + p2); } return <START> iccOpenLogicalChannelWithPermission(mSubscriptionController.getPhoneId(subId), <END> callingPackage, aid, p2); }</code><technical_language>This INVALID if subId is DEFAULT default subscription is set. want is equivalent of logic in getPhoneFromRequest(). change parameter Phone instead of a phoneId</technical_language>

Target:
public IccOpenLogicalChannelResponse iccOpenLogicalChannel( int subId, String callingPackage, String aid, int p2) { TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege( mApp, subId, "iccOpenLogicalChannel"); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (DBG) { log("iccOpenLogicalChannel: subId=" + subId + " aid=" + aid + " p2=" + p2); } return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid, p2); }
Source:
<code>public void writeData(ObjectDataOutput out) throws IOException { <START> out.writeUTF(name); <END> writeNullableList(attributes, out); }</code><technical_language>index type is persisted account in hashCode/equals, basically deserialized index configs of SORTED type</technical_language>

Target:
public void writeData(ObjectDataOutput out) throws IOException { out.writeUTF(name); out.writeInt(type.getId()); writeNullableList(attributes, out); }
Source:
<code>public void notifyLinkPropertiesChanged(final LinkProperties lp) { <START> getHandler().post(() -> mLinkProperties = lp); <END> }</code><technical_language>While this is correct, I confusing mix StateMachine, set of guarantees (e.g., "nothing if in enter, exit, processmessage"; "every state is explicit happen in it") arbitrary lambdas run handler thread. I confusing define separate CMD_UPDATE_LINKPROPERTIES CMD_UPDATE_CAPABILITIES messages, notifyNetworkConnected send sends CMD_NETWORK_CONNECTED. caller (CS) call functions notifies NM network connected. Yes, a more verbose, advantage maintains invariants of StateMachine. new commands need handled in default state I think</technical_language>

Target:
public void notifyLinkPropertiesChanged(final LinkProperties lp) { sendMessage(EVENT_LINK_PROPERTIES_CHANGED, lp); }