auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void checkArgType(ObjectInspector oi, int i, PrimitiveCategory type) throws UDFArgumentTypeException { PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) oi).getPrimitiveCategory(); if (primitiveCategory != type) { throw new UDFArgumentTypeException(0, "A " + type.getClass().getSimpleName() + " argument was expected for " + getFuncName() + " but an argument of type " + oi.getTypeName() + " was given."); } }

Target:
protected void checkArgType(ObjectInspector oi, int i, PrimitiveCategory type) throws UDFArgumentTypeException { checkArgPrimitive(oi, i); PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) oi).getPrimitiveCategory(); if (primitiveCategory != type) { throw new UDFArgumentTypeException(0, "A " + type.getClass().getSimpleName() + " argument was expected for " + getFuncName() + " but an argument of type " + oi.getTypeName() + " was given."); } }
Source:
public RunResult runTests(Path path) { buildAntProject(path); List<String> runnerArgs = buildTestRunnerArgs(path); startProcess(runnerArgs); try { FileUtils.deleteDirectory(new File(path.toString() + File.separatorChar + "build")); } catch (IOException e) { throw Throwables.propagate(e); } File resultFile = new File(path.toString() + resultsFile); RunResult result = resultParser.parseTestResult(resultFile); resultFile.delete(); return result; }

Target:
public RunResult runTests(Path path) { if (!buildAntProject(path)) { return buildRunResult; } List<String> runnerArgs = buildTestRunnerArgs(path); startProcess(runnerArgs); File resultFile = new File(path.toString() + resultsFile); RunResult result = resultParser.parseTestResult(resultFile); resultFile.delete(); return result; }
Source:
protected DocumentModel getClientModel(String clientId) { DirectoryService service = Framework.getService(DirectoryService.class); return Framework.doPrivileged(() -> { try (Session session = service.open(OAUTH2CLIENT_DIRECTORY_NAME)) { Map<String, Serializable> filter = new HashMap<>(); filter.put("clientId", clientId); DocumentModelList docs = session.query(filter); if (docs.size() > 0) { return docs.get(0); } } return null; }); }

Target:
protected DocumentModel getClientModel(String clientId) { DirectoryService service = Framework.getService(DirectoryService.class); return Framework.doPrivileged(() -> { try (Session session = service.open(OAUTH2CLIENT_DIRECTORY_NAME)) { Map<String, Serializable> filter = Collections.singletonMap("clientId", clientId); DocumentModelList docs = session.query(filter); if (docs.size() > 0) { return docs.get(0); } } return null; }); }
Source:
private void deleteTestFiles(@Nonnegative IDevice device, @Nonnull String uuid) throws RuntimeRunnerException { if (isVerbose) { System.out.println( "adb shell -s " + device.getSerialNumber() + " find data -name '*jack-tests-" + uuid + "*' -exec rm -rf +"); } try { device.executeShellCommand( "find data -name '*jack-tests-" + uuid + "*' -exec rm -rf +", hostOutput); } catch (TimeoutException | AdbCommandRejectedException | ShellCommandUnresponsiveException | IOException e) { throw new RuntimeRunnerException(e); } }

Target:
private void deleteTestFiles(@Nonnegative IDevice device, @Nonnull String uuid) throws RuntimeRunnerException { String deleteCommand = "find data -name '*jack-tests-" + uuid + "*' -exec rm -rf +"; if (isVerbose) { System.out.println("adb -s " + device.getSerialNumber() + " shell " + deleteCommand); } try { device.executeShellCommand(deleteCommand, hostOutput); } catch (TimeoutException | AdbCommandRejectedException | ShellCommandUnresponsiveException | IOException e) { throw new RuntimeRunnerException(e); } }
Source:
public static TypeName getParcelableType(Types types, TypeElement type) { TypeMirror typeMirror = type.asType(); while (typeMirror.getKind() != TypeKind.NONE) { TypeName typeName = TypeName.get(typeMirror); if (typeName instanceof ParameterizedTypeName) { typeName = ((ParameterizedTypeName) typeName).rawType; } if (typeName.isPrimitive() || VALID_TYPES.contains(typeName)) { return typeName; } List<? extends TypeMirror> interfaces = type.getInterfaces(); if (!interfaces.isEmpty()) { for (TypeMirror iface : interfaces) { TypeName ifaceName = TypeName.get(iface); if (VALID_TYPES.contains(ifaceName)) { return ifaceName; } } } type = (TypeElement) types.asElement(typeMirror); typeMirror = type.getSuperclass(); } return null; }

Target:
public static TypeName getParcelableType(Types types, TypeElement type) { TypeMirror typeMirror = type.asType(); while (typeMirror.getKind() != TypeKind.NONE) { TypeName typeName = TypeName.get(typeMirror); if (typeName instanceof ParameterizedTypeName) { typeName = ((ParameterizedTypeName) typeName).rawType; } if (typeName.isPrimitive() || VALID_TYPES.contains(typeName)) { return typeName; } for (TypeMirror iface : type.getInterfaces()) { TypeName ifaceName = TypeName.get(iface); if (VALID_TYPES.contains(ifaceName)) { return ifaceName; } } type = (TypeElement) types.asElement(typeMirror); typeMirror = type.getSuperclass(); } return null; }
Source:
public MemberInfo(Address address, UUID uuid, Map<String, String> attributes, boolean liteMember, MemberVersion version, boolean isAddressMapExists, Map<EndpointQualifier, Address> addressMap) { this(address, uuid, attributes, liteMember, version, NA_MEMBER_LIST_JOIN_VERSION, addressMap); }

Target:
public MemberInfo(Address address, UUID uuid, Map<String, String> attributes, boolean liteMember, MemberVersion version, boolean isAddressMapExists, Map<EndpointQualifier, Address> addressMap) { this(address, uuid, attributes, liteMember, version, NA_MEMBER_LIST_JOIN_VERSION, isAddressMapExists ? addressMap : emptyMap()); }
Source:
public void fail(WebElementsCollection collection, List<WebElement> elements, Exception lastError, long timeoutMs) { if (elements == null || elements.isEmpty()) { ElementNotFound elementNotFound = new ElementNotFound(collection, expectedTexts, lastError); elementNotFound.timeoutMs = timeoutMs; throw elementNotFound; } if (elements.size() != expectedTexts.size()) { throw new TextsSizeMismatch(collection, ElementsCollection.texts(elements), expectedTexts, explanation, timeoutMs); } else { throw new TextsMismatch(collection, ElementsCollection.texts(elements), expectedTexts, explanation, timeoutMs); } }

Target:
public void fail(WebElementsCollection collection, List<WebElement> elements, Exception lastError, long timeoutMs) { if (elements == null || elements.isEmpty()) { ElementNotFound elementNotFound = new ElementNotFound(collection, expectedTexts, lastError); elementNotFound.timeoutMs = timeoutMs; throw elementNotFound; } else if (elements.size() != expectedTexts.size()) { throw new TextsSizeMismatch(collection, ElementsCollection.texts(elements), expectedTexts, explanation, timeoutMs); } else { throw new TextsMismatch(collection, ElementsCollection.texts(elements), expectedTexts, explanation, timeoutMs); } }
Source:
public abstract void importPemCertificate(HttpClient httpClient, CertificateServiceVersion serviceVersion) throws IOException; void importPemCertificateRunner(Consumer<ImportCertificateOptions> testRunner) throws IOException { byte[] certificateContent = readCertificate("certificate.pem"); String certificateName = generateResourceId("importCertPem"); HashMap<String, String> tags = new HashMap<>(); tags.put("key", "val"); ImportCertificateOptions importCertificateOptions = new ImportCertificateOptions(certificateName, certificateContent) .setPolicy(new CertificatePolicy("Self", "CN=AzureSDK") .setContentType(CertificateContentType.PEM)) .setEnabled(true) .setTags(tags); testRunner.accept(importCertificateOptions); }

Target:
public abstract void importPemCertificate(HttpClient httpClient, CertificateServiceVersion serviceVersion) throws IOException; void importPemCertificateRunner(Consumer<ImportCertificateOptions> testRunner) throws IOException { byte[] certificateContent = readCertificate("pemCert.pem"); String certificateName = generateResourceId("importCertPem"); HashMap<String, String> tags = new HashMap<>(); tags.put("key", "val"); ImportCertificateOptions importCertificateOptions = new ImportCertificateOptions(certificateName, certificateContent) .setPolicy(new CertificatePolicy("Self", "CN=AzureSDK") .setContentType(CertificateContentType.PEM)) .setEnabled(true) .setTags(tags); testRunner.accept(importCertificateOptions); }
Source:
public CloudProvider createCloudProvider(String cloudProviderId, Configured configuration) { if (!GoogleCloudProvider.ID.equals(cloudProviderId)) { throw new NoSuchElementException("Cloud provider not found: " + cloudProviderId); } CredentialsProvider<GoogleCredentials> provider = new GoogleCredentialsProvider(); GoogleCredentials credentials = provider.createCredentials(configuration); if (credentials.getCompute() == null) { throw new IllegalArgumentException("Invalid cloud provider credentials"); } else { try { credentials.getCompute().regions().list(credentials.getProjectId()).execute(); } catch (IOException e) { e.printStackTrace(); throw new IllegalArgumentException("Invalid cloud provider credentials"); } } return new GoogleCloudProvider(credentials); }

Target:
public CloudProvider createCloudProvider(String cloudProviderId, Configured configuration) { if (!GoogleCloudProvider.ID.equals(cloudProviderId)) { throw new IllegalArgumentException("Cloud provider not found: " + cloudProviderId); } CredentialsProvider<GoogleCredentials> provider = new GoogleCredentialsProvider(); GoogleCredentials credentials = provider.createCredentials(configuration); Compute compute = credentials.getCompute(); if (compute == null) { throw new IllegalArgumentException("Invalid cloud provider credentials."); } else { String projectId = credentials.getProjectId(); try { compute.regions().list(projectId).execute(); } catch (IOException e) { throw new IllegalArgumentException( "Invalid cloud provider credentials for project '" + projectId + "'.", e); } } return new GoogleCloudProvider(credentials); }
Source:
public String toString() { if (serialPortName!=null) return "Device [id=" + deviceId + ", serialPort=" + serialPortName + "]"; else return "Device [id=" + deviceId + ", host=" + host + ", port=" + port + "]"; }

Target:
public String toString() { if (serialPortName != null) { return "Device [id=" + deviceId + ", serialPort=" + serialPortName + "]"; } else { return "Device [id=" + deviceId + ", host=" + host + ", port=" + port + "]"; } }
Source:
public static Set<MetaClass> getConfiguredNonBindableTypes() { if (configuredNonBindableTypes == null) { initEnvironmentConfig(); } return configuredNonBindableTypes; }

Target:
public static Set<MetaClass> getConfiguredNonBindableTypes() { if (configuredNonBindableTypes != null) { configuredNonBindableTypes = refreshConfiguredTypes(configuredNonBindableTypes); } else { initEnvironmentConfig(); } return configuredNonBindableTypes; }
Source:
public void updateScores(HashMap<Integer, Double> scoreMap) { for (GameObject go : gameObjects.values()) { for (Integer iD : scoreMap.keySet()) { if (go.getId() == iD && go instanceof BoDCharacter) { BoDCharacter bodCharacter = (BoDCharacter)go; double score = scoreMap.get(iD); bodCharacter.addScore(score); } } } }

Target:
public void updateScores(HashMap<Integer, Double> scoreMap) { for (Integer id : scoreMap.keySet()) { GameObject go = gameObjects.get(id); if (go != null) { BoDCharacter bodCharacter = (BoDCharacter)go; double score = scoreMap.get(id); bodCharacter.addScore(score); } } }
Source:
private static File getDefaultFile() { File netrc; File home = new File(System.getProperty("user.home")); netrc = new File(home, ".netrc"); if (netrc.exists()) return netrc; netrc = new File(home, "_netrc"); if (netrc.exists()) return netrc; return null; }

Target:
private static File getDefaultFile() { File home = new File(System.getProperty("user.home")); File netrc = new File(home, ".netrc"); if (netrc.exists()) return netrc; netrc = new File(home, "_netrc"); if (netrc.exists()) return netrc; return null; }
Source:
public static void main(final String[] args) throws Exception { if (args.length == 6) { initializeAcl(args[0], args[1], args[2], args[3], args[4], args[5]); } else { System.out.println("usage: <ZK connect string> <ZK cluster ID> " + "<master user> <master password> <agent user> <agent password>"); } }

Target:
public static void main(final String[] args) throws Exception { if (args.length == 6) { initializeAcl(args[0], args[1], args[2], args[3], args[4], args[5]); } else { System.out.println("usage: <ZK connect string> <ZK cluster ID> " + "<master user> <master password> <agent user> <agent password>"); System.exit(-1); } }
Source:
private void refreshInternal() { if (isIncludeSubPackages()) { this.querySpecifications.addAll(QuerySpecificationRegistry.getInstance().getPackageSubTreeQueryGroup(this.packageName)); } else { this.querySpecifications.addAll(QuerySpecificationRegistry.getInstance().getQueryGroup(this.packageName)); } }

Target:
private void refreshInternal() { if (isIncludeSubPackages()) { this.querySpecifications.addAll(registry.getPackageSubTreeQueryGroup(this.packageName)); } else { this.querySpecifications.addAll(registry.getQueryGroup(this.packageName)); } }
Source:
private void readHeaderData() throws IOException { setFileVersion(parseInt()); skipString(); skipString(); skipString(); skipString(); skipString(); skipBoolean(); if (getFileVersion() == 2) { throw new IOException("Version 2 unsupported"); } manifestName = parseString(); }

Target:
private void readHeaderData() throws IOException { setFileVersion(parseInt()); skipString(); skipString(); skipString(); skipString(); skipString(); skipBoolean(); if (getFileVersion() == INVALID_FILE_VERSION) { throw new IOException("Version '" + INVALID_FILE_VERSION + "' unsupported"); } manifestName = parseString(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.entity_map_view); MapFragment mapFragment = (MapFragment) getFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); session = CommCareApplication._().getCurrentSession(); SessionDatum selectDatum = session.getNeededDatum(); Detail detail = session.getDetail(selectDatum.getShortDetail()); NodeEntityFactory factory = new NodeEntityFactory(detail, this.getEvaluationContext()); Vector<TreeReference> references = getEvaluationContext().expandReference( selectDatum.getNodeset()); entities = new Vector<>(); for(TreeReference ref : references) { entities.add(factory.getEntity(ref)); } int bogusAddresses = 0; entityLocations = new Vector<>(); for(Entity<TreeReference> entity : entities) { for(int i = 0 ; i < detail.getHeaderForms().length; ++i ){ if("address".equals(detail.getTemplateForms()[i])) { String address = entity.getFieldString(i).trim(); if(address != null && !"".equals(address)) { LatLng location = getLatLngFromAddress(address); if (location == null) { bogusAddresses++; } else { entityLocations.add(new Pair<>(entity, location)); } } } } } Log.d(TAG, "Loaded. " + entityLocations.size() +" addresses discovered, " + bogusAddresses + " could not be located"); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.entity_map_view); SupportMapFragment mapFragment = (SupportMapFragment)getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); Detail detail = session.getDetail(selectDatum.getShortDetail()); addEntityLocations(detail); Log.d(TAG, "Loaded. " + entityLocations.size() + " addresses discovered, " + ( detail.getHeaderForms().length - entityLocations.size()) + " could not be located"); }
Source:
protected boolean eventTriggersAjax(WebElement element, String attribute) { String eventHandler = element.getAttribute(attribute); return eventHandler != null && eventHandler.contains("RichFaces.ajax("); }

Target:
protected boolean eventTriggersAjax(WebElement element, String attribute) { String eventHandler = element.getAttribute(attribute); return eventHandler != null && (ajaxStartWithOnly? eventHandler.startsWith(RICH_FACES_AJAX_CALL) : eventHandler.contains(RICH_FACES_AJAX_CALL)); }
Source:
public void shouldBeAbleToRequestARefund_multiplePartialAmounts_andRefundShouldBeInFullStatus() { Long firstRefundAmount = 80L; Long secondRefundAmount = 20L; Long chargeId = defaultTestCharge.getChargeId(); String externalChargeId = defaultTestCharge.getExternalChargeId(); ValidatableResponse firstValidatableResponse = postRefundFor(externalChargeId, firstRefundAmount, defaultTestCharge.getAmount()); String firstRefundId = assertRefundResponseWith(firstRefundAmount, firstValidatableResponse, ACCEPTED.getStatusCode()); ValidatableResponse secondValidatableResponse = postRefundFor(externalChargeId, secondRefundAmount, defaultTestCharge.getAmount() - firstRefundAmount); String secondRefundId = assertRefundResponseWith(secondRefundAmount, secondValidatableResponse, ACCEPTED.getStatusCode()); List<Map<String, Object>> refundsFoundByChargeId = databaseTestHelper.getRefundsByChargeId(chargeId); assertThat(refundsFoundByChargeId.size(), is(2)); assertThat(refundsFoundByChargeId, hasItems( aRefundMatching(secondRefundId, is(notNullValue()), chargeId, secondRefundAmount, "REFUNDED"), aRefundMatching(firstRefundId, is(notNullValue()), chargeId, firstRefundAmount, "REFUNDED"))); assertRefundsHistoryInDBForTwoRefunds(defaultTestCharge); connectorRestApiClient.withChargeId(externalChargeId) .getCharge() .statusCode(200) .body("refund_summary.status", is("full")) .body("refund_summary.amount_available", is(0)) .body("refund_summary.amount_submitted", is(100)); }

Target:
public void shouldBeAbleToRequestARefund_multiplePartialAmounts_andRefundShouldBeInFullStatus() { Long firstRefundAmount = 80L; Long secondRefundAmount = 20L; Long chargeId = defaultTestCharge.getChargeId(); String externalChargeId = defaultTestCharge.getExternalChargeId(); ValidatableResponse firstValidatableResponse = postRefundFor(externalChargeId, firstRefundAmount, defaultTestCharge.getAmount()); String firstRefundId = assertRefundResponseWith(firstRefundAmount, firstValidatableResponse, ACCEPTED.getStatusCode()); ValidatableResponse secondValidatableResponse = postRefundFor(externalChargeId, secondRefundAmount, defaultTestCharge.getAmount() - firstRefundAmount); String secondRefundId = assertRefundResponseWith(secondRefundAmount, secondValidatableResponse, ACCEPTED.getStatusCode()); List<Map<String, Object>> refundsFoundByChargeId = databaseTestHelper.getRefundsByChargeId(chargeId); assertThat(refundsFoundByChargeId.size(), is(2)); assertThat(refundsFoundByChargeId, hasItems( aRefundMatching(secondRefundId, is(notNullValue()), chargeId, secondRefundAmount, "REFUNDED"), aRefundMatching(firstRefundId, is(notNullValue()), chargeId, firstRefundAmount, "REFUNDED"))); assertRefundsHistoryInOrderInDBForTwoRefunds(defaultTestCharge); connectorRestApiClient.withChargeId(externalChargeId) .getCharge() .statusCode(200) .body("refund_summary.status", is("full")) .body("refund_summary.amount_available", is(0)) .body("refund_summary.amount_submitted", is(100)); }
Source:
protected void remove() { if (getWindow() != null) { return; } ConfirmationModel window = new ConfirmationModel(); setWindow(window); window.setTitle(ConstantsManager.getInstance().getConstants().removeUnregisteredTemplatesTitle()); window.setHelpTag(HelpTag.remove_unregistered_template); window.setHashName("remove_unregistered_templates"); ArrayList<String> items = new ArrayList<>(); List<VmTemplate> templates = (List<VmTemplate>) getSelectedItems(); for (VmTemplate template : templates) { if (!template.getId().equals(Guid.Empty)) { items.add(template.getName()); } } window.setItems(items); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this); window.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); window.getCommands().add(tempVar2); }

Target:
protected void remove() { if (getWindow() != null) { return; } ConfirmationModel window = new ConfirmationModel(); setWindow(window); window.setTitle(ConstantsManager.getInstance().getConstants().removeUnregisteredTemplatesTitle()); window.setHelpTag(HelpTag.remove_unregistered_template); window.setHashName("remove_unregistered_templates"); List<String> items = getSelectedItems().stream() .map(item -> (VmTemplate) item) .filter(vmTemplate -> vmTemplate.getId().isNullOrEmpty(Guid.Empty)) .map(VmTemplate::getName) .collect(Collectors.toList()); window.setItems(items); UICommand onRemoveUiCommand = UICommand.createDefaultOkUiCommand("OnRemove", this); window.getCommands().add(onRemoveUiCommand); UICommand cancelUiCommand = UICommand.createCancelUiCommand("Cancel", this); window.getCommands().add(cancelUiCommand); }
Source:
public void requestDone(HttpServerExchange exchange) { try { Session<LocalSessionContext> session = this.entry.getKey(); if (session.isValid()) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { if (this.batch.getState() == Batch.State.DISCARDED) { this.batch.close(); } try (Batch batch = (this.batch.getState() == Batch.State.CLOSED) ? batcher.createBatch() : this.batch) { if (this.startTime != null) { session.getMetaData().setLastAccessedTime(this.startTime); } session.close(); } } catch (Throwable e) { UndertowClusteringLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e); } } else if (this.batch.getState() != Batch.State.CLOSED) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { this.batch.close(); } } } finally { this.closeTask.accept(exchange); } }

Target:
public void requestDone(HttpServerExchange exchange) { try { Session<LocalSessionContext> session = this.entry.getKey(); if (session.isValid()) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { if (this.batch.getState() == Batch.State.DISCARDED) { this.batch.close(); } try (Batch batch = (this.batch.getState() == Batch.State.CLOSED) ? batcher.createBatch() : this.batch) { if (this.startTime != null) { session.getMetaData().setLastAccess(this.startTime, Instant.now()); } session.close(); } } catch (Throwable e) { UndertowClusteringLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e); } } else if (this.batch.getState() != Batch.State.CLOSED) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { this.batch.close(); } } } finally { this.closeTask.accept(exchange); } }
Source:
public void queuePublishingWithoutSubscribers() throws XPathExpressionException, AndesClientConfigurationException, IOException, AndesClientException, JMSException, NamingException, AutomationUtilException, AndesAdminServiceBrokerManagerAdminException { int messageCount = 2000; String queueName = "pubWithoutSubQueue"; LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext); String sessionCookie = loginLogoutClientForAdmin.login(); AndesAdminClient admin = new AndesAdminClient(super.backendURL, sessionCookie); admin.createQueue(queueName); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(getAMQPPort(), ExchangeType.QUEUE, queueName); publisherConfig.setTransactionalSession(true); publisherConfig.setNumberOfMessagesToSend(messageCount); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(5000); org.wso2.carbon.andes.stub.admin.types.Message[] messages = admin.browseQueue(queueName, 0, messageCount); Assert.assertEquals(messages.length, messageCount, "All messages did not get published to the queue."); }

Target:
public void queuePublishingWithoutSubscribers() throws XPathExpressionException, AndesClientConfigurationException, IOException, AndesClientException, JMSException, NamingException, AutomationUtilException, AndesAdminServiceBrokerManagerAdminException { int messageCount = 2000; String queueName = "pubWithoutSubQueue"; LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext); String sessionCookie = loginLogoutClientForAdmin.login(); AndesAdminClient admin = new AndesAdminClient(super.backendURL, sessionCookie); admin.createQueue(queueName); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(getAMQPPort(), ExchangeType.QUEUE, queueName); publisherConfig.setTransactionalSession(true); publisherConfig.setNumberOfMessagesToSend(messageCount); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(121000); org.wso2.carbon.andes.stub.admin.types.Message[] messages = admin.browseQueue(queueName, 0, messageCount); Assert.assertEquals(messages.length, messageCount, "All messages did not get published to the queue."); }
Source:
private void generateIdentifiers(final ElkGraphElement element) { new ElkGraphSwitch<Object>() { @Override public Object caseElkNode(final ElkNode node) { if (node.getParent() == null) { setIdentifierIfMissing(node, "G1"); } else { setIdentifierIfMissing(node, "N" + currNodeId++); } node.getLabels().stream().forEach(l -> generateIdentifiers(l)); node.getPorts().stream().forEach(l -> generateIdentifiers(l)); node.getContainedEdges().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkPort(final ElkPort port) { setIdentifierIfMissing(port, "P" + currPortId++); port.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkLabel(final ElkLabel label) { setIdentifierIfMissing(label, "L" + currLabelId++); label.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkEdge(final ElkEdge edge) { setIdentifierIfMissing(edge, "E" + currEdgeId++); edge.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkEdgeSection(final ElkEdgeSection section) { setIdentifierIfMissing(section, "ES" + currEdgeSectionId++); return null; } }.doSwitch(element); }

Target:
private void generateIdentifiers(final ElkGraphElement element) { new ElkGraphSwitch<Object>() { @Override public Object caseElkNode(final ElkNode node) { if (node.getParent() == null) { if (node.getIdentifier() == null || node.getIdentifier().trim().isEmpty()) { node.setIdentifier("G1"); } } else { setIdentifierIfMissing(node, ElementType.NODE); } node.getLabels().stream().forEach(l -> generateIdentifiers(l)); node.getPorts().stream().forEach(l -> generateIdentifiers(l)); node.getContainedEdges().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkPort(final ElkPort port) { setIdentifierIfMissing(port, ElementType.PORT); port.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkLabel(final ElkLabel label) { setIdentifierIfMissing(label, ElementType.LABEL); label.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkEdge(final ElkEdge edge) { setIdentifierIfMissing(edge, ElementType.EDGE); edge.getLabels().stream().forEach(l -> generateIdentifiers(l)); return null; } @Override public Object caseElkEdgeSection(final ElkEdgeSection section) { setIdentifierIfMissing(section); return null; } }.doSwitch(element); }
Source:
private void notify(final Error error, boolean blocking) { if (error.shouldIgnoreClass()) { return; } if (!config.shouldNotifyForReleaseStage(appData.getReleaseStage())) { return; } HashMap<String, String> breadcrumbMetadata = new HashMap<String, String>(); breadcrumbMetadata.put("message", error.getExceptionMessage()); breadcrumbs.add(error.getExceptionName(), BreadcrumbType.ERROR, breadcrumbMetadata); error.setAppData(appData); error.setDeviceData(deviceData); error.setAppState(new AppState(appContext)); error.setDeviceState(new DeviceState(appContext)); error.setBreadcrumbs(breadcrumbs); error.setUser(user); if (!runBeforeNotifyTasks(error)) { Logger.info("Skipping notification - beforeNotify task returned false"); return; } final Notification notification = new Notification(config); notification.addError(error); if (blocking) { deliver(notification, error); } else { Async.run(new Runnable() { @Override public void run() { deliver(notification, error); } }); } }

Target:
private void notify(final Error error, boolean blocking) { if (error.shouldIgnoreClass()) { return; } if (!config.shouldNotifyForReleaseStage(appData.getReleaseStage())) { return; } breadcrumbs.add(error.getExceptionName(), BreadcrumbType.ERROR, Collections.singletonMap("message", error.getExceptionMessage())); error.setAppData(appData); error.setDeviceData(deviceData); error.setAppState(new AppState(appContext)); error.setDeviceState(new DeviceState(appContext)); error.setBreadcrumbs(breadcrumbs); error.setUser(user); if (!runBeforeNotifyTasks(error)) { Logger.info("Skipping notification - beforeNotify task returned false"); return; } final Notification notification = new Notification(config); notification.addError(error); if (blocking) { deliver(notification, error); } else { Async.run(new Runnable() { @Override public void run() { deliver(notification, error); } }); } }
Source:
public void execute(final JobExecutionContext jobContext) throws JobExecutionException { SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); if (!ff4j.check(FeatureList.EFFECTIVE_RULE_DATE)) { LOGGER.info("The " + FeatureList.EFFECTIVE_RULE_DATE + " flag is off. " + "Macra Measueres will not be updated."); } else { LOGGER.info(SPACER + " Started the " + JOB_NAME + " job " + SPACER); TransactionTemplate txnTemplate = new TransactionTemplate(txnMgr); txnTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { try { macraMeasureDAO.updateSubstringInAllValues(OLD_G1G2_SUBSTRING, NEW_G1G2_SUBSTRING); LOGGER.info(SPACER + " Updated all g1g2 '" + OLD_G1G2_SUBSTRING + "' MACRA measures to '" + NEW_G1G2_SUBSTRING + "' " + SPACER); } catch (Exception e) { LOGGER.error(e.getMessage(), e); status.setRollbackOnly(); } } }); certifiedProductDetailsManager.refreshData(); LOGGER.info(SPACER + " Completed the " + JOB_NAME + " job " + SPACER); } }

Target:
public void execute(final JobExecutionContext jobContext) throws JobExecutionException { SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); LOGGER.info(SPACER + " Started the " + JOB_NAME + " job " + SPACER); TransactionTemplate txnTemplate = new TransactionTemplate(txnMgr); txnTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { try { updateMacraMeasuresDao.updateSubstringInAllValues(OLD_G1G2_SUBSTRING, NEW_G1G2_SUBSTRING); LOGGER.info(SPACER + " Updated all g1g2 '" + OLD_G1G2_SUBSTRING + "' MACRA measures to '" + NEW_G1G2_SUBSTRING + "' " + SPACER); } catch (Exception e) { LOGGER.error(e.getMessage(), e); status.setRollbackOnly(); } } }); CacheManager.getInstance().clearAll(); certifiedProductDetailsManager.refreshData(); pcpManager.refreshData(); LOGGER.info(SPACER + " Completed the " + JOB_NAME + " job " + SPACER); }
Source:
private Method resolveMethod(ClientConnectionContext ctx, Class<?> cls) throws ReflectiveOperationException { if (paramTypeIds != null) { MethodDescriptor desc = new MethodDescriptor(cls, methodName, paramTypeIds); Method method = methodsCache.get(desc); if (method != null) return method; BinaryContext bctx = ((CacheObjectBinaryProcessorImpl)ctx.kernalContext().cacheObjects()).binaryContext(); for (Method method0 : cls.getMethods()) { if (methodName.equals(method0.getName())) { MethodDescriptor desc0 = MethodDescriptor.forMethod(bctx, method0); methodsCache.putIfAbsent(desc0, method0); if (desc0.equals(desc)) return method0; } } throw new NoSuchMethodException("Method not found: " + desc); } return PlatformServices.getMethod(cls, methodName, args); }

Target:
private Method resolveMethod(ClientConnectionContext ctx, Class<?> cls) throws ReflectiveOperationException { if (paramTypeIds != null) { MethodDescriptor desc = new MethodDescriptor(cls, methodName, paramTypeIds); Method method = methodsCache.get(desc); if (method != null) return method; IgniteBinary binary = ctx.kernalContext().grid().binary(); for (Method method0 : cls.getMethods()) { if (methodName.equals(method0.getName())) { MethodDescriptor desc0 = MethodDescriptor.forMethod(binary, method0); methodsCache.putIfAbsent(desc0, method0); if (desc0.equals(desc)) return method0; } } throw new NoSuchMethodException("Method not found: " + desc); } return PlatformServices.getMethod(cls, methodName, args); }
Source:
public void removeServiceEventListener(Object listener) { assert getExecutor().isInExecutorThread(); ListenerEntry entry = new ListenerEntry(listener, null); if (DsfDebugOptions.DEBUG && DsfDebugOptions.DEBUG_SESSION && DsfDebugOptions.DEBUG_SESSION_LISTENERS) { String msg = new Formatter().format( "%s %s removed as a service listener to %s (id=%s)", DsfPlugin.getDebugTime(), LoggingUtils.toString(listener), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fListeners.remove(entry); }

Target:
public void removeServiceEventListener(Object listener) { assert getExecutor().isInExecutorThread(); ListenerEntry entry = new ListenerEntry(listener, null); if (DsfDebugOptions.DEBUG_SESSION_LISTENERS) { String msg = new Formatter().format( "%s %s removed as a service listener to %s (id=%s)", DsfPlugin.getDebugTime(), LoggingUtils.toString(listener), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fListeners.remove(entry); }
Source:
private static IEnumState getEventState(ITimeEvent event) { if (event instanceof BarChartEvent) { BarChartEvent tcEvent = (BarChartEvent) event; ResourcesEntry entry = (ResourcesEntry)event.getEntry(); int value = tcEvent.getValue(); if (entry instanceof ResourcesEntryCpu) { if (value == StateValues.CPU_STATUS_IDLE) { return State.IDLE; } else if (value == StateValues.CPU_STATUS_RUN_USERMODE) { return State.USERMODE; } else if (value == StateValues.CPU_STATUS_RUN_SYSCALL) { return State.SYSCALL; } else if (value == StateValues.CPU_STATUS_IRQ) { return State.IRQ; } else if (value == StateValues.CPU_STATUS_SOFTIRQ) { return State.SOFT_IRQ; } } else if (entry instanceof ResourcesEntryIrq && value != BarChartEvent.NOVALUE) { return State.IRQ_ACTIVE; } else if (entry instanceof ResourcesEntrySoftirq && value != BarChartEvent.NOVALUE) { if (value == StateValues.SOFT_IRQ_RAISED) { return State.SOFT_IRQ_RAISED; } return State.SOFT_IRQ_ACTIVE; } } return null; }

Target:
private static IEnumState getEventState(ITimeEvent event) { if (event instanceof BarChartEvent) { BarChartEvent tcEvent = (BarChartEvent) event; ResourcesEntry entry = (ResourcesEntry) event.getEntry(); int value = tcEvent.getValue(); if (entry.getType() == Type.CPU) { if (value == StateValues.CPU_STATUS_IDLE) { return State.IDLE; } else if (value == StateValues.CPU_STATUS_RUN_USERMODE) { return State.USERMODE; } else if (value == StateValues.CPU_STATUS_RUN_SYSCALL) { return State.SYSCALL; } else if (value == StateValues.CPU_STATUS_IRQ) { return State.IRQ; } else if (value == StateValues.CPU_STATUS_SOFTIRQ) { return State.SOFT_IRQ; } } else if ((entry.getType() == Type.IRQ) && (value != BarChartEvent.NOVALUE)) { return State.IRQ_ACTIVE; } else if ((entry.getType() == Type.SOFT_IRQ) && (value != BarChartEvent.NOVALUE)) { if (value == StateValues.SOFT_IRQ_RAISED) { return State.SOFT_IRQ_RAISED; } return State.SOFT_IRQ_ACTIVE; } } return null; }
Source:
public Builder(Builder<T> builder) { super(builder); this.useLayerNormalization=builder.useLayerNormalization; }

Target:
public Builder(Builder<T> builder) { super(builder); this.useLayerNormalization = builder.useLayerNormalization; this.normalizePerRecord = builder.normalizePerRecord; }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); Binding type; for (int i = 0, length = valueTable.length; i < length; i++) { if ((type = valueTable[i]) != null) { sb.append(type.toString()); sb.append("\n"); } } return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); Binding type; for (int i = 0, length = valueTable.length; i < length; i++) { if ((type = valueTable[i]) != null) { sb.append(type); sb.append("\n"); } } return sb.toString(); }
Source:
public List<WorkerInfo> getWorkerInfoList() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } try { return mWorkerInfoCache.get(WORKER_INFO_CACHE_KEY); } catch (ExecutionException e) { throw new UnavailableException("Unable to get worker info list from cache"); } }

Target:
public List<WorkerInfo> getWorkerInfoList() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } try { return mWorkerInfoCache.get(WORKER_INFO_CACHE_KEY); } catch (ExecutionException e) { throw new UnavailableException("Unable to get worker info list from cache", e); } }
Source:
public void awaitFlushCompletion(long timeoutMs) throws InterruptedException { try { Long expireMs = System.currentTimeMillis() + timeoutMs; for (ProducerBatch batch : this.incomplete.copyAll()) { Long currentMs = System.currentTimeMillis(); if (currentMs > expireMs) { throw new TimeoutException("Failed to flush accumulated records within" + timeoutMs + "milliseconds."); } boolean completed = batch.produceFuture.await(Math.max(expireMs - currentMs, 0), TimeUnit.MILLISECONDS); if (!completed) { throw new TimeoutException("Failed to flush accumulated records within" + timeoutMs + "milliseconds."); } } } finally { this.flushesInProgress.decrementAndGet(); } }

Target:
public void awaitFlushCompletion(long timeoutMs) throws InterruptedException { try { Long expireMs = System.currentTimeMillis() + timeoutMs; int numBatchesFlushed = 0; for (ProducerBatch batch : this.incomplete.copyAll()) { Long currentMs = System.currentTimeMillis(); if (currentMs > expireMs) { throw new TimeoutException(String.format("Failed to flush accumulated records within %d milliseconds," + " successfully completed %d batches.", timeoutMs, numBatchesFlushed)); } boolean completed = batch.produceFuture.await(Math.max(expireMs - currentMs, 0), TimeUnit.MILLISECONDS); if (!completed) { throw new TimeoutException(String.format("Failed to flush accumulated records within %d milliseconds," + " successfully completed %d batches.", timeoutMs, numBatchesFlushed)); } numBatchesFlushed++; } } finally { this.flushesInProgress.decrementAndGet(); } }
Source:
private synchronized void checkAllTaskFinal() { if (stateMachine.getState().isDone() && tasksWithFinalInfo.containsAll(allTasks)) { if (getFragment().getStageExecutionDescriptor().isStageGroupedExecution()) { switch (stateMachine.getState()) { case FINISHED: checkState(finishedLifespans.size() == totalLifespans); break; case CANCELED: case ABORTED: case FAILED: checkState(finishedLifespans.size() <= totalLifespans); break; default: throw new IllegalStateException("Unrecognized done stage state: " + stateMachine.getState()); } } else { checkState(finishedLifespans.isEmpty()); } List<TaskInfo> finalTaskInfos = getAllTasks().stream() .map(RemoteTask::getTaskInfo) .collect(toImmutableList()); stateMachine.setAllTasksFinal(finalTaskInfos, totalLifespans); } }

Target:
private synchronized void checkAllTaskFinal() { if (stateMachine.getState().isDone() && tasksWithFinalInfo.containsAll(allTasks)) { if (getFragment().getStageExecutionDescriptor().isStageGroupedExecution()) { checkState(finishedLifespans.size() <= totalLifespans, format("Number of finished lifespans (%s) exceeds number of total lifespans (%s)", finishedLifespans.size(), totalLifespans)); } else { checkState(finishedLifespans.isEmpty()); } List<TaskInfo> finalTaskInfos = getAllTasks().stream() .map(RemoteTask::getTaskInfo) .collect(toImmutableList()); stateMachine.setAllTasksFinal(finalTaskInfos, totalLifespans); } }
Source:
public static Optional<boolean[]> decodeNullBits(SliceInput sliceInput, int positionCount) { if (sliceInput.readByte() == 0) { return Optional.empty(); } boolean[] valueIsNull = new boolean[positionCount]; for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = sliceInput.readByte(); valueIsNull[position] = ((value & 0b1000_0000) != 0); valueIsNull[position + 1] = ((value & 0b0100_0000) != 0); valueIsNull[position + 2] = ((value & 0b0010_0000) != 0); valueIsNull[position + 3] = ((value & 0b0001_0000) != 0); valueIsNull[position + 4] = ((value & 0b0000_1000) != 0); valueIsNull[position + 5] = ((value & 0b0000_0100) != 0); valueIsNull[position + 6] = ((value & 0b0000_0010) != 0); valueIsNull[position + 7] = ((value & 0b0000_0001) != 0); } if ((positionCount & 0b111) > 0) { byte value = sliceInput.readByte(); int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { valueIsNull[position] = ((value & mask) != 0); mask >>>= 1; } } return Optional.of(valueIsNull); }

Target:
public static Optional<boolean[]> decodeNullBits(SliceInput sliceInput, int positionCount) { if (!sliceInput.readBoolean()) { return Optional.empty(); } boolean[] valueIsNull = new boolean[positionCount]; for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = sliceInput.readByte(); valueIsNull[position] = ((value & 0b1000_0000) != 0); valueIsNull[position + 1] = ((value & 0b0100_0000) != 0); valueIsNull[position + 2] = ((value & 0b0010_0000) != 0); valueIsNull[position + 3] = ((value & 0b0001_0000) != 0); valueIsNull[position + 4] = ((value & 0b0000_1000) != 0); valueIsNull[position + 5] = ((value & 0b0000_0100) != 0); valueIsNull[position + 6] = ((value & 0b0000_0010) != 0); valueIsNull[position + 7] = ((value & 0b0000_0001) != 0); } if ((positionCount & 0b111) > 0) { byte value = sliceInput.readByte(); int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { valueIsNull[position] = ((value & mask) != 0); mask >>>= 1; } } return Optional.of(valueIsNull); }
Source:
public void toggleTransparency() { CustomScaleImageView imageView = findScaleImageView(); GifImageView gifView = findGifImageView(); if (imageView == null && gifView == null) return; boolean isImage = imageView != null && gifView == null; if (backgroundToggle) { if (isImage) { imageView.setTileBackgroundColor(Color.TRANSPARENT); } else { gifView.getDrawable().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.DST_OVER); } backgroundToggle = false; } else { if (isImage) { imageView.setTileBackgroundColor(BACKGROUND_COLOR); } else { gifView.getDrawable().setColorFilter(BACKGROUND_COLOR, PorterDuff.Mode.DST_OVER); } backgroundToggle = true; } }

Target:
public void toggleTransparency() { CustomScaleImageView imageView = findScaleImageView(); GifImageView gifView = findGifImageView(); if (imageView == null && gifView == null) return; boolean isImage = imageView != null && gifView == null; int backgroundColor = backgroundToggle ? Color.TRANSPARENT : BACKGROUND_COLOR; if (isImage) { imageView.setTileBackgroundColor(backgroundColor); } else { gifView.getDrawable().setColorFilter(backgroundColor, PorterDuff.Mode.DST_OVER); } backgroundToggle = !backgroundToggle; }
Source:
private void addScript() throws IOException { ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); String scriptName = "SOAP Support.js"; if (extScript != null && extScript.getScript(scriptName) == null) { ScriptType variantType = extScript.getScriptType(ExtensionActiveScan.SCRIPT_TYPE_VARIANT); ScriptEngineWrapper engine = extScript.getEngineWrapper("Oracle Nashorn"); if (variantType != null && engine != null) { File scriptPath = Paths.get( Constant.getZapHome(), ExtensionScript.SCRIPTS_DIR, ExtensionScript.SCRIPTS_DIR, ExtensionActiveScan.SCRIPT_TYPE_VARIANT, scriptName) .toFile(); ScriptWrapper script = new ScriptWrapper( scriptName, Constant.messages.getString("soap.script.description"), engine, variantType, true, scriptPath); script.reloadScript(); extScript.addScript(script, false); } } }

Target:
private void addScript() throws IOException { ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); String scriptName = "SOAP Support.js"; if (extScript != null && extScript.getScript(scriptName) == null) { ScriptType variantType = extScript.getScriptType(ExtensionActiveScan.SCRIPT_TYPE_VARIANT); ScriptEngineWrapper engine = extScript.getEngineWrapper("Oracle Nashorn"); if (variantType != null && engine != null) { File scriptPath = Paths.get( Constant.getZapHome(), ExtensionScript.SCRIPTS_DIR, ExtensionScript.SCRIPTS_DIR, ExtensionActiveScan.SCRIPT_TYPE_VARIANT, scriptName) .toFile(); ScriptWrapper script = new ScriptWrapper( scriptName, Constant.messages.getString("soap.script.description"), engine, variantType, true, scriptPath); script.setLoadOnStart(true); script.reloadScript(); extScript.addScript(script, false); } } }
Source:
void processWebCacheDbFile(String eseDumperPath, List<AbstractFile> webCacheFiles) throws IOException, TskCoreException { for (AbstractFile webCacheFile : webCacheFiles) { if (context.dataSourceIngestIsCancelled()) { return; } clearContainerTable(); String tempWebCacheFileName = EDGE_WEBCACHE_PREFIX + Integer.toString((int) webCacheFile.getId()) + EDGE_WEBCACHE_EXT; File tempWebCacheFile = new File(RAImageIngestModule.getRATempPath(currentCase, EDGE), tempWebCacheFileName); try { ContentUtils.writeToFile(webCacheFile, tempWebCacheFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new IOException("Error writingToFile: " + webCacheFile, ex); } File resultsDir = new File(moduleTempResultPath.toAbsolutePath() + Integer.toString((int) webCacheFile.getId())); resultsDir.mkdirs(); try { executeDumper(eseDumperPath, tempWebCacheFile.getAbsolutePath(), resultsDir.getAbsolutePath()); if (context.dataSourceIngestIsCancelled()) { return; } this.getHistory(webCacheFile, resultsDir); if (context.dataSourceIngestIsCancelled()) { return; } this.getCookie(webCacheFile, resultsDir); } finally { tempWebCacheFile.delete(); resultsDir.delete(); } } }

Target:
void processWebCacheDbFile(String eseDumperPath, List<AbstractFile> webCacheFiles) throws IOException, TskCoreException { for (AbstractFile webCacheFile : webCacheFiles) { if (context.dataSourceIngestIsCancelled()) { return; } clearContainerTable(); String tempWebCacheFileName = EDGE_WEBCACHE_PREFIX + Integer.toString((int) webCacheFile.getId()) + EDGE_WEBCACHE_EXT; File tempWebCacheFile = new File(RAImageIngestModule.getRATempPath(currentCase, EDGE), tempWebCacheFileName); try { ContentUtils.writeToFile(webCacheFile, tempWebCacheFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new IOException("Error writingToFile: " + webCacheFile, ex); } File resultsDir = new File(moduleTempResultPath.toAbsolutePath() + Integer.toString((int) webCacheFile.getId())); resultsDir.mkdirs(); try { executeDumper(eseDumperPath, tempWebCacheFile.getAbsolutePath(), resultsDir.getAbsolutePath()); if (context.dataSourceIngestIsCancelled()) { return; } this.getHistory(webCacheFile, resultsDir); if (context.dataSourceIngestIsCancelled()) { return; } this.getCookies(webCacheFile, resultsDir); } finally { tempWebCacheFile.delete(); resultsDir.delete(); } } }
Source:
private void completeRequest(boolean closeNetworkChannel) { if (closeNetworkChannel && ctx.channel().isOpen()) { writeFuture.addListener(ChannelFutureListener.CLOSE); logger.trace("Requested closing of channel {}", ctx.channel()); } if (request != null && request.isOpen()) { closeRequest(); } responseComplete = true; }

Target:
private void completeRequest(boolean closeNetworkChannel) { if (closeNetworkChannel && ctx.channel().isOpen()) { writeFuture.addListener(ChannelFutureListener.CLOSE); logger.trace("Requested closing of channel {}", ctx.channel()); } closeRequest(); responseComplete = true; }