auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void onCtrlMsg(final AvroElasticMemoryMessage msg) { final TraceScope onCtrlMsgScope = Trace.startSpan(ON_CTRL_MSG, HTraceUtils.fromAvro(msg.getTraceInfo())); try { final CtrlMsg ctrlMsg = msg.getCtrlMsg(); final String key = ctrlMsg.getDataClassName().toString(); final Codec codec = serializer.getCodec(key); <START> final List<Pair<Long, Object>> idObjectList = new LinkedList<>(); <END> for (final AvroLongRange avroLongRange : ctrlMsg.getIdRange()) { idObjectList.addAll(memoryStore.remove(key, avroLongRange.getMin(), avroLongRange.getMax())); } final List<UnitIdPair> unitIdPairList = new LinkedList<>(); for (final Pair<Long, Object> objectId : idObjectList) { final UnitIdPair unitIdPair = UnitIdPair.newBuilder() .setUnit(ByteBuffer.wrap(codec.encode(objectId.second))) .setId(objectId.first) .build(); unitIdPairList.add(unitIdPair); } sender.get().sendDataMsg(msg.getDestId().toString(), ctrlMsg.getDataClassName().toString(), unitIdPairList, TraceInfo.fromSpan(onCtrlMsgScope.getSpan())); } finally { onCtrlMsgScope.close(); } }</code><technical_language>Good a description on</technical_language>

Target:
private void onCtrlMsg(final AvroElasticMemoryMessage msg) { final TraceScope onCtrlMsgScope = Trace.startSpan(ON_CTRL_MSG, HTraceUtils.fromAvro(msg.getTraceInfo())); try { final CtrlMsg ctrlMsg = msg.getCtrlMsg(); final String key = ctrlMsg.getDataClassName().toString(); final Codec codec = serializer.getCodec(key); final Set<Map<Long, Object>> idObjectMapSet = new HashSet<>(); int numObject = 0; for (final AvroLongRange avroLongRange : ctrlMsg.getIdRange()) { final Map<Long, Object> idObjectMap = memoryStore.getElasticStore().removeRange(key, avroLongRange.getMin(), avroLongRange.getMax()); numObject += idObjectMap.size(); idObjectMapSet.add(idObjectMap); } final List<UnitIdPair> unitIdPairList = new ArrayList<>(numObject); for (final Map<Long, Object> idObjectMap : idObjectMapSet) { for (final Map.Entry<Long, Object> idObject : idObjectMap.entrySet()) { final UnitIdPair unitIdPair = UnitIdPair.newBuilder() .setUnit(ByteBuffer.wrap(codec.encode(idObject.getValue()))) .setId(idObject.getKey()) .build(); unitIdPairList.add(unitIdPair); } } sender.get().sendDataMsg(msg.getDestId().toString(), ctrlMsg.getDataClassName().toString(), unitIdPairList, TraceInfo.fromSpan(onCtrlMsgScope.getSpan())); } finally { onCtrlMsgScope.close(); } }
Source:
<code>public void extra(Collection<Object> o) { for (Object obj : o) { <START> if (obj instanceof String) <END> { addExtraSrgLine(obj.toString()); } else if (obj instanceof File || obj instanceof DelayedFile) { addSecondarySrgFile(obj); } else { throw new IllegalArgumentException("Extra srgs must be a file or string. Found " + o.getClass()); } } }</code><technical_language>need a GString check too</technical_language>

Target:
public void extra(Collection<Object> o) { for (Object obj : o) { if (obj instanceof String || obj instanceof GString) { addExtraSrgLine(obj.toString()); } else if (obj instanceof File || obj instanceof DelayedFile) { addSecondarySrgFile(obj); } else { throw new IllegalArgumentException("Extra srgs must be a file or string. Found " + o.getClass()); } } }
Source:
<code>IkeSaPayload(boolean critical, boolean isResp, byte[] payloadBody) throws IkeException { super(IkePayload.PAYLOAD_TYPE_SA, critical); ByteBuffer inputBuffer = ByteBuffer.wrap(payloadBody); proposalList = new LinkedList<>(); while (inputBuffer.hasRemaining()) { Proposal proposal = Proposal.readFrom(inputBuffer); proposalList.add(proposal); } if (proposalList.size() != 1 && <START> isResp) { <END> throw new InvalidSyntaxException( "Expected only one negotaited proposal from SA response: " + "Multiple negotaited proposals found."); } isSaResponse = isResp; }</code><technical_language>Nit: Order conditions in terms of scope (like naming) helps readability a :)</technical_language>

Target:
IkeSaPayload(boolean critical, boolean isResp, byte[] payloadBody) throws IkeException { super(IkePayload.PAYLOAD_TYPE_SA, critical); ByteBuffer inputBuffer = ByteBuffer.wrap(payloadBody); proposalList = new LinkedList<>(); while (inputBuffer.hasRemaining()) { Proposal proposal = Proposal.readFrom(inputBuffer); proposalList.add(proposal); } if (isResp && proposalList.size() != 1) { throw new InvalidSyntaxException( "Expected only one negotiated proposal from SA response: " + "Multiple negotiated proposals found."); } isSaResponse = isResp; }
Source:
<code>private void convertDataValues(ConvertFromSDKVisitor converter) { if (!PullController.PULL_IS_ACTIVE) return; callback.onStep(PullStep.PREPARING_SURVEYS); for (OrganisationUnitExtended organisationUnit : OrganisationUnitExtended.getExtendedList( SdkQueries.getAssignedOrganisationUnits())) { for (ProgramExtended program : ProgramExtended.getExtendedList( SdkQueries.getProgramsForOrganisationUnit(organisationUnit.getId(), ProgramType.WITHOUT_REGISTRATION))) { if(!program.isValidProgram()){ continue; <START> } <END> converter.actualProgram = program; List<EventExtended> events = EventExtended.getExtendedList( SdkQueries.getEvents(organisationUnit.getId(), program.getUid())); System.out.printf("Converting surveys and values for orgUnit: %s | program: %s", organisationUnit.getLabel(), program.getDisplayName()); for (EventExtended event : events) { if (!PullController.PULL_IS_ACTIVE) return; if (event.getEventDate() == null || event.getEventDate().equals("")) { Log.d(TAG, "Alert, ignoring event without eventdate, event uid:"+event.getUid()); continue; } event.accept(converter); } } } SurveyPlanner.getInstance().buildNext(); }</code><technical_language>Again, instead of adding this here, I change DB query retrieve valid programs</technical_language>

Target:
private void convertDataValues(ConvertFromSDKVisitor converter) { if (!PullController.PULL_IS_ACTIVE) return; callback.onStep(PullStep.PREPARING_SURVEYS); for (OrganisationUnitExtended organisationUnit : OrganisationUnitExtended.getExtendedList( SdkQueries.getAssignedOrganisationUnits())) { for (ProgramExtended program : ProgramExtended.getExtendedList( SdkQueries.getProgramsForOrganisationUnit(organisationUnit.getId(), PreferencesState.getInstance().getContext().getString(R.string.pull_program_code), ProgramType.WITHOUT_REGISTRATION))) { converter.actualProgram = program; List<EventExtended> events = EventExtended.getExtendedList( SdkQueries.getEvents(organisationUnit.getId(), program.getUid())); System.out.printf("Converting surveys and values for orgUnit: %s | program: %s", organisationUnit.getLabel(), program.getDisplayName()); for (EventExtended event : events) { if (!PullController.PULL_IS_ACTIVE) return; if (event.getEventDate() == null || event.getEventDate().equals("")) { Log.d(TAG, "Alert, ignoring event without eventdate, event uid:"+event.getUid()); continue; } event.accept(converter); } } } SurveyPlanner.getInstance().buildNext(); }
Source:
<code>public synchronized Group get( String name ) { boolean global = name == null; <START> if ( globalMode != null && global != globalMode.booleanValue() ) <END> { throw mixingOfGroupModesException(); } if ( name == null ) { return Group.GLOBAL; } Group group = byName.get( name ); if ( group == null ) { throw new HeaderException( "Group '" + name + "' not found. Available groups are: " + groupNames() ); } return group; }</code><technical_language>booleanValue() is needed</technical_language>

Target:
public synchronized Group get( String name ) { boolean global = name == null; if ( globalMode != null && global != globalMode ) { throw mixingOfGroupModesException(); } if ( name == null ) { return Group.GLOBAL; } Group group = byName.get( name ); if ( group == null ) { throw new HeaderException( "Group '" + name + "' not found. Available groups are: " + groupNames() ); } return group; }
Source:
<code>protected void runJmeter(boolean shouldCreateJmxFile) throws IOException { StandardJMeterEngine jmeter = new StandardJMeterEngine(); loadJmeterProperties(); HashTree testPlanTree = getLnpTestPlan(shouldCreateJmxFile); Summariser summer = null; String summariserName = JMeterUtils.getPropDefault("summariser.name", "summary"); if (summariserName.length() > 0) { summer = new Summariser(summariserName); } String resultFile = TestProperties.LNP_TEST_RESULTS_FOLDER + "/" + getClass().getSimpleName() + ".jtl"; ResultCollector logger = new ResultCollector(summer); logger.setFilename(resultFile); testPlanTree.add(testPlanTree.getArray()[0], logger); File file = new File(resultFile); if (file.exists()) { file.delete(); } jmeter.configure(testPlanTree); jmeter.run(); try { ReportGenerator reportGenerator = new ReportGenerator(resultFile, null); <START> reportGenerator.generate(); <END> } catch (Exception e) { log.warning(e.getMessage()); } }</code><technical_language>I tested this out. If deleting statistics.json file, need rename it. Otherwise, other test runs generate statistics. call this function here. java private boolean renameStatisticsFile() { File defaultFile = new File(TestProperties.LNP_TEST_RESULTS_FOLDER + "/statistics.json"); File lnpStatisticsFile = new File(TestProperties.LNP_TEST_RESULTS_FOLDER + getPathToStatisticsResultsFile()); if (lnpStatisticsFile.exists()) { lnpStatisticsFile.delete(); } return defaultFile.renameTo(lnpStatisticsFile); } private String getPathToStatisticsResultsFile() { return "/" + getClass().getSimpleName() + ".json"; }</technical_language>

Target:
protected void runJmeter(boolean shouldCreateJmxFile) throws IOException { StandardJMeterEngine jmeter = new StandardJMeterEngine(); setJmeterProperties(); HashTree testPlan = getLnpTestPlan(); if (shouldCreateJmxFile) { String pathToConfigFile = createFileAndDirectory( TestProperties.LNP_TEST_CONFIG_FOLDER, "/" + getClass().getSimpleName() + ".jmx"); SaveService.saveTree(testPlan, Files.newOutputStream(Paths.get(pathToConfigFile))); } Summariser summariser = null; String summariserName = JMeterUtils.getPropDefault("summariser.name", "summary"); if (summariserName.length() > 0) { summariser = new Summariser(summariserName); } String resultsFile = createFileAndDirectory(TestProperties.LNP_TEST_RESULTS_FOLDER, getJtlResultsPath()); ResultCollector resultCollector = new ResultCollector(summariser); resultCollector.setFilename(resultsFile); testPlan.add(testPlan.getArray()[0], resultCollector); jmeter.configure(testPlan); jmeter.run(); try { ReportGenerator reportGenerator = new ReportGenerator(resultsFile, null); reportGenerator.generate(); } catch (ConfigurationException | GenerationException e) { log.warning(e.getMessage()); } renameStatisticsFile(); }
Source:
<code>BigtableBufferedMutator( BigtableDataClient client, HBaseRequestAdapter adapter, Configuration configuration, BigtableOptions options, BufferedMutator.ExceptionListener listener, HeapSizeManager heapSizeManager, ExecutorService executorService) { this.adapter = adapter; this.configuration = configuration; this.exceptionListener = listener; this.host = options.getDataHost().toString(); this.asyncExecutor = new AsyncExecutor(client, heapSizeManager); LOG.info( "Initializing BigtableBufferd Mutator with %d channels, %,d byte heap size" + " and %d concurrent requests.", options.getChannelCount(), heapSizeManager.getMaxHeapSize(), heapSizeManager.getMaxInFlightRpcs()); this.options = options; this.heapSizeManager = heapSizeManager; <START> this.executorService = <END> executorService == null && options.getAsyncMutatorCount() > 0 ? createDefaultExecutorService() : executorService; }</code><technical_language>This is a bit weird, this depends "executorService" & "AsyncMutatorCount". depend AsyncMutatorCount. simpler: public BigtableBufferedMutator(...) this(... options.getAsyncMutatorCount() > 0 ? createDefaultExecutorService() : null); } @VisibleForTesting public BigtableBufferedMutator(...) ... this.executorService = executorService; }</technical_language>

Target:
BigtableBufferedMutator( BigtableDataClient client, HBaseRequestAdapter adapter, Configuration configuration, BigtableOptions options, BufferedMutator.ExceptionListener listener, HeapSizeManager heapSizeManager, ExecutorService executorService) { this.adapter = adapter; this.configuration = configuration; this.exceptionListener = listener; this.host = options.getDataHost().toString(); this.asyncExecutor = new AsyncExecutor(client, heapSizeManager); LOG.info( "Initializing BigtableBufferd Mutator with %d channels, %,d byte heap size" + " and %d concurrent requests.", options.getChannelCount(), heapSizeManager.getMaxHeapSize(), heapSizeManager.getMaxInFlightRpcs()); this.options = options; this.heapSizeManager = heapSizeManager; this.executorService = executorService; }
Source:
<code>public ServiceManagerEnvironment loadServiceManagerEnvironment(IServer server, boolean suppressErrors) { String minishiftLoc = MinishiftBinaryUtility.getMinishiftLocation(server); if (minishiftLoc == null || minishiftLoc.isEmpty() || !(new File(minishiftLoc).exists())) { if (!suppressErrors) { String msg = "Server " + server.getName() + " does not have a minishift location defined."; CDKCoreActivator.pluginLog().logError(msg); } return null; } Map<String, String> adbEnv = loadDockerEnv(server); Properties props = loadOpenshiftConsoleDetails(server, suppressErrors); String registry = getOpenshiftRegistry(server, suppressErrors); if (registry != null) props.put(ServiceManagerEnvironment.IMAGE_REGISTRY_KEY, registry); Map<String, String> merged = merge(adbEnv, props); Properties dotCDK = getCDKProperties(server); merged = merge(merged, dotCDK); File ocLocation = findOCLocation(server); if (ocLocation != null) { merged.put(OC_LOCATION_KEY, ocLocation.getAbsolutePath()); } try { ServiceManagerEnvironment env = new ServiceManagerEnvironment(merged); <START> env.setDefaultUsername("developer"); <END> return env; } catch (URISyntaxException urise) { if (!suppressErrors) { String msg = "Environment variable DOCKER_HOST is not a valid uri: " + merged.get("DOCKER_HOST"); CDKCoreActivator.pluginLog().logError(msg, urise); } return null; } }</code><technical_language>extract this a constant for improved visibility</technical_language>

Target:
public ServiceManagerEnvironment loadServiceManagerEnvironment(IServer server, boolean suppressErrors) { String minishiftLoc = MinishiftBinaryUtility.getMinishiftLocation(server); if (minishiftLoc == null || minishiftLoc.isEmpty() || !(new File(minishiftLoc).exists())) { if (!suppressErrors) { String msg = "Server " + server.getName() + " does not have a minishift location defined."; CDKCoreActivator.pluginLog().logError(msg); } return null; } Map<String, String> adbEnv = loadDockerEnv(server); Properties props = loadOpenshiftConsoleDetails(server, suppressErrors); String registry = getOpenshiftRegistry(server, suppressErrors); if (registry != null) props.put(ServiceManagerEnvironment.IMAGE_REGISTRY_KEY, registry); Map<String, String> merged = merge(adbEnv, props); Properties dotCDK = getCDKProperties(server); merged = merge(merged, dotCDK); File ocLocation = findOCLocation(server); if (ocLocation != null) { merged.put(OC_LOCATION_KEY, ocLocation.getAbsolutePath()); } try { ServiceManagerEnvironment env = new ServiceManagerEnvironment(merged); env.setDefaultUsername(ServiceManagerEnvironment.DEFAULT_MINISHIFT_USER); return env; } catch (URISyntaxException urise) { if (!suppressErrors) { String msg = "Environment variable DOCKER_HOST is not a valid uri: " + merged.get("DOCKER_HOST"); CDKCoreActivator.pluginLog().logError(msg, urise); } return null; } }
Source:
<code>public void afterClass() { if (this.globalClient != null) { <START> this.globalClient.close(); <END> } for (CosmosAsyncClient asyncClient : this.regionalClients) if (asyncClient != null) { asyncClient.close(); } }</code><technical_language>please TestSuiteBase:safeClose do null check</technical_language>

Target:
public void afterClass() { safeClose(this.globalClient); for (CosmosAsyncClient asyncClient : this.regionalClients) safeClose(asyncClient); }
Source:
<code>void delete() throws InfrastructureException { <START> String workspaceId = getWorkspaceId(); <END> String projectName = getName(); KubernetesClient client = clientFactory.create(workspaceId); delete(projectName, client); }</code><technical_language>In other places of this class workspaceid name is directly, getters? If need - other places changed well</technical_language>

Target:
void delete() throws InfrastructureException { KubernetesClient client = clientFactory.create(workspaceId); delete(name, client); }
Source:
<code>public void setupRemoteCacheFactory() { HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder(); serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler()); <START> hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19722, serverBuilder); <END> ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }</code><technical_language>A good opportunity hardcode port here, findFreePort()</technical_language>

Target:
public void setupRemoteCacheFactory() { HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder(); serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler()); hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, ServerTestingUtil.findFreePort(), serverBuilder); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
Source:
<code>private boolean searchForDuplicatesWithExistingVmDevices(VmDevice vmDeviceToHotplug){ <START> Pattern slotSearchPattern = Pattern.compile("slot=0x([0-9a-fA-F]*+)"); <END> String slotToHotplug = getPciSlotFromDevice(vmDeviceToHotplug, slotSearchPattern); if (slotToHotplug == null){ return false; } List<VmDevice> allVmDevices = getVmDeviceDao().getVmDeviceByVmId(getVm().getId()); for (VmDevice vmDevice : allVmDevices) { if (vmDevice.getIsManaged() && !vmDeviceToHotplug.getId().equals(vmDevice.getId())){ String deviceSlot = getPciSlotFromDevice(vmDevice, slotSearchPattern); if(deviceSlot != null && slotToHotplug.equals(deviceSlot)){ return true; } } } return false; }</code><technical_language>Please parse address completely, compare domain/bus/function well</technical_language>

Target:
private boolean searchForDuplicatesWithExistingVmDevices(VmDevice vmDeviceToHotplug){ Map<String, String> addressMapToHotplug = XmlRpcStringUtils.string2Map(vmDeviceToHotplug.getAddress()); if (!addressMapToHotplug.containsKey("slot")){ return false; } List<VmDevice> allVmDevices = getVmDeviceDao().getVmDeviceByVmId(getVm().getId()); for (VmDevice vmDevice : allVmDevices) { if (vmDevice.getIsManaged() && !vmDeviceToHotplug.getId().equals(vmDevice.getId())){ Map<String, String> deviceAddressMap = XmlRpcStringUtils.string2Map(vmDevice.getAddress()); if(deviceAddressMap.equals(addressMapToHotplug)) { return true; } } } return false; }
Source:
<code>private List<String> getMergedDimensions(List<IndexableAdapter> indexes) { if (indexes.size() == 0) { return ImmutableList.of(); } List<String> commonDimOrder = getLongestSharedDimOrder(indexes); if (commonDimOrder == null) { <START> return getLexicographicMergedDimensions(indexes); <END> } else { return commonDimOrder; } }</code><technical_language>do a log.warn here, this case is expected normal indexing</technical_language>

Target:
public static List<String> getMergedDimensions(List<IndexableAdapter> indexes) { if (indexes.size() == 0) { return ImmutableList.of(); } List<String> commonDimOrder = getLongestSharedDimOrder(indexes); if (commonDimOrder == null) { log.warn("Indexes have incompatible dimension orders, using lexicographic order."); return getLexicographicMergedDimensions(indexes); } else { return commonDimOrder; } }
Source:
<code>public int getExecutionIndex() { return 98; <START> } <END></code><technical_language>this reverted please</technical_language>

Target:
public int getExecutionIndex() { return 99; }
Source:
<code>public synchronized void suggestManualTime(ManualTimeSuggestion suggestion) { final TimestampedValue<Long> newUtcTime = suggestion.getUtcTime(); TimestampedValue<Long> <START> newTime = <END> suggestion.getUtcTime(); long elapsedRealtimeMillis = mCallback.elapsedRealtimeMillis(); if (elapsedRealtimeMillis < newTime.getReferenceTimeMillis()) { Slog.w(LOG_TAG, "New reference time is in the future?" + " elapsedRealtimeMillis=" + elapsedRealtimeMillis + ", timeSuggestion=" + suggestion); return; } String cause = "Manual time suggestion received: suggestion=" + suggestion; setSystemClockIfRequired(ORIGIN_MANUAL, newUtcTime, cause); }</code><technical_language>is this redundant newUtcTime</technical_language>

Target:
public synchronized void suggestManualTime(ManualTimeSuggestion suggestion) { final TimestampedValue<Long> newUtcTime = suggestion.getUtcTime(); long elapsedRealtimeMillis = mCallback.elapsedRealtimeMillis(); if (elapsedRealtimeMillis < newUtcTime.getReferenceTimeMillis()) { Slog.w(LOG_TAG, "New reference time is in the future? Ignoring." + " elapsedRealtimeMillis=" + elapsedRealtimeMillis + ", timeSuggestion=" + suggestion); return; } String cause = "Manual time suggestion received: suggestion=" + suggestion; setSystemClockIfRequired(ORIGIN_MANUAL, newUtcTime, cause); }
Source:
<code>protected void executeCommand() { Cluster cluster = getCluster(); cluster.setArchitecture(getArchitecture()); setCpuFlags(); if (cluster.getBiosType() == null || <START> cluster.getArchitecture() != ArchitectureType.undefined) { <END> setDefaultBiosType(); } setDefaultSwitchTypeIfNeeded(); setDefaultFirewallTypeIfNeeded(); setDefaultLogMaxMemoryUsedThresholdIfNeeded(); checkMaxMemoryOverCommitValue(); cluster.setDetectEmulatedMachine(true); cluster.setMacPoolId(calculateMacPoolIdToUse()); clusterDao.save(cluster); if (getParameters().isCompensationEnabled()) { getContext().getCompensationContext().snapshotNewEntity(cluster); getContext().getCompensationContext().stateChanged(); } alertIfFencingDisabled(); if (getParameters().getCluster().getStoragePoolId() != null) { attachManagementNetwork(); } addDefaultCpuProfile(); if (CollectionUtils.isNotEmpty(cluster.getAddtionalFeaturesSupported())) { for (SupportedAdditionalClusterFeature feature : cluster.getAddtionalFeaturesSupported()) { feature.setClusterId(cluster.getId()); } clusterFeatureDao.saveAll(cluster.getAddtionalFeaturesSupported()); } setActionReturnValue(cluster.getId()); setSucceeded(true); }</code><technical_language>This override biosType set user. If architecture is undefined biosType is null, biosType set CLUSTER_DEFAULT. If architecture is undefined, biosType set a default if biosType is null CLUSTER_DEFAULT</technical_language>

Target:
protected void executeCommand() { Cluster cluster = getCluster(); cluster.setArchitecture(getArchitecture()); setCpuFlags(); if (cluster.getBiosType() == null) { cluster.setBiosType(BiosType.CLUSTER_DEFAULT); } if (cluster.getBiosType() == BiosType.CLUSTER_DEFAULT && cluster.getArchitecture() != ArchitectureType.undefined) { setDefaultBiosType(); } setDefaultSwitchTypeIfNeeded(); setDefaultFirewallTypeIfNeeded(); setDefaultLogMaxMemoryUsedThresholdIfNeeded(); checkMaxMemoryOverCommitValue(); cluster.setDetectEmulatedMachine(true); cluster.setMacPoolId(calculateMacPoolIdToUse()); clusterDao.save(cluster); if (getParameters().isCompensationEnabled()) { getContext().getCompensationContext().snapshotNewEntity(cluster); getContext().getCompensationContext().stateChanged(); } alertIfFencingDisabled(); if (getParameters().getCluster().getStoragePoolId() != null) { attachManagementNetwork(); } addDefaultCpuProfile(); if (CollectionUtils.isNotEmpty(cluster.getAddtionalFeaturesSupported())) { for (SupportedAdditionalClusterFeature feature : cluster.getAddtionalFeaturesSupported()) { feature.setClusterId(cluster.getId()); } clusterFeatureDao.saveAll(cluster.getAddtionalFeaturesSupported()); } setActionReturnValue(cluster.getId()); setSucceeded(true); }
Source:
<code>public void testDescribe() throws Exception { ObjectId c1 = modify("aaa"); ObjectId c2 = modify("bbb"); tag("alice-t1"); ObjectId c3 = modify("ccc"); tag("bob-t2"); ObjectId c4 = modify("ddd"); assertNull(describe(c1)); assertNull(describe(c1, true)); assertEquals("alice-t1", describe(c2)); assertEquals("alice-t1", describe(c2, "alice*")); assertNull(describe(c2, "bob*")); assertEquals("bob-t2", describe(c3)); assertEquals("bob-t2-0-g44579eb", describe(c3, true)); assertEquals("alice-t1-1-g44579eb", describe(c3, "alice*")); assertEquals("bob-t2", describe(c3, "bob*")); assertNameStartsWith(c4, "3e563c5"); assertEquals("bob-t2-1-g3e563c5", describe(c4)); assertEquals("bob-t2-1-g3e563c5", describe(c4, true)); assertEquals("alice-t1-2-g3e563c5", describe(c4, "alice*")); assertEquals("bob-t2-1-g3e563c5", describe(c4, "bob*")); <START> <END> assertEquals("bob-t2-1-g3e563c5", git.describe().call()); }</code><technical_language>tests '?' wildcard ? if PathMatcher support '?' wildcards</technical_language>

Target:
public void testDescribe() throws Exception { ObjectId c1 = modify("aaa"); ObjectId c2 = modify("bbb"); tag("alice-t1"); ObjectId c3 = modify("ccc"); tag("bob-t2"); ObjectId c4 = modify("ddd"); assertNull(describe(c1)); assertNull(describe(c1, true)); assertNull(describe(c1, "a*", "b*", "c*")); assertEquals("alice-t1", describe(c2)); assertEquals("alice-t1", describe(c2, "alice*")); assertNull(describe(c2, "bob*")); assertNull(describe(c2, "?ob*")); assertEquals("alice-t1", describe(c2, "a*", "b*", "c*")); assertEquals("bob-t2", describe(c3)); assertEquals("bob-t2-0-g44579eb", describe(c3, true)); assertEquals("alice-t1-1-g44579eb", describe(c3, "alice*")); assertEquals("alice-t1-1-g44579eb", describe(c3, "a??c?-t*")); assertEquals("bob-t2", describe(c3, "bob*")); assertEquals("bob-t2", describe(c3, "?ob*")); assertEquals("bob-t2", describe(c3, "a*", "b*", "c*")); assertNameStartsWith(c4, "3e563c5"); assertEquals("bob-t2-1-g3e563c5", describe(c4)); assertEquals("bob-t2-1-g3e563c5", describe(c4, true)); assertEquals("alice-t1-2-g3e563c5", describe(c4, "alice*")); assertEquals("bob-t2-1-g3e563c5", describe(c4, "bob*")); assertEquals("bob-t2-1-g3e563c5", describe(c4, "a*", "b*", "c*")); assertEquals("bob-t2-1-g3e563c5", git.describe().call()); }
Source:
<code>public ExtensionMailboxInfo(@Nonnull final IMAPResponse[] resps) throws ParsingException { super(resps); for (int i = 0; i < resps.length; i++) { if (resps[i] == null) { continue; } final IMAPResponse ir = resps[i]; ir.skipSpaces(); if (ir.readByte() != '[') { ir.reset(); continue; } String key = ir.readAtom(); if (key == null) { ir.reset(); continue; } key = key.toUpperCase(); if (key.equals(MAILBOX_ID)) { final String[] values = ir.readSimpleList(); if (values != null && values.length >= 1) { mailboxId = values[0]; resps[i] = null; <START> break; <END> } } else if (key.equals(NOMODSEQ)) { isNoModSeq = true; } ir.reset(); } }</code><technical_language>u dont need remove break? a UT MAILBOX_ID NOMODSEQ if works this fix</technical_language>

Target:
public ExtensionMailboxInfo(@Nonnull final IMAPResponse[] resps) throws ParsingException { super(resps); for (int i = 0; i < resps.length; i++) { if (resps[i] == null) { continue; } final IMAPResponse ir = resps[i]; ir.skipSpaces(); if (ir.readByte() != '[') { ir.reset(); continue; } String key = ir.readAtom(); if (key == null) { ir.reset(); continue; } boolean handled = true; key = key.toUpperCase(); if (key.equals(MAILBOX_ID)) { final String[] values = ir.readSimpleList(); if (values != null && values.length >= 1) { mailboxId = values[0]; } else { handled = false; } } else if (key.equals(NOMODSEQ)) { isNoModSeq = true; } else { handled = false; } if (handled) { resps[i] = null; } else { ir.reset(); } } }
Source:
<code>static IBinding[] getBindingsFromScope(ICPPScope scope, LookupData data) throws DOMException { IBinding[] bindings= scope.getBindings(data); if (scope instanceof ICPPASTInternalScope && scope instanceof ICPPClassScope) { final IASTName lookupName = data.getLookupName(); if (LookupData.checkWholeClassScope(lookupName)) { CPPASTTranslationUnit tu = data.getTranslationUnit(); if (tu != null && tu.isForContentAssist()) { IIndex index = tu.getIndex(); IASTNode node = ((IASTInternalScope) scope).getPhysicalNode(); if (index != null && node != null && node.contains(lookupName)) { IBinding indexBinding= index.adaptBinding(((ICPPClassScope) scope).getClassType()); if (indexBinding instanceof ICPPClassType) { IScope scopeInIndex= ((ICPPClassType) indexBinding).getCompositeScope(); bindings= ArrayUtil.addAll(bindings, scopeInIndex.getBindings(data)); } } } } } if (data.ignoreRecursionResolvingBindings()) { bindings = ArrayUtil.filter(bindings, new RecursionResolvingBindingFilter()); } if (data.usingNamespacesOnly) { bindings = ArrayUtil.filter(bindings, (argument) <START> -> { <END> return argument instanceof ICPPNamespace; }); } return expandUsingDeclarationsAndRemoveObjects(bindings, data); }</code><technical_language>This Java 8 syntax is pretty nice :)</technical_language>

Target:
static IBinding[] getBindingsFromScope(ICPPScope scope, LookupData data) throws DOMException { IBinding[] bindings= scope.getBindings(data); if (scope instanceof ICPPASTInternalScope && scope instanceof ICPPClassScope) { final IASTName lookupName = data.getLookupName(); if (LookupData.checkWholeClassScope(lookupName)) { CPPASTTranslationUnit tu = data.getTranslationUnit(); if (tu != null && tu.isForContentAssist()) { IIndex index = tu.getIndex(); IASTNode node = ((IASTInternalScope) scope).getPhysicalNode(); if (index != null && node != null && node.contains(lookupName)) { IBinding indexBinding= index.adaptBinding(((ICPPClassScope) scope).getClassType()); if (indexBinding instanceof ICPPClassType) { IScope scopeInIndex= ((ICPPClassType) indexBinding).getCompositeScope(); bindings= ArrayUtil.addAll(bindings, scopeInIndex.getBindings(data)); } } } } } if (data.ignoreRecursionResolvingBindings()) { bindings = ArrayUtil.filter(bindings, new RecursionResolvingBindingFilter()); } if (data.namespacesOnly) { bindings = ArrayUtil.filter(bindings, (argument) -> { return argument instanceof ICPPNamespace; }); } return expandUsingDeclarationsAndRemoveObjects(bindings, data); }
Source:
<code>public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { <START> if (layerError == null || !layerError.hasSameSize(input)) { <END> layerError = matrixFactory.create(input.getRows(), input.getColumns()); } for (int n = 0; n < input.getColumns(); ++n) { final Matrix singleNextError = nextError.getColumn(n).reshape(outputShape[1] * outputShape[2], outputShape[0]); final Matrix row = singleNextError.mmul(getLayerParameter().getWeightParam().transpose()); final Matrix im = row2im(row); layerError.putColumn(n, im); } return layerError; }</code><technical_language>Number of rows of input change allow reshaping of layers. Thus, checking number of columns is enough</technical_language>

Target:
public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix error = matrixFactory.create(input.getRows(), input.getColumns()); for (int n = 0; n < input.getColumns(); ++n) { final Matrix singleNextError = nextError.getColumn(n).reshape(outputShape[1] * outputShape[2], outputShape[0]); final Matrix row = singleNextError.mmult(getLayerParameter().getWeightParam()); final Matrix im = row2im(row); error.putColumn(n, im); } return error; }
Source:
<code>public CompositeNotifyingFuture(List<NotifyingFuture<T>> futures) { this.futures = futures; this.remaining = new CountDownLatch(futures.size()); InternalListener internalListener = new InternalListener(); for (NotifyingFuture<T> future : futures) { <START> if (!future.isDone()) { <END> future.attachListener(internalListener); } else { internalListener.futureDone(future); } } }</code><technical_language>Race condition</technical_language>

Target:
public CompositeNotifyingFuture(List<NotifyingFuture<T>> futures) { this.futures = futures; this.remaining = new CountDownLatch(futures.size()); InternalListener internalListener = new InternalListener(); for (NotifyingFuture<T> future : futures) { future.attachListener(internalListener); } }
Source:
<code>private void parseJpaCacheStore(XMLExtendedStreamReader reader, JpaStoreConfigurationBuilder builder, ClassLoader classLoader) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = StringPropertyReplacer.replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case ENTITY_CLASS_NAME: { Class<?> clazz = Util.loadClass(value, classLoader); builder.entityClass(clazz); break; } case BATCH_SIZE: { builder.batchSize(Long.valueOf(value)); break; } case PERSISTENCE_UNIT_NAME: { builder.persistenceUnitName(value); break; } case STORE_METADATA: { builder.storeMetadata(Boolean.valueOf(value)); break; } default: { Parser.parseStoreAttribute(reader, i, builder); } } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { <START> Element element = Element.forName(reader.getLocalName()); <END> Parser.parseStoreElement(reader, builder); } }</code><technical_language>needed</technical_language>

Target:
private void parseJpaCacheStore(XMLExtendedStreamReader reader, JpaStoreConfigurationBuilder builder, ClassLoader classLoader) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = StringPropertyReplacer.replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case ENTITY_CLASS_NAME: { Class<?> clazz = Util.loadClass(value, classLoader); builder.entityClass(clazz); break; } case BATCH_SIZE: { builder.batchSize(Long.valueOf(value)); break; } case PERSISTENCE_UNIT_NAME: { builder.persistenceUnitName(value); break; } case STORE_METADATA: { builder.storeMetadata(Boolean.valueOf(value)); break; } default: { Parser.parseStoreAttribute(reader, i, builder); } } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Parser.parseStoreElement(reader, builder); } }
Source:
<code>private void display(ResultSet rows) { final int width1 = 38; final int width2 = 12; final int width3 = 30; final int width4 = 21; String format = <START> "%-" + width1 + "s" + "%-" + width2 + "s" + "%-" + width3 + "s" + "%-" + width4 + "s" <END> + "%n"; System.out.printf(format, "sensor_id", "date", "timestamp", "value"); drawLine(width1, width2, width3, width4); for (Row row : rows) { System.out.printf( format, row.getUuid("sensor_id"), row.getLocalDate("date"), row.getInstant("timestamp"), row.getDouble("value")); } }</code><technical_language>String concatenation avoided</technical_language>

Target:
private void display(ResultSet rows) { final int width1 = 38; final int width2 = 12; final int width3 = 30; final int width4 = 21; String format = "%-" + width1 + "s%-" + width2 + "s%-" + width3 + "s%-" + width4 + "s%n"; System.out.printf(format, "sensor_id", "date", "timestamp", "value"); drawLine(width1, width2, width3, width4); for (Row row : rows) { System.out.printf( format, row.getUuid("sensor_id"), row.getLocalDate("date"), row.getInstant("timestamp"), row.getDouble("value")); } }
Source:
<code>private void setUpSkipDialog() { Button skipForNowButton = (Button) findViewById(R.id.button_skip_for_now); skipForNowButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit() <START> .putBoolean("SKIPPED", true) <END> .apply(); AnalyticsTracker.getInstance(getApplicationContext()).trackEvent("Skipped account creation/login", loggedIn); Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); } }); }</code><technical_language>Constant</technical_language>

Target:
private void setUpSkipDialog() { Button skipForNowButton = (Button) findViewById(R.id.button_skip_for_now); skipForNowButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); } }); }
Source:
<code>public void validateViewPointModel() { URI createPlatformPluginURI = URI.createPlatformPluginURI(VIEWPOINT_MODEL_PATH, true); Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true); Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0)); <START> Assert.assertEquals("The internalBlockDiagram.configuration model is not valid ", Diagnostic.OK, diagnostic.getSeverity()); <END> }</code><technical_language>parametric</technical_language>

Target:
public void validateViewPointModel() { URI createPlatformPluginURI = URI.createPlatformPluginURI(VIEWPOINT_MODEL_PATH, true); Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true); Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0)); Assert.assertEquals("The parametricDiagram.configuration viewpoint model is not valid ", Diagnostic.OK, diagnostic.getSeverity()); }
Source:
<code>public String toString() { <START> return "ConfigurableSslSocketFactory{delegate=" + delegate + '}'; <END> }</code><technical_language>this KeepAliveSslSocketFactory</technical_language>

Target:
public String toString() { return "KeepAliveSslSocketFactory{delegate=" + delegate + '}'; }
Source:
<code>@Test public void privateConstructorsFail() { class Test { @Inject private Test() { } } @Module(entryPoints = Test.class) class TestModule { } try { <START> ObjectGraph.create(new TestModule()).get(Test.class); <END> } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Can't inject private constructor: "); } }</code><technical_language>similarly</technical_language>

Target:
@Test public void privateConstructorsFail() { class Test { @Inject private Test() { } } @Module(entryPoints = Test.class) class TestModule { } try { ObjectGraph.create(new TestModule()).get(Test.class); fail(); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Can't inject private constructor: "); } }
Source:
<code>private void write(String line) throws InterruptedException { int currentRetry = 0; while (currentRetry < MAX_RETRIES) { try { writer.write(line.getBytes(StandardCharsets.UTF_8)); break; } catch (IOException e) { currentRetry++; if (currentRetry < MAX_RETRIES) { LOG.warn("failed to write data with maxRetries due to", currentRetry, e); } else { <START> LOG.error("failed to write data with maxRetries due to", currentRetry, e); <END> } Thread.sleep(100 * currentRetry * currentRetry); writer = openWriterAppendMode(); } } }</code><technical_language>break instead of sleep reopen file exiting loop</technical_language>

Target:
private void write(String line) throws InterruptedException { int currentRetry = 0; while (currentRetry < MAX_RETRIES) { try { writer.write(line.getBytes(StandardCharsets.UTF_8)); break; } catch (IOException e) { currentRetry++; if (currentRetry < MAX_RETRIES) { LOG.warn("failed to write data with maxRetries due to", currentRetry, e); } else { LOG.error("failed to write data with maxRetries due to", currentRetry, e); throw new RuntimeException("failed to write data", e); } Thread.sleep(100 * currentRetry * currentRetry); writer = openWriterAppendMode(); } } }
Source:
<code>private String getName0() { <START> String name = uri.getPath(); <END> name = name.substring(name.lastIndexOf("/") + 1); return name.replaceAll("\\W", ""); }</code><technical_language>Qualify this.uri</technical_language>

Target:
private String getName0() { String name = this.uri.getPath(); name = name.substring(name.lastIndexOf("/") + 1); return name.replaceAll("\\W", ""); }
Source:
<code>public List<PMMLMiningField> getMiningFields() { List<PMMLMiningField> fields = super.getMiningFields(); for (PMMLMiningField field : fields) { String type = field.getType(); if (type == null || type.trim().isEmpty()) { fields.remove(field); } } if (this.segmentation != null) { segmentation.getMiningSegments().forEach(ms -> { PMML4Model model = ms.getModel(); List<PMMLMiningField> innerFields = model.getMiningFields(); <START> innerFields.stream().filter(fld -> !fields.contains(fld)).forEach(fld -> {fields.add(fld);}); <END> }); } return fields; }</code><technical_language>I guess code in this if block rewritten segmentation.getMiningSegments().stream().flatMap( ms -> ms.getModel().getMiningFields().stream() ).filter(fld -> !fields.contains(fld)).forEach( fields::add )</technical_language>

Target:
public List<PMMLMiningField> getMiningFields() { List<PMMLMiningField> fields = super.getMiningFields(); for (PMMLMiningField field : fields) { String type = field.getType(); if (type == null || type.trim().isEmpty()) { fields.remove(field); } } if (this.segmentation != null) { segmentation.getMiningSegments().stream() .flatMap(ms -> ms.getModel().getMiningFields().stream() ) .filter(fld -> !fields.contains(fld)) .forEach(fields::add); } return fields; }
Source:
<code>@Test public void deleteBuildsShouldSuccessEvenTheBuildIsRunning() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); <START> project.getBuildersList().add(new Shell("echo 1\nsleep 10s")); <END> assertThat("Job wasn't scheduled properly", project.scheduleBuild(0), equalTo(true)); while(!project.isBuilding()) { System.out.println("Waiting for build to start and sleep 1s..."); Thread.sleep(1000); } if(!project.getBuildByNumber(1).getLog().contains("echo 1")) { Thread.sleep(1000); } final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Job.READ, Run.DELETE) .invokeWithArgs("aProject", "1"); assertThat(result, succeeded()); assertThat(result.stdout(), containsString("Deleted 1 builds")); assertThat(((FreeStyleProject) j.jenkins.getItem("aProject")).getBuilds().size(), equalTo(0)); assertThat(project.isBuilding(), equalTo(false)); }</code><technical_language>This is fragile. ExecutorTest.BlockingBuilder used</technical_language>

Target:
@Test public void deleteBuildsShouldSuccessEvenTheBuildIsRunning() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); ExecutorTest.startBlockingBuild(project); assertThat(((FreeStyleProject) j.jenkins.getItem("aProject")).getBuilds(), hasSize(1)); final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Job.READ, Run.DELETE) .invokeWithArgs("aProject", "1"); assertThat(result, succeeded()); assertThat(result.stdout(), containsString("Deleted 1 builds")); assertThat(((FreeStyleProject) j.jenkins.getItem("aProject")).getBuilds(), hasSize(0)); assertThat(project.isBuilding(), equalTo(false)); }
Source:
<code>public void testAllFlagsReverseOrder() { int flagAsInteger = 0; for (final SAMFlag samFlag : SAMFlag.values()) { flagAsInteger |= samFlag.flag; } <START> final String flagAsString = new StringBuilder("urURpP12sSqd").reverse().toString(); <END> Assert.assertEquals(flagAsInteger, SamFlagField.STRING.parse(flagAsString)); }</code><technical_language>q</technical_language>

Target:
public void testAllFlagsReverseOrder() { int flagAsInteger = 0; for (final SAMFlag samFlag : SAMFlag.values()) { flagAsInteger |= samFlag.flag; } final String flagAsString = new StringBuilder("urURpP12sSxd").reverse().toString(); Assert.assertEquals(flagAsInteger, SamFlagField.STRING.parse(flagAsString)); Assert.assertEquals(SamFlagField.STRING.parse(flagAsString), flagAsInteger); }
Source:
<code>public static Map<String, String> getLabelNameMap(String filePath) { Map<String, String> labelNameMap = new HashMap<>(); try { BufferedReader reader = new BufferedReader(new FileReader(filePath)); String line; while ((line = reader.readLine()) != null) { if (line.isEmpty()) continue; String[] tokens = line.split("\t", 2); String labelId = tokens[0].trim(); String labelName = tokens[1].trim(); labelNameMap.put(labelId, labelName); } reader.close(); <START> } catch (Exception e) { <END> e.printStackTrace(); } return labelNameMap; }</code><technical_language>please swallow exceptions. Re-throw chain</technical_language>

Target:
static Map<String, String> getLabelNameMap(String filePath) { Map<String, String> labelNameMap = new HashMap<>(); try(BufferedReader reader = new BufferedReader(new FileReader(filePath))) { String line; while ((line = reader.readLine()) != null) { if (line.isEmpty()) continue; String[] tokens = line.split("\t", 2); String labelId = tokens[0].trim(); String labelName = tokens[1].trim(); labelNameMap.put(labelId, labelName); } } catch (IOException e) { e.printStackTrace(); logger.error("IO Error while reading the file at " + filePath); throw new RuntimeException("IO Error while reading the file at " + filePath); } return labelNameMap; }
Source:
<code>public String getName() { <START> return "PROCESS DEFINTIONS"; <END> }</code><technical_language>please move static field. suggestion return "PROCESS DEFINITIONS";</technical_language>

Target:
public String getName() { return TYPE_NAME; }
Source:
<code>public Fragment getFragment(final Context context) { if (playlistType == LocalItemType.PLAYLIST_LOCAL_ITEM) { return LocalPlaylistFragment.getInstance(playlistId, <START> playlistName == null ? "" : playlistName); <END> } else { return PlaylistFragment.getInstance(playlistServiceId, playlistUrl, playlistName == null ? "" : playlistName); } }</code><technical_language>If is playlist name is null, add @Nullable declaration, remove this check (also below)</technical_language>

Target:
public Fragment getFragment(final Context context) { if (playlistType == LocalItemType.PLAYLIST_LOCAL_ITEM) { return LocalPlaylistFragment.getInstance(playlistId, playlistName); } else { return PlaylistFragment.getInstance(playlistServiceId, playlistUrl, playlistName); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); fromManager = getIntent().getBooleanExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, false); <START> if (!checkForMultipleAppsViolation()) { <END> loadIntentAndInstanceState(savedInstanceState); persistCommCareAppState(); if (isSingleAppBuild()) { uiState = UiState.BLANK; } boolean askingForPerms = Permissions.acquireAllAppPermissions(this, this, Permissions.ALL_PERMISSIONS_REQUEST); if (!askingForPerms) { if (isSingleAppBuild()) { SingleAppInstallation.installSingleApp(this, DIALOG_INSTALL_PROGRESS); } else { performSMSInstall(false); } } } }</code><technical_language>mind leaving this logic was? I this pattern in general, in scenarios this important code called this line if returns true, feels easier for in future accidentally add code this if statement messes up</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); fromManager = getIntent().getBooleanExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, false); if (checkForMultipleAppsViolation()) { return; } loadIntentAndInstanceState(savedInstanceState); persistCommCareAppState(); if (isSingleAppBuild()) { uiState = UiState.BLANK; } boolean askingForPerms = Permissions.acquireAllAppPermissions(this, this, Permissions.ALL_PERMISSIONS_REQUEST); if (!askingForPerms) { if (isSingleAppBuild()) { SingleAppInstallation.installSingleApp(this, DIALOG_INSTALL_PROGRESS); } else { performSMSInstall(false); } } }