auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public final void registerResourceWebscript() throws IOException { if (resourcePatternResolver == null) { return; } final Resource[] resources = resourcePatternResolver.getResources("osgibundle:" + WEB_PATH + "**"); if (resources.length == 0) { return; } if (bundleContext == null) { <START> Intrinsics.throwNpe(); <END> } if (webscriptRegistry == null) { Intrinsics.throwNpe(); } currentWebscript = new ResourceWebscript(bundleContext); webscriptRegistry.registerWebScript(currentWebscript); }</code><technical_language>literal translation Kotlin throws a NPE (because ResourceWebscript a @NotNull constructor argument calles !! postfix) throwing a null-pointer-exception is ideal</technical_language>

Target:
public final void registerResourceWebscript() throws IOException { if (resourcePatternResolver == null) { return; } final Resource[] resources = resourcePatternResolver.getResources("osgibundle:" + WEB_PATH + "**"); if (resources.length == 0) { return; } if (bundleContext == null) { throw new IllegalStateException("bundleContext"); } if (webscriptRegistry == null) { throw new IllegalStateException("webscriptRegistry"); } currentWebscript = new ResourceWebscript(bundleContext); webscriptRegistry.registerWebScript(currentWebscript); }
Source:
<code>private ImmutableSortedMap<String, ImmutableList<String>> readMap(final String mapPath) { String fileContent; String actualPath = mapPath; try { if (Strings.isNullOrEmpty(mapPath)) { actualPath = this.getClass().getClassLoader().getResource("defaultWhiteListMap.json").getFile(); LOGGER.info("using default whiteList map located at [%s]", actualPath); <START> InputStream byteContent = this.getClass().getClassLoader().getResourceAsStream("defaultWhiteListMap.json"); <END> try (final InputStreamReader in = new InputStreamReader(byteContent, StandardCharsets.UTF_8)) { fileContent = CharStreams.toString(in); } } else { fileContent = Files.asCharSource(new File(mapPath), StandardCharsets.UTF_8).read(); } return mapper.readerFor(new TypeReference<ImmutableSortedMap<String, ImmutableList<String>>>() { }).readValue(fileContent); } catch (IOException e) { throw new ISE(e, "Got an exception while parsing file [%s]", actualPath); } }</code><technical_language>Simpler java defaultWhiteListMapUrl = this.getClass().getClassLoader().getResource("defaultWhiteListMap.json"); actualPath = defaultWhiteListMapUrl.getFile(); LOGGER.info(...); fileContent = Resources.toString(defaultWhiteListMapUrl, StandardCharsets.UTF_8);</technical_language>

Target:
private ImmutableSortedMap<String, ImmutableList<String>> readMap(final String mapPath) { String fileContent; String actualPath = mapPath; try { if (Strings.isNullOrEmpty(mapPath)) { URL defaultWhiteListMapUrl = this.getClass().getClassLoader().getResource("defaultWhiteListMap.json"); actualPath = defaultWhiteListMapUrl.getFile(); LOGGER.info("using default whiteList map located at [%s]", actualPath); fileContent = Resources.toString(defaultWhiteListMapUrl, StandardCharsets.UTF_8); } else { fileContent = Files.asCharSource(new File(mapPath), StandardCharsets.UTF_8).read(); } return mapper.readerFor(new TypeReference<ImmutableSortedMap<String, ImmutableList<String>>>() { }).readValue(fileContent); } catch (IOException e) { throw new ISE(e, "Got an exception while parsing file [%s]", actualPath); } }
Source:
<code>private synchronized BridgeHandler getDssBridgeHandler() { if (this.dssBridgeHandler == null) { Bridge bridge = getBridge(); if (bridge == null) { logger.debug("Bride cannot be found"); return null; } ThingHandler handler = bridge.getHandler(); if (handler instanceof BridgeHandler) { dssBridgeHandler = (BridgeHandler) handler; } else { return null; } } if (temperatureSensorTransmitter == null && zoneID != null) { <START> dssBridgeHandler.registerTemperatureControlStatusListener(this); <END> } return dssBridgeHandler; }</code><technical_language>register listeners in a getter</technical_language>

Target:
private synchronized BridgeHandler getDssBridgeHandler() { if (this.dssBridgeHandler == null) { Bridge bridge = getBridge(); if (bridge == null) { logger.debug("Bride cannot be found"); return null; } ThingHandler handler = bridge.getHandler(); if (handler instanceof BridgeHandler) { dssBridgeHandler = (BridgeHandler) handler; } else { return null; } } return dssBridgeHandler; }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length > 1) { throw new IllegalArgumentException("wrong number of arguments"); } else if (args.length != 1) { throw new IllegalArgumentException("port parameter not supplied"); } URL log4jProperties = SarosLauncher.class.getResource(LOGGING_CONFIG_FILE); PropertyConfigurator.configure(log4jProperties); <START> LogOutputStream los = new LogOutputStream(LOG, Level.DEBUG); <END> PrintStream ps = new PrintStream(los); System.setOut(ps); int port = Integer.parseInt(args[0]); Socket socket = new Socket("localhost", port); LOG.info("listening on port " + port); Runtime.getRuntime() .addShutdownHook( new Thread() { public void run() { try { socket.close(); } catch (IOException e) { } } }); SarosLanguageServer langSvr = new SarosLanguageServer(); Launcher<ISarosLanguageClient> l = Launcher.createLauncher( langSvr, ISarosLanguageClient.class, socket.getInputStream(), socket.getOutputStream()); ISarosLanguageClient langClt = l.getRemoteProxy(); LOG.addAppender(new LanguageClientAppender(langClt)); langSvr.connect(langClt); l.startListening(); }</code><technical_language>do need this extra logger if log4j console logger</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length > 1) { throw new IllegalArgumentException("wrong number of arguments"); } else if (args.length != 1) { throw new IllegalArgumentException("port parameter not supplied"); } else if (!args[0].matches("\\d+")) { throw new IllegalArgumentException("port is not a number"); } URL log4jProperties = SarosLauncher.class.getResource(LOGGING_CONFIG_FILE); PropertyConfigurator.configure(log4jProperties); LOG.addAppender(new ConsoleAppender()); int port = Integer.parseInt(args[0]); Socket socket = new Socket("localhost", port); LOG.info("listening on port " + port); Runtime.getRuntime() .addShutdownHook( new Thread() { public void run() { try { socket.close(); } catch (IOException e) { } } }); SarosLanguageServer langSvr = new SarosLanguageServer(); Launcher<ISarosLanguageClient> l = Launcher.createLauncher( langSvr, ISarosLanguageClient.class, socket.getInputStream(), socket.getOutputStream()); ISarosLanguageClient langClt = l.getRemoteProxy(); LOG.addAppender(new LanguageClientAppender(langClt)); langSvr.connect(langClt); l.startListening(); }
Source:
<code>public void throttlerTest() throws InterruptedException { MockTime time = new MockTime(); time.currentMilliseconds = 0; time.currentNanoSeconds = 0; time.sleepTimeExpected = 0; Throttler throttler = new Throttler(100, 10, true, time); throttler.maybeThrottle(50); Assert.assertEquals(time.currentMilliseconds, 0); time.currentNanoSeconds = 11 * Time.NsPerMs; time.currentMilliseconds = 11; time.sleepTimeExpected = 1489; throttler.maybeThrottle(100); time.currentNanoSeconds = 22 * Time.NsPerMs; time.currentMilliseconds = 22; time.sleepTimeExpected = 4989; throttler.maybeThrottle(500); <START> System.out.println(time.currentMilliseconds); <END> }</code><technical_language>testing printing</technical_language>

Target:
public void throttlerTest() throws InterruptedException { MockTime time = new MockTime(); time.currentMilliseconds = 0; time.currentNanoSeconds = 0; time.sleepTimeExpected = 0; Throttler throttler = new Throttler(100, 10, true, time); throttler.maybeThrottle(50); Assert.assertEquals(time.currentMilliseconds, 0); time.currentNanoSeconds = 11 * Time.NsPerMs; time.currentMilliseconds = 11; time.sleepTimeExpected = 1489; throttler.maybeThrottle(100); time.currentNanoSeconds = 22 * Time.NsPerMs; time.currentMilliseconds = 22; time.sleepTimeExpected = 4989; throttler.maybeThrottle(500); Assert.assertEquals(time.currentMilliseconds, 5011); }
Source:
<code>public Application approveApplication(PerunSession session, Application app) throws PerunException { User user = app.getUser(); Group group = app.getGroup(); AttributesManager am = session.getPerun().getAttributesManager(); Attribute attestation = am.getAttribute(session, group, A_G_D_groupAttestation); String newValue = attestation.valueAsString(); Attribute bonaFideStatus = am.getAttribute(session, user, A_U_D_userBonaFideStatus); List<String> value = new ArrayList<>(); if (bonaFideStatus.getValue() == null) { <START> value = bonaFideStatus.valueAsList(); <END> } value.add(newValue); bonaFideStatus.setValue(value); am.setAttribute(session, user, bonaFideStatus); return app; }</code><technical_language>This is suspicious. init empty list named if bonaFideStatus is null set this null value. call value.add() null fail null pointer. thought .valueAsList() returns empty list for null value, perform silent uncheck assignment ArrayList<String></technical_language>

Target:
public Application approveApplication(PerunSession session, Application app) throws PerunException { User user = app.getUser(); Group group = app.getGroup(); AttributesManager am = session.getPerun().getAttributesManager(); Attribute attestation = am.getAttribute(session, group, A_G_D_groupAttestation); String newValue = attestation.valueAsString(); Attribute bonaFideStatus = am.getAttribute(session, user, A_U_D_userBonaFideStatus); List<String> value = new ArrayList<>(); if (bonaFideStatus.getValue() != null && bonaFideStatus.valueAsList() != null) { value = bonaFideStatus.valueAsList(); } value.add(newValue); bonaFideStatus.setValue(value); am.setAttribute(session, user, bonaFideStatus); return app; }
Source:
<code>public boolean equals(Object object) { if (!(object instanceof Person)) { return false; } else { <START> return getId().equals(((Person) object).getId()); <END> } }</code><technical_language>a reference equality check first</technical_language>

Target:
public boolean equals(Object object) { if (this == object) { return true; } else if (!(object instanceof Person)) { return false; } else { return getId().equals(((Person) object).getId()); } }
Source:
<code>protected RuleResultMetadata createRuleResultMetadata(final PasswordData password) { final Map<String, Object> m = new LinkedHashMap<>(); m.put( <START> "whitespaceCharacterCount", <END> PasswordUtils.countMatchingCharacters(String.valueOf(whitespaceCharacters), password.getPassword())); return new RuleResultMetadata(m); }</code><technical_language>I keys overly wordy. _whitespaceCount_ perfectly clear more succinct besides</technical_language>

Target:
protected RuleResultMetadata createRuleResultMetadata(final PasswordData password) { return new RuleResultMetadata( RuleResultMetadata.CountCategory.Whitespace, PasswordUtils.countMatchingCharacters(String.valueOf(whitespaceCharacters), password.getPassword())); }
Source:
<code>public void testCheckpointWriteErrorCount() throws Exception { int checkpointInterval = 1000; FileChannel channel = createFileChannel(Collections.singletonMap( FileChannelConfiguration.CHECKPOINT_INTERVAL, String.valueOf(checkpointInterval))); channel.start(); Transaction tx = channel.getTransaction(); tx.begin(); channel.put(EventBuilder.withBody("test".getBytes())); tx.commit(); tx.close(); long beforeCheckpointWrite = System.currentTimeMillis(); Thread.sleep(checkpointInterval + 100); assertEquals(0, channel.getChannelCounter().getCheckpointWriteErrorCount()); assertTrue(new File(checkpointDir, "checkpoint").lastModified() > beforeCheckpointWrite); FileUtils.deleteDirectory(baseDir); <START> Thread.sleep(checkpointInterval + 100); <END> assertEquals(1, channel.getChannelCounter().getCheckpointWriteErrorCount()); }</code><technical_language>This is flaky system load. fail running this test in a loop while running stress -c 16 in another terminal. I suggest this: FileUtils.deleteDirectory(baseDir); final long TIMEOUT_MILLIS = 15000; while (System.currentTimeMillis() < beforeCheckPointWrite + TIMEOUT_MILLIS) { if (channel.getChannelCounter().getCheckpointWriteErrorCount() > 0) { break; } Thread.sleep(10); } // channel's directory deleted checkpoint write failed assertThat("checkpointWriteErrorCount", channel.getChannelCounter().getCheckpointWriteErrorCount(), greaterThan(0)); wrap loop in a helper function a lambda expression, i.e. void assertEventuallyTrue(String description, BooleanSupplier expr, long timeoutMillis) { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + timeoutMillis) { if (expr.getAsBoolean()) break; Thread.sleep(10); // Sleep for 10ms retry } assertTrue(desc, expr.getAsBoolean()); } FileUtils.deleteDirectory(baseDir); long timeoutMillis = 15000; assertEventuallyTrue("checkpointWriteErrorCount > 0", () -> channel.getChannelCounter().getCheckpointWriteErrorCount() > 0, timeoutMillis);</technical_language>

Target:
public void testCheckpointWriteErrorCount() throws Exception { int checkpointInterval = 1500; final FileChannel channel = createFileChannel(Collections.singletonMap( FileChannelConfiguration.CHECKPOINT_INTERVAL, String.valueOf(checkpointInterval))); channel.start(); Transaction tx = channel.getTransaction(); tx.begin(); channel.put(EventBuilder.withBody("test".getBytes())); tx.commit(); tx.close(); final long beforeCheckpointWrite = System.currentTimeMillis(); assertEventuallyTrue("checkpoint should have been written", new BooleanPredicate() { @Override public boolean get() { return new File(checkpointDir, "checkpoint").lastModified() > beforeCheckpointWrite; } }, checkpointInterval * 3); assertEquals(0, channel.getChannelCounter().getCheckpointWriteErrorCount()); FileUtils.deleteDirectory(baseDir); assertEventuallyTrue("checkpointWriterErrorCount should be 1", new BooleanPredicate() { @Override public boolean get() { return channel.getChannelCounter().getCheckpointWriteErrorCount() == 1; } }, checkpointInterval * 3); }
Source:
<code>public static Block toArray(ArrayType arrayType, BlockBuilderAppender elementAppender, ConnectorSession connectorSession, Slice json) { try (JsonParser jsonParser = createJsonParser(JSON_FACTORY, json)) { jsonParser.nextToken(); if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) { return null; } checkState(jsonParser.currentToken() == JsonToken.START_ARRAY, "Expected a json array"); BlockBuilder blockBuilder = arrayType.getElementType().createBlockBuilder(new BlockBuilderStatus(), 20); while (jsonParser.nextValue() != JsonToken.END_ARRAY) { <START> elementAppender.append(jsonParser, blockBuilder); <END> } return blockBuilder.build(); } catch (RuntimeException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast '%s' to %s", json.toStringUtf8(), arrayType), e); } catch (IOException e) { throw Throwables.propagate(e); } }</code><technical_language>measure a cache PageBuilder here? code a bit more complicated though</technical_language>

Target:
public static Block toArray(ArrayType arrayType, BlockBuilderAppender elementAppender, ConnectorSession connectorSession, Slice json) { try (JsonParser jsonParser = createJsonParser(JSON_FACTORY, json)) { jsonParser.nextToken(); if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) { return null; } if (jsonParser.getCurrentToken() != START_ARRAY) { throw new JsonCastException(format("Expected a json array, but got %s", jsonParser.getText())); } BlockBuilder blockBuilder = arrayType.getElementType().createBlockBuilder(new BlockBuilderStatus(), 20); while (jsonParser.nextToken() != JsonToken.END_ARRAY) { elementAppender.append(jsonParser, blockBuilder); } if (jsonParser.nextToken() != null) { throw new JsonCastException(format("Unexpected trailing token: %s", jsonParser.getText())); } return blockBuilder.build(); } catch (PrestoException | JsonCastException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast to %s. %s\n%s", arrayType, e.getMessage(), truncateIfNecessaryForErrorMessage(json)), e); } catch (Exception e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast to %s.\n%s", arrayType, truncateIfNecessaryForErrorMessage(json)), e); } }
Source:
<code>public void openCore(DataSetProcessor dsp) throws StandardException{ try { <START> submittedTime = new SimpleDateFormat(timeStampFormat).format(new Date()); <END> if (LOG.isTraceEnabled()) LOG.trace(String.format("openCore %s", this)); isOpen = true; String sql = activation.getPreparedStatement().getSource(); if (!(this instanceof ExplainOperation || activation.isMaterialized())) activation.materialize(); long txnId=getCurrentTransaction().getTxnId(); sql=sql==null?this.toString():sql; String userId=activation.getLanguageConnectionContext().getCurrentUserId(activation); activation.getLanguageConnectionContext().setControlExecutionLimiter(EngineDriver.driver().processorFactory().getControlExecutionLimiter(activation)); returnedRows = false; engineName = (dsp.getType() == DataSetProcessor.Type.SPARK) ? "SPARK" : "CONTROL"; if (dsp.getType() == DataSetProcessor.Type.SPARK) { this.jobName = userId + " <" + txnId + ">"; dsp.setJobGroup(jobName, sql); } dsp.clearBroadcastedOperation(); this.execRowIterator =getDataSet(dsp).toLocalIterator(); } catch (ResubmitDistributedException e) { resubmitDistributed(e); }catch(Exception e){ checkInterruptedException(e); throw Exceptions.parseException(e); } }</code><technical_language>expensive... open core please</technical_language>

Target:
public void openCore(DataSetProcessor dsp) throws StandardException{ try { if (LOG.isTraceEnabled()) LOG.trace(String.format("openCore %s", this)); isOpen = true; String sql = activation.getPreparedStatement().getSource(); if (!(this instanceof ExplainOperation || activation.isMaterialized())) activation.materialize(); long txnId=getCurrentTransaction().getTxnId(); sql=sql==null?this.toString():sql; String userId=activation.getLanguageConnectionContext().getCurrentUserId(activation); activation.getLanguageConnectionContext().setControlExecutionLimiter(EngineDriver.driver().processorFactory().getControlExecutionLimiter(activation)); returnedRows = false; if (dsp.getType() == DataSetProcessor.Type.SPARK) { this.jobName = userId + " <" + txnId + ">"; dsp.setJobGroup(jobName, sql); } dsp.clearBroadcastedOperation(); this.execRowIterator =getDataSet(dsp).toLocalIterator(); } catch (ResubmitDistributedException e) { resubmitDistributed(e); }catch(Exception e){ checkInterruptedException(e); throw Exceptions.parseException(e); } }
Source:
<code>public static Jenkins getInstance() { Jenkins instance = HOLDER.getInstance(); if (instance == null) { IllegalStateException ise = new IllegalStateException("Jenkins has not been started, or was already shut down"); if (Boolean.getBoolean(Jenkins.class.getName() + ".disableExceptionOnNullInstance")) { <START> LOGGER.log(Level.WARNING, "Perhaps you meant to use Jenkins.getInstanceOrNull?", ise); <END> } else { throw ise; } } return instance; }</code><technical_language>bug: If agent unable load Jenkins do encourage code possible, instead encourage of agent usable test api: meant JenkinsJVM.isJenkinsJVM()</technical_language>

Target:
public static Jenkins getInstance() { Jenkins instance = HOLDER.getInstance(); if (instance == null) { IllegalStateException ise = new IllegalStateException("Jenkins has not been started, or was already shut down"); if (Boolean.getBoolean(Jenkins.class.getName() + ".disableExceptionOnNullInstance")) { LOGGER.log(Level.WARNING, "Use Jenkins.getInstanceOrNull if potentially running just before startup, or in asynchronous code just before shutdown; use JenkinsJVM.isJenkinsJVM if potentially running in an agent JVM.", ise); } else { throw ise; } } return instance; }
Source:
<code>private void confirmSSLCertificateDialog(Shell shell) { try { DefaultShell certificateDialog = new DefaultShell(shell); certificateDialog.setFocus(); log.info("SSL Certificate Dialog appeared during " + getLabel().getState().toString()); <START> new PushButton(certificateDialog, "Yes").click(); END> new WaitWhile(new ShellIsAvailable(certificateDialog)); setCertificateAccepted(true); } catch (WaitTimeoutExpiredException ex) { String message ="WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown"; log.error(message); throw new CDKServerException(message, ex); } }</code><technical_language>@odockal moved in labels class</technical_language>

Target:
private void confirmSSLCertificateDialog(Shell shell) { try { DefaultShell certificateDialog = new DefaultShell(shell); certificateDialog.setFocus(); log.info("SSL Certificate Dialog appeared during " + getLabel().getState().toString()); new PushButton(certificateDialog, CDKLabel.Buttons.YES).click(); new WaitWhile(new ShellIsAvailable(certificateDialog)); setCertificateAccepted(true); } catch (WaitTimeoutExpiredException ex) { String message ="WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown"; log.error(message); throw new CDKServerException(message, ex); } }
Source:
<code>public static Observable<Boolean> observeInternetConnectivity() { <START> return observeInternetConnectivity(DEFAULT_PING_INTERVAL_IN_MS, DEFAULT_PING_INTERVAL_IN_MS, DEFAULT_PING_HOST, <END> DEFAULT_PING_PORT, DEFAULT_PING_TIMEOUT_IN_MS); }</code><technical_language>create additional private static final field called DEFAULT_INITIAL_PING_INTERVAL_IN_MS related a separate thing</technical_language>

Target:
public static Observable<Boolean> observeInternetConnectivity() { return observeInternetConnectivity(DEFAULT_INITIAL_PING_INTERVAL_IN_MS, DEFAULT_PING_INTERVAL_IN_MS, DEFAULT_PING_HOST, DEFAULT_PING_PORT, DEFAULT_PING_TIMEOUT_IN_MS); }
Source:
<code>private String assembleInfo(final AppInfo appInfo, final ServiceInfo serviceInfo) { final Integer instanceNo = appInfo.getInstanceNumber(); final String instance = instanceNo != null ? String.format("instance-%s", instanceNo) : null; return Stream.of( serviceInfo.getName(), appInfo.getBuildTag(), instance, appInfo.getTaskHost() ) .filter(Objects::nonNull) <START> .collect(Collectors.joining("/")); <END> }</code><technical_language>If of parts null end strings for id missing -> name/tag/instance/taskhost if tag is null for reason string is name/instance/taskhost</technical_language>

Target:
private Map<String, String> assembleInfo(final AppInfo appInfo, final ServiceInfo serviceInfo) { final ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); builder.put(named("Service-Name"), serviceInfo.getName()); if (appInfo.getBuildTag() != null) { builder.put(named("Build-Tag"), appInfo.getBuildTag()); } final Integer instanceNo = appInfo.getInstanceNumber(); if (instanceNo != null) { builder.put(named("Instance-No"), instanceNo.toString()); } if (appInfo.getTaskHost() != null) { builder.put(named("Task-Host"), appInfo.getTaskHost()); } return builder.build(); }
Source:
<code>public void supportForConcurrentUseOfChildThreads() throws Exception { final int threads = 20; final Allure lifecycle = Allure.LIFECYCLE; String suiteUid = UUID.randomUUID().toString(); fireTestSuiteStart(suiteUid); fireTestCaseStart(suiteUid); ExecutorService service = Executors.newFixedThreadPool(threads); final List<Callable<Object>> tasks = new ArrayList<>(); for (int i = 0; i < threads; i++) { tasks.add(new Callable<Object>() { @Override public Object call() throws Exception { for (int i = 0; i < 1000; i++) { lifecycle.fire(new StepStartedEvent("test-step")); lifecycle.fire(new StepFinishedEvent()); } return ""; } }); } List<Future<Object>> futures = service.invokeAll(tasks); for (Future<Object> future : futures) { future.get(); } <START> assertThat(lifecycle.getStepStorage().pollLast().getSteps(), hasSize(20000)); <END> }</code><technical_language>please write mathematic of 20k multiply of variables</technical_language>

Target:
public void supportForConcurrentUseOfChildThreads() throws Exception { final int threads = 20; final int stepsCount = 1000; final Allure lifecycle = Allure.LIFECYCLE; String suiteUid = UUID.randomUUID().toString(); fireTestSuiteStart(suiteUid); fireTestCaseStart(suiteUid); ExecutorService service = Executors.newFixedThreadPool(threads); final List<Callable<Object>> tasks = new ArrayList<>(); for (int i = 0; i < threads; i++) { tasks.add(new Callable<Object>() { @Override public Object call() throws Exception { for (int i = 0; i < stepsCount; i++) { lifecycle.fire(new StepStartedEvent("test-step")); lifecycle.fire(new StepFinishedEvent()); } return ""; } }); } List<Future<Object>> futures = service.invokeAll(tasks); for (Future<Object> future : futures) { future.get(); } assertThat(lifecycle.getStepStorage().pollLast().getSteps(), hasSize(threads * stepsCount)); }
Source:
<code>VersionedApiResource(String prefix, String version, String name){ <START> if(version.contains(FWD_SLASH)) { <END> int last = version.lastIndexOf(FWD_SLASH); this.apiGroupName = version.substring(0, last); version = version.substring(last + 1); } this.prefix = prefix; this.name = name; this.version = version; this.namespaced = false; }</code><technical_language>if version is null</technical_language>

Target:
VersionedApiResource(String prefix, String version, String name){ if(version == null) throw new IllegalArgumentException("version can not be null when creating a VersionedApiResource "); if(version.contains(FWD_SLASH)) { int last = version.lastIndexOf(FWD_SLASH); this.apiGroupName = version.substring(0, last); version = version.substring(last + 1); } this.prefix = prefix; this.name = name; this.version = version; this.namespaced = false; }
Source:
<code>private boolean acquireLockAndWait() { if (context.getParentLock() != null) { final EngineLock requiredLock = buildLock(); <START> return context.getParentLock().covers(requiredLock, getLockProperties().getScope()); <END> } if (context.getLock() == null) { Map<String, Pair<String, String>> exclusiveLocks = getExclusiveLocks(); if (exclusiveLocks != null) { EngineLock lock = new EngineLock(exclusiveLocks, null); log.info("Before acquiring and wait lock '{}'", lock); getLockManager().acquireLockWait(lock); context.withLock(lock); log.info("Lock-wait acquired to object '{}'", lock); } } return true; }</code><technical_language>reduced</technical_language>

Target:
private boolean acquireLockAndWait() { if (context.getParentLock() != null) { return context.getParentLock().covers(buildLock(), getLockProperties().getScope()); } if (context.getLock() == null) { Map<String, Pair<String, String>> exclusiveLocks = getExclusiveLocks(); if (exclusiveLocks != null) { EngineLock lock = new EngineLock(exclusiveLocks, null); log.info("Before acquiring and wait lock '{}'", lock); getLockManager().acquireLockWait(lock); context.withLock(lock); log.info("Lock-wait acquired to object '{}'", lock); } } return true; }
Source:
<code>public int roomForItem(ItemIdentifier itemIdent, int count) { int room = 0; for (int i = 0; i < _drawer.getDrawerCount(); i++) { if (!_drawer.isDrawerEnabled(i)) continue; IDrawer drawer = _drawer.getDrawer(i); if (drawer == null) continue; ItemStack protoStack = itemIdent.makeNormalStack(1); if (drawer.canItemBeStored(protoStack)) { if (drawer.isEmpty()) { room += drawer.getMaxCapacity(protoStack); } else { room += drawer.getRemainingCapacity(); } } } <START> return room; <END> }</code><technical_language>check if(count != 0) is missing</technical_language>

Target:
public int roomForItem(ItemIdentifier itemIdent, int count) { int room = 0; for (int i = 0; i < _drawer.getDrawerCount(); i++) { if (!_drawer.isDrawerEnabled(i)) continue; IDrawer drawer = _drawer.getDrawer(i); if (drawer == null) continue; ItemStack protoStack = itemIdent.makeNormalStack(1); if (drawer.canItemBeStored(protoStack)) { if (drawer.isEmpty()) { room += drawer.getMaxCapacity(protoStack); } else { room += drawer.getRemainingCapacity(); } } if (count != 0 && room >= count) return count; } return room; }
Source:
<code><START> public static String makeGenericExceptionMessage(String operation, String projectId, String tableName) { <END> return String.format( "Failed to perform operation. Operation='%s', projectId='%s', tableName='%s'", operation, projectId, tableName); }</code><technical_language>I protected more</technical_language>

Target:
static String makeGenericExceptionMessage(String operation, String projectId, String tableName) { return String.format( "Failed to perform operation. Operation='%s', projectId='%s', tableName='%s'", operation, projectId, tableName); }
Source:
<code>public void testQuotingForSubSectionNames() { Config config = new Config(); config.setString("testsection", "testsubsection", "testname", "testvalue"); <START> assertTrue(config.toText().contains("\"testsubsection\"")); <END> config.clear(); config.setString("testsection", "#quotable", "testname", "testvalue"); assertTrue(config.toText().contains("\"#quotable\"")); assertFalse(config.toText().contains("\"\"#quotable\"\"")); config.clear(); config.setString("testsection", "with\"quote", "testname", "testvalue"); assertTrue(config.toText().contains("\"with\\\"quote\"")); assertFalse(config.toText().contains("\"\"with\\\"quote\"\"")); }</code><technical_language>If atRepositoryTestCase flat out assert a specific formatting for entire file. for this say: String exp = "[testsection \"testsubsection\"]\n\ttestname=testvalue\n"; assertEquals(exp, config.toText());</technical_language>

Target:
public void testQuotingForSubSectionNames() { String resultPattern = "[testsection \"{0}\"]\n\ttestname = testvalue\n"; String result; Config config = new Config(); config.setString("testsection", "testsubsection", "testname", "testvalue"); result = MessageFormat.format(resultPattern, "testsubsection"); assertEquals(result, config.toText()); config.clear(); config.setString("testsection", "#quotable", "testname", "testvalue"); result = MessageFormat.format(resultPattern, "#quotable"); assertEquals(result, config.toText()); config.clear(); config.setString("testsection", "with\"quote", "testname", "testvalue"); result = MessageFormat.format(resultPattern, "with\\\"quote"); assertEquals(result, config.toText()); }
Source:
<code>private List<NameValuePair> createParamList() { Annotation[][] parameterAnnotations = javaMethod.getParameterAnnotations(); int count = parameterAnnotations.length - 1; List<NameValuePair> params = new ArrayList<NameValuePair>(count); QueryParams queryParams = javaMethod.getAnnotation(QueryParams.class); if (queryParams != null) { QueryParam[] annotations = queryParams.value(); for (QueryParam annotation : annotations) { params.add(addPair(annotation)); } } QueryParam queryParam = javaMethod.getAnnotation(QueryParam.class); if (queryParam != null) { params.add(addPair(queryParam)); } for (int i = 0; i < count; i++) { Object arg = args[i]; if (arg == null) continue; <START> String name = RestAdapter.getName(parameterAnnotations[i], javaMethod, i); <END> params.add(new BasicNameValuePair(name, String.valueOf(arg))); } return params; }</code><technical_language>getName() move this class</technical_language>

Target:
private List<NameValuePair> createParamList() { Annotation[][] parameterAnnotations = javaMethod.getParameterAnnotations(); int count = parameterAnnotations.length - 1; List<NameValuePair> params = new ArrayList<NameValuePair>(count); QueryParams queryParams = javaMethod.getAnnotation(QueryParams.class); if (queryParams != null) { QueryParam[] annotations = queryParams.value(); for (QueryParam annotation : annotations) { params.add(addPair(annotation)); } } QueryParam queryParam = javaMethod.getAnnotation(QueryParam.class); if (queryParam != null) { params.add(addPair(queryParam)); } for (int i = 0; i < count; i++) { Object arg = args[i]; if (arg == null) continue; String name = getName(parameterAnnotations[i], javaMethod, i); params.add(new BasicNameValuePair(name, String.valueOf(arg))); } return params; }
Source:
<code>public void updateFromPageChanged(PageChangedEvent event) { IPage page = event.getPage(); if (!PageChangedEvent.EVENT_TYPE_SET_PAGE_OFFLINE.equals(event.getEventType()) && !PageChangedEvent.EVENT_TYPE_SET_PAGE_ONLINE.equals(event.getEventType())) { return; } try { if (event.getSource().equals(ApsEvent.LOCAL_EVENT)) { <START> this.deleteMapping(page.getCode(), null); <END> if (null != this.getPageManager().getOnlinePage(page.getCode())) { this.updatePageMapping(page); } } SeoChangedEvent seoEvent = new SeoChangedEvent(); seoEvent.setOperationCode(SeoChangedEvent.PAGE_CHANGED_EVENT); this.notifyEvent(seoEvent); this.getCacheWrapper().initCache(this.getSeoMappingDAO()); } catch (Throwable t) { _logger.error("Error updating mapping from page changed", t); } }</code><technical_language>Is this logical change intentional? exception waiting happen if page online? long is covered tests is ok want check</technical_language>

Target:
public void updateFromPageChanged(PageChangedEvent event) { IPage page = event.getPage(); if (!PageChangedEvent.EVENT_TYPE_SET_PAGE_OFFLINE.equals(event.getEventType()) && !PageChangedEvent.EVENT_TYPE_SET_PAGE_ONLINE.equals(event.getEventType())) { return; } if (!(page.getMetadata() instanceof SeoPageMetadata)) { return; } try { this.getSeoMappingDAO().deleteMappingForPage(page.getCode()); SeoPageMetadata seoMetadata = (SeoPageMetadata) page.getMetadata(); String friendlyCode = seoMetadata.getFriendlyCode(); if (!StringUtils.isEmpty(friendlyCode)) { FriendlyCodeVO vo = new FriendlyCodeVO(seoMetadata.getFriendlyCode(), page.getCode()); this.getSeoMappingDAO().updateMapping(vo); } SeoChangedEvent seoEvent = new SeoChangedEvent(); seoEvent.setOperationCode(SeoChangedEvent.PAGE_CHANGED_EVENT); this.notifyEvent(seoEvent); this.getCacheWrapper().initCache(this.getSeoMappingDAO()); } catch (Throwable t) { logger.error("Error updating mapping from page changed", t); } }
Source:
<code>public <E> CompletableFuture<RemoteTraversal<?, E>> submitAsync(final Bytecode bytecode) throws RemoteConnectionException { try { final Iterator<OptionsStrategy> itty = IteratorUtils.map( <START> IteratorUtils.filter(bytecode.getSourceInstructions().iterator(), <END> s -> s.getOperator().equals(TraversalSource.Symbols.withStrategies) && s.getArguments()[0] instanceof OptionsStrategy), os -> (OptionsStrategy) os.getArguments()[0]); final RequestOptions.Builder builder = RequestOptions.build(); while (itty.hasNext()) { final OptionsStrategy optionsStrategy = itty.next(); if (optionsStrategy.getOptions().containsKey(PER_REQUEST_TIMEOUT)) builder.timeout((long) optionsStrategy.getOptions().get(PER_REQUEST_TIMEOUT)); else if (optionsStrategy.getOptions().containsKey(PER_REQUEST_BATCH_SIZE)) builder.batchSize((int) optionsStrategy.getOptions().get(PER_REQUEST_BATCH_SIZE)); } return client.submitAsync(bytecode, builder.create()).thenApply(rs -> new DriverRemoteTraversal<>(rs, client, attachElements, conf)); } catch (Exception ex) { throw new RemoteConnectionException(ex); } }</code><technical_language>this (extracting RequestOptions a Bytecode) a utility for other implementors of RemoteConnection</technical_language>

Target:
public <E> CompletableFuture<RemoteTraversal<?, E>> submitAsync(final Bytecode bytecode) throws RemoteConnectionException { try { return client.submitAsync(bytecode, getRequestOptions(bytecode)).thenApply(rs -> new DriverRemoteTraversal<>(rs, client, attachElements, conf)); } catch (Exception ex) { throw new RemoteConnectionException(ex); } }
Source:
<code>public String getServerStatuses() { JSONObject root = new JSONObject(); JSONArray array = new JSONArray(); JSONObject obj; for (GerritServer server : PluginImpl.getInstance().getServers()) { String status; if (server.isPseudoMode()) { status = "na"; } else { if (server.isConnected()) { status ="up"; } else { status ="down"; } } obj = new JSONObject(); obj.put("name", server.getName()); obj.put("frontEndUrl", server.getConfig().getGerritFrontEndUrl()); obj.put("serverUrl", server.getUrlName()); obj.put("version", server.getGerritVersion()); obj.put("status", status); array.add(obj); } root.put("servers", array); <START> return root.toString(); <END> }</code><technical_language>need convert a json string. return a typesafe object Stapler care of converting json for you. "backend code" in future</technical_language>

Target:
public JSONObject getServerStatuses() { JSONObject root = new JSONObject(); JSONArray array = new JSONArray(); JSONObject obj; for (GerritServer server : PluginImpl.getInstance().getServers()) { String status; if (server.isPseudoMode()) { status = "na"; } else { if (server.isConnected()) { status = "up"; } else { status = "down"; } } obj = new JSONObject(); obj.put("name", server.getName()); obj.put("frontEndUrl", server.getConfig().getGerritFrontEndUrl()); obj.put("serverUrl", server.getUrlName()); obj.put("version", server.getGerritVersion()); obj.put("status", status); obj.put("hasErrors", server.hasErrors()); obj.put("hasWarnings", server.hasWarnings()); array.add(obj); } root.put("servers", array); return root; }
Source:
<code>public String getName() { if (alias != null ) { String key = "role." + alias.toLowerCase() +".name"; <START> return BundleUtil.getStringFromPropertyFile(key,"BuiltInRoles" ); <END> } else { return name; } }</code><technical_language>this work Custom roles</technical_language>

Target:
public String getName() { if (alias != null ) { String key = "role." + alias.toLowerCase() +".name"; String _name = BundleUtil.getStringFromPropertyFile(key,"BuiltInRoles" ); if(_name == null) { return name; } else { return _name; } } else { return name; } }
Source:
<code>List<IResultsEditorTab> getTabs() throws OseeCoreException { if (tabs == null) { tabs = getResultsEditorProvider().getResultsEditorTabs(); <START> } <END> return tabs; }</code><technical_language>If provider returns null, error tab added</technical_language>

Target:
List<IResultsEditorTab> getTabs() throws OseeCoreException { if (tabs == null) { tabs = getResultsEditorProvider().getResultsEditorTabs(); if (tabs == null || tabs.isEmpty()) { tabs.add(new ResultsEditorHtmlTab( "Error", "Error", AHTML.simplePage("Error: No tabs were defined for \"" + getResultsEditorProvider().getEditorName() + "\""))); } } return tabs; }
Source:
<code>public final void testIncorrectName() throws HaskellTypeError { new Ident("id").analyze(new Env(), new GenSet()); <START> assertTrue("Invalid state reached: exception not raised.", false); <END> }</code><technical_language>assertTrue necessary: expected in Test test pass _if if_ exception is thrown</technical_language>

Target:
public final void testIncorrectName() throws HaskellTypeError { new Ident("id").analyze(new Env(), new GenSet()); }
Source:
<code>public void testRemoveSeenCorrectly2() throws Throwable { Object k = getKey(); cache(0).put(k, "v"); tm(0).begin(); cache(0).remove(k); assertNull(cache(0).get(k)); tm(0).rollback(); <START> assertEquals(cache(0).get(k), "v"); <END> }</code><technical_language>Order of expected actual values is wrong</technical_language>

Target:
public void testRemoveSeenCorrectly2() throws Throwable { Object k = getKey(); cache(0).put(k, "v"); tm(0).begin(); cache(0).remove(k); assertNull(cache(0).get(k)); tm(0).rollback(); assertEquals("v", cache(0).get(k)); }
Source:
<code>public final Response toResponse(T exception) { String errorId = UUID.randomUUID().toString(); StatusType status = this.getStatus(exception); if (status.getFamily().equals(Response.Status.Family.CLIENT_ERROR)) { log.info("Error handling request {}", SafeArg.of("errorId", errorId), exception); } else { log.error("Error handling request {}", SafeArg.of("errorId", errorId), exception); } ResponseBuilder builder = Response.status(status); try { SerializableError error = SerializableError.builder() .errorCode(exception.getClass().getName()) <START> .errorName("Refer to the server logs with this errorId: " + errorId) <END> .putParameters("errorId", errorId) .build(); builder.type(MediaType.APPLICATION_JSON); String json = MAPPER.writeValueAsString(error); builder.entity(json); } catch (RuntimeException | JsonProcessingException e) { log.warn("Unable to translate exception to json for request {}", SafeArg.of("errorId", errorId), e); builder = Response.status(status); builder.type(MediaType.TEXT_PLAIN); builder.entity(Objects.toString(exception.getMessage())); } return builder.build(); }</code><technical_language>this usage of API is usage ServiceException. I for consistency set errorName exception.getClass().getName()</technical_language>

Target:
public final Response toResponse(T exception) { String errorInstanceId = UUID.randomUUID().toString(); StatusType status = this.getStatus(exception); if (status.getFamily().equals(Response.Status.Family.CLIENT_ERROR)) { log.info("Error handling request {}", SafeArg.of("errorInstanceId", errorInstanceId), exception); } else { log.error("Error handling request {}", SafeArg.of("errorInstanceId", errorInstanceId), exception); } ResponseBuilder builder = Response.status(status); try { SerializableError error = SerializableError.builder() .errorCode(exception.getClass().getName()) .errorName("Refer to the server logs with this errorInstanceId: " + errorInstanceId) .errorInstanceId(errorInstanceId) .build(); builder.type(MediaType.APPLICATION_JSON); String json = MAPPER.writeValueAsString(error); builder.entity(json); } catch (RuntimeException | JsonProcessingException e) { log.warn("Unable to translate exception to json for request {}", SafeArg.of("errorInstanceId", errorInstanceId), e); builder = Response.status(status); builder.type(MediaType.TEXT_PLAIN); builder.entity("Unable to translate exception to json. Refer to the server logs with this errorInstanceId: " + errorInstanceId); } return builder.build(); }
Source:
<code><START> public void clearLeadingMasterMetrics() throws IOException { <END> FileSystemTestUtils.createByteFile(mLocalAlluxioCluster.getClient(), "/file", WritePType.MUST_CACHE, 10); int errCode = mFsAdminShell.run("report", "metrics"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); assertThat(mOutput.toString(), CoreMatchers.containsString( "Create File Operations 1")); errCode = mFsAdminShell.run("metrics", "clear"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); mOutput.reset(); errCode = mFsAdminShell.run("report", "metrics"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); assertThat(mOutput.toString(), CoreMatchers.containsString( "Create File Operations 0")); }</code><technical_language>a test for worker clear well</technical_language>

Target:
public void clearLeadingMasterMetrics() throws IOException { FileSystemTestUtils.createByteFile(mLocalAlluxioCluster.getClient(), "/file", WritePType.MUST_CACHE, 10); int errCode = mFsAdminShell.run("report", "metrics"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); assertThat(mOutput.toString(), CoreMatchers.containsString( "Create File Operations 1")); errCode = mFsAdminShell.run("metrics", "clear", "--master"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); mOutput.reset(); errCode = mFsAdminShell.run("report", "metrics"); assertEquals("", mErrOutput.toString()); assertEquals(0, errCode); assertThat(mOutput.toString(), CoreMatchers.containsString( "Create File Operations 0")); }
Source:
<code>public void authenticateWithFailedProvider() throws SecurityException, SecurityProviderNotFoundException { when(provider.authenticate(authentication)).thenThrow(SecurityException.class); manager.addProvider(provider); expected.expect(SecurityException.class); <START> manager.authenticate(authentication); <END> verify(provider).authenticate(authentication); }</code><technical_language>previous method</technical_language>

Target:
public void authenticateWithFailedProvider() throws SecurityException, SecurityProviderNotFoundException { when(provider.authenticate(authentication)).thenThrow(SecurityException.class); manager.addProvider(provider); expected.expect(SecurityException.class); try { manager.authenticate(authentication); } finally { verify(provider).authenticate(authentication); } }
Source:
<code>private void parseZCallThresholds() { final String notApplicable = "NA"; try (Stream<String> stream = Files.lines(ZCALL_THRESHOLDS_FILE.toPath())) { stream.forEach(line -> { final String[] tokens = line.split("\t"); <START> if ((!tokens[1].equals(notApplicable)) && (!tokens[2].equals(notApplicable))) { <END> zCallThresholds.put(tokens[0], new String[]{tokens[1], tokens[2]}); } else { zCallThresholds.put(tokens[0], new String[]{DOT, DOT}); } }); } catch (IOException e) { throw new PicardException("Error parsing ZCall Thresholds File", e); } }</code><technical_language>if of fields is "NA" ignore other one? emit a warning in this case throwing data</technical_language>

Target:
private void parseZCallThresholds() { final String notApplicable = "NA"; try (Stream<String> stream = Files.lines(ZCALL_THRESHOLDS_FILE.toPath())) { stream.forEach(line -> { final String[] tokens = line.split("\t"); if (tokens[1].equals(notApplicable) || tokens[2].equals(notApplicable)) { if (!tokens[1].equals(notApplicable) || !tokens[2].equals(notApplicable)) { throw new PicardException("Thresholds should either both exist or both not exist."); } zCallThresholds.put(tokens[0], new String[]{MISSING_VALUE_v4, MISSING_VALUE_v4}); } else { zCallThresholds.put(tokens[0], new String[]{tokens[1], tokens[2]}); } }); } catch (IOException e) { throw new PicardException("Error parsing ZCall Thresholds File", e); } }
Source:
<code>public synchronized RequestFuture<Void> maybeLeaveGroup(String leaveReason) { RequestFuture<Void> future = null; if (isDynamicMember() && !coordinatorUnknown() && state != MemberState.UNJOINED && generation.hasMemberId()) { log.info("Member sending LeaveGroup request to coordinator due to {}", generation.memberId, coordinator, leaveReason); LeaveGroupRequest.Builder request = new LeaveGroupRequest.Builder( rebalanceConfig.groupId, Collections.singletonList(new MemberIdentity() .setMemberId(generation.memberId)) ); future = client.send(coordinator, request) .compose(new LeaveGroupResponseHandler()); client.pollNoWakeup(); } <START> resetGeneration("consumer proactively leaving group", false); <END> return future; }</code><technical_language>Hmm.. LeaveGroup invoke this. I guess guarantee consumer is in group onPartitionsRevoked is called. need move this up</technical_language>

Target:
public synchronized RequestFuture<Void> maybeLeaveGroup(String leaveReason) { RequestFuture<Void> future = null; if (isDynamicMember() && !coordinatorUnknown() && state != MemberState.UNJOINED && generation.hasMemberId()) { log.info("Member sending LeaveGroup request to coordinator due to {}", generation.memberId, coordinator, leaveReason); LeaveGroupRequest.Builder request = new LeaveGroupRequest.Builder( rebalanceConfig.groupId, Collections.singletonList(new MemberIdentity().setMemberId(generation.memberId)) ); future = client.send(coordinator, request).compose(new LeaveGroupResponseHandler()); client.pollNoWakeup(); } resetGenerationOnLeaveGroup(); return future; }
Source:
<code>private void handleAlwaysOnNetworkRequest( NetworkRequest networkRequest, String settingName, int defaultValue) { final boolean enable = (Settings.Global.getInt( mContext.getContentResolver(), settingName, <START> defaultValue) == 1); <END> final boolean isEnabled = (mNetworkRequests.get(networkRequest) != null); if (enable == isEnabled) { return; } if (enable) { handleRegisterNetworkRequest(new NetworkRequestInfo( null, networkRequest, new Binder())); } else { handleReleaseNetworkRequest(networkRequest, Process.SYSTEM_UID); } }</code><technical_language>remove call toBool ? I easier understand. Instead suggest : private void handleAlwaysOnNetworkRequest( NetworkRequest networkRequest, String settingName, bool defaultValue) { final boolean enable = toBool(Settings.Global.getInt( mContext.getContentResolver(), settingName, encodeBool(defaultValue))); In particular, I this call site a lot clearer</technical_language>

Target:
private void handleAlwaysOnNetworkRequest( NetworkRequest networkRequest, String settingName, int defaultValue) { final boolean enable = toBool(Settings.Global.getInt( mContext.getContentResolver(), settingName, encodeBool(defaultValue))); final boolean isEnabled = (mNetworkRequests.get(networkRequest) != null); if (enable == isEnabled) { return; } if (enable) { handleRegisterNetworkRequest(new NetworkRequestInfo( null, networkRequest, new Binder())); } else { handleReleaseNetworkRequest(networkRequest, Process.SYSTEM_UID); } }