auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String getFactorySnippet(String factoryId, String snippetType, UriInfo uriInfo) throws NotFoundException, ServerException { requireNonNull(factoryId); final URI baseUri = uriInfo.getBaseUri(); final String baseUrl = UriBuilder.fromUri(baseUri) .replacePath("") .build() .toString(); switch (snippetType) { case URL_SNIPPET_TYPE: return UriBuilder.fromUri(baseUri) .replacePath("factory") .queryParam("id", factoryId) .build() .toString(); case HTML_SNIPPET_TYPE: return SnippetGenerator.generateHtmlSnippet(baseUrl, factoryId); case IFRAME_SNIPPET_TYPE: return SnippetGenerator.generateiFrameSnippet(baseUrl, factoryId); case MARKDOWN_SNIPPET_TYPE: final Set<FactoryImage> images = getFactoryImages(factoryId); final String imageId = (images.size() > 0) ? images.iterator().next().getName() : null; try { return SnippetGenerator.generateMarkdownSnippet(baseUrl, getById(factoryId), imageId); } catch (IllegalArgumentException e) { throw new ServerException(e.getLocalizedMessage()); } default: return null; } }

Target:
public String getFactorySnippet(String factoryId, String snippetType, UriInfo uriInfo) throws NotFoundException, ServerException { requireNonNull(factoryId); final URI baseUri = uriInfo.getBaseUri(); final String baseUrl = UriBuilder.fromUri(baseUri) .replacePath("") .build() .toString(); switch (firstNonNull(snippetType, URL_SNIPPET_TYPE)) { case URL_SNIPPET_TYPE: return UriBuilder.fromUri(baseUri) .replacePath("factory") .queryParam("id", factoryId) .build() .toString(); case HTML_SNIPPET_TYPE: return SnippetGenerator.generateHtmlSnippet(baseUrl, factoryId); case IFRAME_SNIPPET_TYPE: return SnippetGenerator.generateiFrameSnippet(baseUrl, factoryId); case MARKDOWN_SNIPPET_TYPE: final Set<FactoryImage> images = getFactoryImages(factoryId); final String imageId = (images.size() > 0) ? images.iterator().next().getName() : null; try { return SnippetGenerator.generateMarkdownSnippet(baseUrl, getById(factoryId), imageId); } catch (IllegalArgumentException e) { throw new ServerException(e.getLocalizedMessage()); } default: return null; } }
Source:
public int compare(Map<String, String> map1, Map<String, String> map2) { return new LexoNumericComparator().compare(map1.get(key), map2.get(key)); }

Target:
public int compare(Map<String, String> map1, Map<String, String> map2) { return lexoNumericComparator.compare(map1.get(key), map2.get(key)); }
Source:
public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException { for (Collector.MetricFamilySamples metricFamilySamples: Collections.list(mfs)) { writer.write("# HELP " + metricFamilySamples.name + " " + escapeHelp(metricFamilySamples.help) + "\n"); writer.write("# TYPE " + metricFamilySamples.name + " " + typeString(metricFamilySamples.type) + "\n"); for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) { writer.write(sample.name); if (sample.labels != null && !sample.labels.isEmpty()) { writer.write("{"); for (Map.Entry<String, String> label : sample.labels.entrySet()) { writer.write(String.format("%s=\"%s\",", label.getKey(), escapeLabelValue(label.getValue()))); } writer.write("}"); } writer.write(" " + Collector.doubleToGoString(sample.value) + "\n"); } } }

Target:
public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException { for (Collector.MetricFamilySamples metricFamilySamples: Collections.list(mfs)) { writer.write("# HELP " + metricFamilySamples.name + " " + escapeHelp(metricFamilySamples.help) + "\n"); writer.write("# TYPE " + metricFamilySamples.name + " " + typeString(metricFamilySamples.type) + "\n"); for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) { writer.write(sample.toString() + "\n"); } } }
Source:
public void stop() { synchronized (lock) { if (!started) { return; } rules.set(new HashMap<String, List<Rule>>()); started = false; exec.shutdownNow(); exec = null; } }

Target:
public void stop() { synchronized (lock) { if (!started) { return; } rules.set(Collections.emptyMap()); started = false; exec.shutdownNow(); exec = null; } }
Source:
public String toString() { return String.format("Checkpoint: %s, Topic: %s, Partition: %d, Event Index: %d, Source Partition: %d", _checkpoint, _topic, _partition, _eventIndex, _sourcePartition); }

Target:
public String toString() { return String.format("Checkpoint: %s, Topic: %s, Destination Partition: %d, Event Index: %d, Source Partition: %d", _checkpoint, _topic, _partition, _eventIndex, _sourcePartition); }
Source:
public void loadValidators(Props props, Logger log) { validators = new LinkedHashMap<String, ProjectValidator>(); DirectoryFlowLoader flowLoader = new DirectoryFlowLoader(log); validators.put(flowLoader.getValidatorInfo(), flowLoader); if (!props.containsKey(XML_FILE_PARAM)) { return; } String xmlPath = props.get(XML_FILE_PARAM); File file = new File(xmlPath); if (!file.exists()) { return; } DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; try { builder = docBuilderFactory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ValidatorManagerException( "Exception while parsing validator xml. Document builder not created.", e); } Document doc = null; try { doc = builder.parse(file); } catch (SAXException e) { throw new ValidatorManagerException("Exception while parsing " + xmlPath + ". Invalid XML.", e); } catch (IOException e) { throw new ValidatorManagerException("Exception while parsing " + xmlPath + ". Error reading file.", e); } NodeList tagList = doc.getChildNodes(); Node azkabanValidators = tagList.item(0); NodeList azkabanValidatorsList = azkabanValidators.getChildNodes(); for (int i = 0; i < azkabanValidatorsList.getLength(); ++i) { Node node = azkabanValidatorsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equals(VALIDATOR_TAG)) { parseValidatorTag(node, props, log); } } } }

Target:
public void loadValidators(Props props, Logger log) { validators = new LinkedHashMap<String, ProjectValidator>(); DirectoryFlowLoader flowLoader = new DirectoryFlowLoader(log); validators.put(flowLoader.getValidatorName(), flowLoader); if (!props.containsKey(XML_FILE_PARAM)) { logger.warn("Azkaban properties file does not contain the key " + XML_FILE_PARAM); return; } String xmlPath = props.get(XML_FILE_PARAM); File file = new File(xmlPath); if (!file.exists()) { logger.error("Azkaban validator configuration file " + xmlPath + " does not exist."); return; } DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; try { builder = docBuilderFactory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ValidatorManagerException( "Exception while parsing validator xml. Document builder not created.", e); } Document doc = null; try { doc = builder.parse(file); } catch (SAXException e) { throw new ValidatorManagerException("Exception while parsing " + xmlPath + ". Invalid XML.", e); } catch (IOException e) { throw new ValidatorManagerException("Exception while parsing " + xmlPath + ". Error reading file.", e); } NodeList tagList = doc.getChildNodes(); Node azkabanValidators = tagList.item(0); NodeList azkabanValidatorsList = azkabanValidators.getChildNodes(); for (int i = 0; i < azkabanValidatorsList.getLength(); ++i) { Node node = azkabanValidatorsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equals(VALIDATOR_TAG)) { parseValidatorTag(node, props, log); } } } }
Source:
protected List<String> getProcessDefinitionFiles() { List<String> processes = new ArrayList<String>(); processes.add("cases/EmptyCase.bpmn2"); processes.add("cases/UserTaskCase.bpmn2"); processes.add("processes/UserTaskProcess.bpmn2"); return processes; }

Target:
protected List<String> getProcessDefinitionFiles() { List<String> processes = new ArrayList<String>(); processes.add("cases/EmptyCase.bpmn2"); processes.add("cases/UserTaskCase.bpmn2"); return processes; }
Source:
public MultipartAttachmentWriter() { this.basicBoundary = this.makeBoundary(); this.boundary = ("--"+basicBoundary).getBytes(); this.trailingBoundary = ("--"+basicBoundary+"--").getBytes(); components = new ArrayList<InputStream>(); contentLength += boundary.length; contentLength += 6; contentLength += contentType.length; components.add(new ByteArrayInputStream(boundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); }

Target:
public MultipartAttachmentWriter() { this.boundary = this.makeBoundary(); this.partBoundary = ("--"+boundary).getBytes(); this.trailingBoundary = ("--"+boundary+"--").getBytes(); components = new ArrayList<InputStream>(); contentLength += partBoundary.length; contentLength += 6; contentLength += contentType.length; components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); }
Source:
public static ServerScope parse(String scope) throws IllegalArgumentException { if (scope.startsWith("unlimited")) { return new Unlimited(); } String[] chunks = scope.trim().split(":", 2); if (chunks.length != 2) throw new IllegalArgumentException("Invalid scope: " + scope); if ("node".equals(chunks[0])) { return new Node(chunks[1]); } else if ("run".equals(chunks[0])) { return new Build(chunks[1]); } else if ("time".equals(chunks[0])) { return new Time(chunks[1]); } else { throw new IllegalArgumentException("Invalid scope kind: " + chunks[0]); } }

Target:
public static ServerScope parse(String scope) throws IllegalArgumentException { if (scope.startsWith("unlimited")) { return Unlimited.getInstance(); } String[] chunks = scope.trim().split(":", 2); if (chunks.length != 2) throw new IllegalArgumentException("Invalid scope: " + scope); if ("node".equals(chunks[0])) { return new Node(chunks[1]); } else if ("run".equals(chunks[0])) { return new Build(chunks[1]); } else if ("time".equals(chunks[0])) { return new Time(chunks[1]); } else { throw new IllegalArgumentException("Invalid scope kind: " + chunks[0]); } }
Source:
public void testDoesNotFireOnNestedNonCountAggregate() { tester().assertThat(new PruneCountAggregationOverScalar()) .on(p -> { Symbol totalPrice = p.symbol("total_price", DOUBLE); AggregationNode inner = p.aggregation((a) -> a .addAggregation(totalPrice, new FunctionCall(QualifiedName.of("sum"), ImmutableList.of(new SymbolReference("totalprice"))), ImmutableList.of(DOUBLE)) .globalGrouping() .source( p.project( Assignments.of(totalPrice, totalPrice.toSymbolReference()), p.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)), ImmutableList.of(totalPrice), ImmutableMap.of(totalPrice, new TpchColumnHandle(totalPrice.getName(), DOUBLE)))))); return p.aggregation((a) -> a .addAggregation( p.symbol("sum_outer", DOUBLE), new FunctionCall(QualifiedName.of("sum"), ImmutableList.of(new SymbolReference("sum_inner"))), ImmutableList.of(DOUBLE)) .globalGrouping() .source(inner)); }).doesNotFire(); }

Target:
public void testDoesNotFireOnNestedNonCountAggregate() { tester().assertThat(new PruneCountAggregationOverScalar()) .on(p -> { Symbol totalPrice = p.symbol("total_price", DOUBLE); AggregationNode inner = p.aggregation((a) -> a .addAggregation(totalPrice, new FunctionCall(QualifiedName.of("sum"), ImmutableList.of(new SymbolReference("totalprice"))), ImmutableList.of(DOUBLE)) .globalGrouping() .source( p.project( Assignments.of(totalPrice, totalPrice.toSymbolReference()), p.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(totalPrice), ImmutableMap.of(totalPrice, new TpchColumnHandle(totalPrice.getName(), DOUBLE)))))); return p.aggregation((a) -> a .addAggregation( p.symbol("sum_outer", DOUBLE), new FunctionCall(QualifiedName.of("sum"), ImmutableList.of(new SymbolReference("sum_inner"))), ImmutableList.of(DOUBLE)) .globalGrouping() .source(inner)); }).doesNotFire(); }
Source:
private void updateTableLayoutForLabels(ChangeList list) { labelNames = new ArrayList<String>(); for (int i = 0; i < list.size(); i++) { for (String name : list.get(i).labels()) { if (!labelNames.contains(name)) { labelNames.add(name); } } } if (BASE_COLUMNS + labelNames.size() < columns) { int n = columns - (BASE_COLUMNS + labelNames.size()); for (int row = 0; row < table.getRowCount(); row++) { table.removeCells(row, columns, n); } } columns = BASE_COLUMNS + labelNames.size(); FlexCellFormatter fmt = table.getFlexCellFormatter(); for (int i = 0; i < labelNames.size(); i++) { String name = labelNames.get(i); int col = BASE_COLUMNS + i; StringBuilder abbrev = new StringBuilder(); for (String t : name.split("-")) { abbrev.append(t.substring(0, 1).toUpperCase()); } table.setText(0, col, abbrev.toString()); table.getCellFormatter().getElement(0, col).setTitle(name); fmt.addStyleName(0, col, Gerrit.RESOURCES.css().dataHeader()); } }

Target:
private void updateTableLayoutForLabels(ChangeList list) { labelNames = new ArrayList<String>(); for (int i = 0; i < list.size(); i++) { for (String name : list.get(i).labels()) { if (!labelNames.contains(name)) { labelNames.add(name); } } } Collections.sort(labelNames); if (BASE_COLUMNS + labelNames.size() < columns) { int n = columns - (BASE_COLUMNS + labelNames.size()); for (int row = 0; row < table.getRowCount(); row++) { table.removeCells(row, columns, n); } } columns = BASE_COLUMNS + labelNames.size(); FlexCellFormatter fmt = table.getFlexCellFormatter(); for (int i = 0; i < labelNames.size(); i++) { String name = labelNames.get(i); int col = BASE_COLUMNS + i; StringBuilder abbrev = new StringBuilder(); for (String t : name.split("-")) { abbrev.append(t.substring(0, 1).toUpperCase()); } table.setText(0, col, abbrev.toString()); table.getCellFormatter().getElement(0, col).setTitle(name); fmt.addStyleName(0, col, Gerrit.RESOURCES.css().dataHeader()); } }
Source:
public GlusterStatus isGlusterRunning(Guid vdsId) { VDSReturnValue returnValue = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("glusterd"), "status")); if (!returnValue.getSucceeded()) { log.error("Failed to check Gluster running status of host : '{}' ", vdsId); return GlusterStatus.UNKNOWN; } ArrayList<GlusterServerService> returnList = (ArrayList<GlusterServerService>) returnValue.getReturnValue(); if (returnList == null || returnList.isEmpty()) { log.error("Failed to check Gluster running status of host : '{}' returned empty object", vdsId); return GlusterStatus.UNKNOWN; } GlusterServerService gss = returnList.get(0); if (gss != null) { return gss.getStatus().getStatusMsg().equalsIgnoreCase("Up") ? GlusterStatus.UP : GlusterStatus.DOWN; } log.info("Failed to check Gluster running status of host : '{}' ", vdsId); return GlusterStatus.UNKNOWN; }

Target:
public GlusterStatus isGlusterRunning(Guid vdsId) { VDSReturnValue result = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("glusterd"), "status")); if (result.getSucceeded()) { @SuppressWarnings("unchecked") ArrayList<GlusterServerService> serviceList = (ArrayList<GlusterServerService>) result.getReturnValue(); if (serviceList != null && !serviceList.isEmpty()) { return serviceList.get(0).getStatus().getStatusMsg().equalsIgnoreCase("up") ? GlusterStatus.UP : GlusterStatus.DOWN; } } return GlusterStatus.UNKNOWN; }
Source:
SshKeyCacheEntry(final AccountSshKey.Id i, final PublicKey k) { id = i; publicKey = k; lastUsed = null; }

Target:
SshKeyCacheEntry(final AccountSshKey.Id i, final PublicKey k) { id = i; publicKey = k; }
Source:
public void merge(GridHubConfiguration other) { super.merge(other); if (other.jettyMaxThreads != null) jettyMaxThreads = other.jettyMaxThreads; capabilityMatcher = other.capabilityMatcher; if (other.newSessionWaitTimeout != null) newSessionWaitTimeout = other.newSessionWaitTimeout; if (other.prioritizer != null) prioritizer = other.prioritizer; if (other.throwOnCapabilityNotPresent != throwOnCapabilityNotPresent) throwOnCapabilityNotPresent = other.throwOnCapabilityNotPresent; }

Target:
public void merge(GridHubConfiguration other) { super.merge(other); if (other.jettyMaxThreads != null) { jettyMaxThreads = other.jettyMaxThreads; } capabilityMatcher = other.capabilityMatcher; if (other.newSessionWaitTimeout != null) { newSessionWaitTimeout = other.newSessionWaitTimeout; } if (other.prioritizer != null) { prioritizer = other.prioritizer; } if (other.throwOnCapabilityNotPresent != throwOnCapabilityNotPresent) { throwOnCapabilityNotPresent = other.throwOnCapabilityNotPresent; } }
Source:
protected void validateInitialization() { assertNotNull(((YarnResourceManagerDriver) getDriver()).getResourceManagerClient()); assertNotNull(((YarnResourceManagerDriver) getDriver()).getNodeManagerClient()); }

Target:
protected void validateInitialization() throws Exception { assertNotNull(testingYarnAMRMClientAsync); assertNotNull(testingYarnNMClientAsync); verifyFutureCompleted(nodeManagerClientInitFuture); verifyFutureCompleted(nodeManagerClientStartFuture); verifyFutureCompleted(resourceManagerClientInitFuture); verifyFutureCompleted(resourceManagerClientStartFuture); }
Source:
public ImapIdleChannelAdapterSpec adviceChain(Advice... adviceChain) { this.target.setAdviceChain(Arrays.asList(adviceChain)); return this; }

Target:
public ImapIdleChannelAdapterSpec adviceChain(Advice... adviceChain) { this.adviceChain.addAll(Arrays.asList(adviceChain)); return this; }
Source:
public static String getResourceName(String uniqueId) { if (StringUtils.isEmpty(uniqueId)) { return null; } String[] comps = uniqueId.split("@"); if (comps.length > 0) { return comps[comps.length - 1]; } else { return null; } }

Target:
public static String getResourceName(String uniqueId) { if (StringUtils.isEmpty(uniqueId)) { return null; } String[] comps = uniqueId.split(String.valueOf(UNIQUE_ID_PROJECT_NAME_DELIMITER)); if (comps.length > 0) { return comps[comps.length - 1]; } else { return null; } }
Source:
private Class<?> getAdapterType(Object adapter) { final Class<?> klazz; if(adapter.getClass().getName().contains("$Proxy$")){ final String[] split = adapter.getClass().getName().split("\\$Proxy\\$"); try { klazz = Class.forName(split[0]); } catch (final ClassNotFoundException e) { throw new RuntimeException(e); } }else{ klazz = adapter.getClass(); } final Type[] genericInterfaces = klazz.getGenericInterfaces(); final ParameterizedType type = (ParameterizedType) genericInterfaces[0]; final Type actualType = type.getActualTypeArguments()[0]; if (actualType instanceof ParameterizedType) { return (Class<?>) ((ParameterizedType) actualType).getRawType(); } else { return (Class<?>) actualType; } }

Target:
private Class<?> getAdapterType(Object adapter) { final Class<?> klazz = extractRawTypeIfPossible(adapter.getClass()); final Type[] genericInterfaces = klazz.getGenericInterfaces(); final ParameterizedType type = (ParameterizedType) genericInterfaces[0]; final Type actualType = type.getActualTypeArguments()[0]; if (actualType instanceof ParameterizedType) { return (Class<?>) ((ParameterizedType) actualType).getRawType(); } else { return (Class<?>) actualType; } }
Source:
private KeyPair readDecodedKeyPair(final PlainBuffer keyBuffer) throws IOException, GeneralSecurityException { byte[] bytes = new byte[AUTH_MAGIC.length]; keyBuffer.readRawBytes(bytes); if (!ByteArrayUtils.equals(bytes, 0, AUTH_MAGIC, 0, AUTH_MAGIC.length)) { throw new IOException("This key does not contain the 'openssh-key-v1' format magic header"); } String cipherName = keyBuffer.readString(); String kdfName = keyBuffer.readString(); String kdfOptions = keyBuffer.readString(); int nrKeys = keyBuffer.readUInt32AsInt(); if (nrKeys != 1) { throw new IOException("We don't support having more than 1 key in the file (yet)."); } PublicKey publicKey = readPublicKey(new PlainBuffer(keyBuffer.readBytes())); PlainBuffer privateKeyBuffer = new PlainBuffer(keyBuffer.readBytes()); if ("none".equals(cipherName)) { logger.debug("Reading unencrypted keypair"); return readUnencrypted(privateKeyBuffer, publicKey); } else { logger.info("Keypair is encrypted with: " + cipherName + ", " + kdfName + ", " + kdfOptions); throw new IOException("Cannot read encrypted keypair with " + cipherName + " yet.."); } }

Target:
private KeyPair readDecodedKeyPair(final PlainBuffer keyBuffer) throws IOException, GeneralSecurityException { byte[] bytes = new byte[AUTH_MAGIC.length]; keyBuffer.readRawBytes(bytes); if (!ByteArrayUtils.equals(bytes, 0, AUTH_MAGIC, 0, AUTH_MAGIC.length)) { throw new IOException("This key does not contain the 'openssh-key-v1' format magic header"); } String cipherName = keyBuffer.readString(); String kdfName = keyBuffer.readString(); String kdfOptions = keyBuffer.readString(); int nrKeys = keyBuffer.readUInt32AsInt(); if (nrKeys != 1) { throw new IOException("We don't support having more than 1 key in the file (yet)."); } PublicKey publicKey = readPublicKey(new PlainBuffer(keyBuffer.readBytes())); PlainBuffer privateKeyBuffer = new PlainBuffer(keyBuffer.readBytes()); if ("none".equals(cipherName)) { logger.debug("Reading unencrypted keypair"); return readUnencrypted(privateKeyBuffer, publicKey); } else { logger.info("Keypair is encrypted with: " + cipherName + ", " + kdfName + ", " + kdfOptions); throw new IOException("Cannot read encrypted keypair with " + cipherName + " yet."); } }
Source:
public Object decode(Response response, Type type) throws IOException, FeignException { Collection<String> contentTypes = HeaderAccessUtils.caseInsensitiveGet(response.headers(), HttpHeaders.CONTENT_TYPE); if (contentTypes == null) { contentTypes = ImmutableSet.of(); } if (contentTypes.size() == 1 && Iterables.getOnlyElement(contentTypes, "").contains(MediaType.TEXT_PLAIN)) { return stringDecoder.decode(response, type); } return delegate.decode(response, type); }

Target:
public Object decode(Response response, Type type) throws IOException, FeignException { Collection<String> contentTypes = HeaderAccessUtils.caseInsensitiveGet(response.headers(), HttpHeaders.CONTENT_TYPE); if (contentTypes == null) { contentTypes = ImmutableSet.of(); } if (contentTypes.size() == 1 && Iterables.getOnlyElement(contentTypes, "").startsWith(MediaType.TEXT_PLAIN)) { return stringDecoder.decode(response, type); } return delegate.decode(response, type); }
Source:
public static KeySource file(String fileName, KeySource defaultKeySource) { return () -> { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try (final InputStream resource = classLoader.getResourceAsStream(fileName)) { if (resource == null) { final byte[] key = defaultKeySource.getKey(); try (FileOutputStream fos = new FileOutputStream(fileName)) { fos.write(key); fos.flush(); } return key; } else { return IOUtils.toByteArray(resource); } } }; }

Target:
public static KeySource file(String fileName, KeySource defaultKeySource) { if (defaultKeySource == null) { throw new IllegalArgumentException("Default key source cannot be null."); } return () -> { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try (final InputStream resource = classLoader.getResourceAsStream(fileName)) { if (resource == null) { final byte[] key = defaultKeySource.getKey(); try (FileOutputStream fos = new FileOutputStream(fileName)) { fos.write(key); fos.flush(); } return key; } else { return IOUtils.toByteArray(resource); } } }; }
Source:
public void testParagraph() { builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines."); builder.endBlock(); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals( "A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.\n\n", markup); }

Target:
public void testParagraph() { builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("A paragraph ends when a blank line begins!"); builder.endBlock(); builder.endDocument(); assertMarkup("A paragraph ends when a blank line begins!\n\n"); }
Source:
public void testCodeActionsQuickAssist() throws CoreException { MockLanguageServer.reset(); IProject p = TestUtils.createProject(getClass().getSimpleName() + System.currentTimeMillis()); IFile f = TestUtils.createUniqueTestFile(p, "error"); TextEdit tEdit = new TextEdit(new Range(new Position(0, 0), new Position(0, 5)), "fixed"); WorkspaceEdit wEdit = new WorkspaceEdit(Collections.singletonMap(f.getLocationURI().toString(), Collections.singletonList(tEdit))); MockLanguageServer.INSTANCE.setCodeActions(Collections .singletonList(Either.forLeft(new Command( "fixme", "edit", Collections.singletonList(wEdit)) ) )); AbstractTextEditor editor = (AbstractTextEditor)TestUtils.openEditor(f); final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet()); editor.selectAndReveal(3, 0); TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.QUICK_ASSIST); action.update(); action.run(); this.completionShell= findNewShell(beforeShells, editor.getSite().getShell().getDisplay()); final Table completionProposalList = findCompletionSelectionControl(completionShell); checkCompletionContent(completionProposalList); editor.close(false); p.delete(true, new NullProgressMonitor()); }

Target:
public void testCodeActionsQuickAssist() throws CoreException { MockLanguageServer.reset(); IProject p = TestUtils.createProject(getClass().getSimpleName() + System.currentTimeMillis()); IFile f = TestUtils.createUniqueTestFile(p, "error"); TextEdit tEdit = new TextEdit(new Range(new Position(0, 0), new Position(0, 5)), "fixed"); WorkspaceEdit wEdit = new WorkspaceEdit(Collections.singletonMap(f.getLocationURI().toString(), Collections.singletonList(tEdit))); MockLanguageServer.INSTANCE.setCodeActions(Collections .singletonList(Either.forLeft(new Command( "fixme", "edit", Collections.singletonList(wEdit)) ) )); AbstractTextEditor editor = (AbstractTextEditor)TestUtils.openEditor(f); final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet()); editor.selectAndReveal(3, 0); TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.QUICK_ASSIST); action.update(); action.run(); this.completionShell= TestUtils.findNewShell(beforeShells, editor.getSite().getShell().getDisplay()); final Table completionProposalList = TestUtils.findCompletionSelectionControl(completionShell); checkCompletionContent(completionProposalList); editor.close(false); p.delete(true, new NullProgressMonitor()); }
Source:
public void accept(final Socket socket) throws IOException { if (this.latencyExceeded()) { Thread.currentThread().interrupt(); } else { this.origin.accept(socket); } }

Target:
public void accept(final Socket socket) throws IOException { final Thread thread = Thread.currentThread(); this.executor.schedule( new Runnable() { @Override public void run() { thread.interrupt(); } }, this.latency, TimeUnit.MILLISECONDS ); this.origin.accept(socket); }
Source:
public String get(String pluginKey) { if (!cache.containsKey(pluginKey)) { String value = downloadFromGithub(pluginKey); cache.put(pluginKey, value); } return cache.get(pluginKey); }

Target:
public String get(String pluginKey) { if (!cache.containsKey(pluginKey)) { cache.put(pluginKey, downloadFromGithub(pluginKey)); } return cache.get(pluginKey); }
Source:
private Timer createTimer() { return new Timer((int) REFRESH_RATE.toMillis(), (ae) -> EventQueue.invokeLater(() -> { if (! backend.isConnected()) { activeStateValueLabel.setText(OFFLINE); if (backend.getSettings().isDisplayStateColor()) { activeStatePanel.setBackground(Color.BLACK); } } GcodeState state = backend.getGcodeState(); if (state == null) { gStatesLabel.setText("--"); } else { StringBuilder sb = new StringBuilder(); sb.append(state.currentMotionMode).append(" "); sb.append(state.units).append(" "); sb.append(state.feedMode).append(" "); sb.append(state.distanceMode).append(" "); sb.append(state.offset).append(" "); sb.append(state.plane.code).append(" "); trimLastSpace(sb); gStatesLabel.setText(sb.toString()); } })); }

Target:
private Timer createTimer() { return new Timer((int) REFRESH_RATE.toMillis(), (ae) -> EventQueue.invokeLater(() -> { if (! backend.isConnected()) { activeStateValueLabel.setText(OFFLINE); if (backend.getSettings().isDisplayStateColor()) { activeStatePanel.setBackground(Color.BLACK); } } GcodeState state = backend.getGcodeState(); if (state == null) { gStatesLabel.setText("--"); } else { gStatesLabel.setText( String.join(" ", state.currentMotionMode.toString(), state.units.toString(), state.feedMode.toString(), state.distanceMode.toString(), state.offset.toString(), state.plane.code.toString())); } })); }
Source:
protected String getLocaleStringFromReferer(final HttpServletRequest request) { final URI refererURL; String result = null; try { String referer = request.getHeader(REFERER); if (null != referer) { refererURL = new URI(referer); String query = refererURL.getQuery(); if (null != query) { String[] parameters = query.split("&"); for (int i = 0; i < parameters.length; i++) { String[] keyValues = parameters[i].split("="); if (LOCALE.equalsIgnoreCase(keyValues[0])) { result = keyValues[1]; break; } } } } } catch (URISyntaxException e) { log.error("Unable to determine referer URI", e); } return result; }

Target:
protected String getLocaleStringFromReferer(final HttpServletRequest request) { final URI refererURL; String result = null; try { String referer = request.getHeader(REFERER); if (null != referer) { refererURL = new URI(referer); String query = refererURL.getQuery(); if (query != query) { String[] parameters = query.split("&"); for (int i = 0; i < parameters.length; i++) { String[] keyValues = parameters[i].split("="); if (LOCALE.equalsIgnoreCase(keyValues[0])) { result = keyValues[1]; break; } } } } } catch (URISyntaxException e) { log.error("Unable to determine referer URI", e); } return result; }
Source:
public void testSnapshots() throws Exception { TestTransaction tx = new TestTransaction(env); tx.set("bob", BALANCE, "10"); tx.set("joe", BALANCE, "20"); tx.set("jill", BALANCE, "60"); tx.set("jane", BALANCE, "0"); tx.done(); TestTransaction tx1 = new TestTransaction(env); TestTransaction tx2 = new TestTransaction(env); tx2.set("bob", BALANCE, "5"); tx2.set("joe", BALANCE, "15"); tx2.set("jill", BALANCE, "70"); Assert.assertEquals("10", tx1.gets("bob", BALANCE)); tx2.done(); TestTransaction txd = new TestTransaction(env); txd.delete("jane", BALANCE); txd.done(); Assert.assertEquals("20", tx1.gets("joe", BALANCE)); Assert.assertEquals("60", tx1.gets("jill", BALANCE)); Assert.assertEquals("0", tx1.gets("jane", BALANCE)); tx1.set("bob", BALANCE, "5"); tx1.set("joe", BALANCE, "25"); assertCommitFails(tx1); TestTransaction tx3 = new TestTransaction(env); TestTransaction tx4 = new TestTransaction(env); tx4.set("jane", BALANCE, "3"); tx4.done(); Assert.assertEquals("5", tx3.gets("bob", BALANCE)); Assert.assertEquals("15", tx3.gets("joe", BALANCE)); Assert.assertEquals("70", tx3.gets("jill", BALANCE)); Assert.assertNull(tx3.gets("jane", BALANCE)); tx3.done(); TestTransaction tx5 = new TestTransaction(env); Assert.assertEquals("5", tx5.gets("bob", BALANCE)); Assert.assertEquals("15", tx5.gets("joe", BALANCE)); Assert.assertEquals("70", tx5.gets("jill", BALANCE)); Assert.assertEquals("3", tx5.gets("jane", BALANCE)); tx5.done(); }

Target:
public void testSnapshots() throws Exception { TestTransaction tx = new TestTransaction(env); tx.set("bob", BALANCE, "10"); tx.set("joe", BALANCE, "20"); tx.set("jill", BALANCE, "60"); tx.set("jane", BALANCE, "0"); tx.done(); TestTransaction tx1 = new TestTransaction(env); TestTransaction tx2 = new TestTransaction(env); TestUtil.increment(tx2, "bob", BALANCE, -5); TestUtil.increment(tx2, "joe", BALANCE, -5); TestUtil.increment(tx2, "jill", BALANCE, 10); Assert.assertEquals("10", tx1.gets("bob", BALANCE)); tx2.done(); TestTransaction txd = new TestTransaction(env); txd.delete("jane", BALANCE); txd.done(); Assert.assertEquals("20", tx1.gets("joe", BALANCE)); Assert.assertEquals("60", tx1.gets("jill", BALANCE)); Assert.assertEquals("0", tx1.gets("jane", BALANCE)); tx1.set("bob", BALANCE, "5"); tx1.set("joe", BALANCE, "25"); assertCommitFails(tx1); TestTransaction tx3 = new TestTransaction(env); TestTransaction tx4 = new TestTransaction(env); tx4.set("jane", BALANCE, "3"); tx4.done(); Assert.assertEquals("5", tx3.gets("bob", BALANCE)); Assert.assertEquals("15", tx3.gets("joe", BALANCE)); Assert.assertEquals("70", tx3.gets("jill", BALANCE)); Assert.assertNull(tx3.gets("jane", BALANCE)); tx3.done(); TestTransaction tx5 = new TestTransaction(env); Assert.assertEquals("5", tx5.gets("bob", BALANCE)); Assert.assertEquals("15", tx5.gets("joe", BALANCE)); Assert.assertEquals("70", tx5.gets("jill", BALANCE)); Assert.assertEquals("3", tx5.gets("jane", BALANCE)); tx5.done(); }
Source:
protected List<Guid> getFailedVolumeIds(Guid spmVdsId) { return getParameters().getImageList().stream() .filter((volumeId) -> volumeExists(spmVdsId, volumeId)) .collect(toList()); }

Target:
protected List<Guid> getFailedVolumeIds(Guid spmVdsId) { return getParameters().getImageList().stream() .filter(volumeId -> volumeExists(spmVdsId, volumeId)) .collect(toList()); }
Source:
private void flushFailedActions() { if (!failedActions.isEmpty()) { Iterator<Action> iterator = failedActions.values().iterator(); while (iterator.hasNext()) { Action action = iterator.next(); iterator.remove(); performSubmit(action); } failedActions.clear(); } }

Target:
private void flushFailedActions() { if (!failedActions.isEmpty()) { Iterator<Action> iterator = failedActions.values().iterator(); while (iterator.hasNext()) { Action action = iterator.next(); iterator.remove(); performSubmit(action); } } }
Source:
public DynamicRepositoryLocationLoader(ApplicationContext applicationContext, String beanName) { this.delegated = applicationContext.getBean(beanName, RepositoryLocationLoader.class); }

Target:
public DynamicRepositoryLocationLoader(ApplicationContext applicationContext, String beanName) { this(applicationContext.getBean(beanName, RepositoryLocationLoader.class)); }
Source:
void onContext(ValueChangeEvent<String> e) { String v = e.getValue(); int c; if (v != null && v.length() > 0) { c = Math.min(Math.max(0, Integer.parseInt(v)), 32767); contextEntireFile.setValue(false); } else if (v == null || v.isEmpty()) { c = WHOLE_FILE_CONTEXT; contextEntireFile.setValue(true); } else { return; } prefs.context(c); updateContextTimer.schedule(200); }

Target:
void onContext(ValueChangeEvent<String> e) { String v = e.getValue(); int c; if (v != null && v.length() > 0) { c = Math.min(Math.max(0, Integer.parseInt(v)), 32767); contextEntireFile.setValue(false); } else if (v == null || v.isEmpty()) { c = WHOLE_FILE_CONTEXT; } else { return; } prefs.context(c); updateContextTimer.schedule(200); }
Source:
public Elide initializeElide(EntityDictionary dictionary, DataStore dataStore, ElideConfigProperties settings) { ElideSettingsBuilder builder = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withDefaultMaxPageSize(settings.getMaxPageSize()) .withDefaultPageSize(settings.getPageSize()) .withJSONApiLinks(new DefaultJSONApiLinks()) .withUseFilterExpressions(true) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withAuditLogger(new Slf4jLogger()) .withEncodeErrorResponses(true) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")); return new Elide(builder.build()); }

Target:
public Elide initializeElide(EntityDictionary dictionary, DataStore dataStore, ElideConfigProperties settings) { ElideSettingsBuilder builder = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withDefaultMaxPageSize(settings.getMaxPageSize()) .withDefaultPageSize(settings.getPageSize()) .withUseFilterExpressions(true) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withAuditLogger(new Slf4jLogger()) .withEncodeErrorResponses(true) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")); return new Elide(builder.build()); }
Source:
public static CommonStatus mapCommonStatus(String status) { LOGGER.debug("Mapping common status {}", status); switch (status) { case "Accepted": return CommonStatus.REQUESTED; case "Ready": case "Succeeded": return CommonStatus.CREATED; case "Canceled": case "Deleted": case "Failed": return CommonStatus.FAILED; default: return CommonStatus.FAILED; } }

Target:
public static CommonStatus mapCommonStatus(String status) { CommonStatus mappedStatus; switch (status) { case "Accepted": mappedStatus = CommonStatus.REQUESTED; break; case "Ready": case "Succeeded": mappedStatus = CommonStatus.CREATED; break; case "Canceled": case "Deleted": case "Failed": default: mappedStatus = CommonStatus.FAILED; break; } LOGGER.debug("Mapped status to common status {}", status, mappedStatus.toString()); return mappedStatus; }
Source:
public CacheManagerInfo getCacheManager() { String url = "http://"+this.baseURL+"/rest/"+CACHE_MANAGER_RESOURCE; HttpRequest get = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); CacheManagerInfo cacheManagerInfo = null; try { response = httpClient.send(get, HttpResponse.BodyHandlers.ofString()); String json = response.body(); cacheManagerInfo = mapper.readValue(json, CacheManagerInfo.class); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return cacheManagerInfo; }

Target:
public CacheManagerInfo getCacheManager() { String url = String.format("http://%s:%s/rest/%s", serverIp, this.defaultPort, CACHE_MANAGER_RESOURCE); HttpRequest get = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); CacheManagerInfo cacheManagerInfo = null; try { response = httpClient.send(get, HttpResponse.BodyHandlers.ofString()); String json = response.body(); cacheManagerInfo = mapper.readValue(json, CacheManagerInfo.class); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return cacheManagerInfo; }
Source:
public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { Operations ops = new Operations(ctx.client); Address ldapConnection = Address.coreService("management").and("ldap-connection", connectionName); if (replaceExisting) { try { ops.removeIfExists(ldapConnection); new Administration(ctx.client).reloadIfRequired(); } catch (OperationException e) { throw new IOException("Failed to LDAP outbound connection " + connectionName, e); } } List<String> resolvedHandlesReferralsFor = (handlesReferralsFor != null && !handlesReferralsFor.isEmpty()) ? handlesReferralsFor : null; ops.add(ldapConnection, Values.empty() .andOptional("name", connectionName) .andOptional("handles-referrals-for", initialContextFactory) .andOptional("initial-context-factory", initialContextFactory) .andOptional("referrals", referrals) .andOptional("search-credential", searchCredential) .andOptional("search-dn", searchDn) .andOptional("security-realm", securityRealm) .andOptional("url", url) .andListOptional(String.class, "handles-referrals-for", resolvedHandlesReferralsFor)); if (properties != null && !properties.isEmpty()) { for (Map.Entry<String, String> entry : properties.entrySet()) { ops.add(ldapConnection.and("property", entry.getKey()), Values.empty() .and("value", entry.getValue()) ); } } }

Target:
public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address ldapConnection = Address.coreService("management").and("ldap-connection", connectionName); if (replaceExisting) { try { ops.removeIfExists(ldapConnection); new Administration(ctx.client).reloadIfRequired(); } catch (OperationException e) { throw new IOException("Failed to LDAP outbound connection " + connectionName, e); } } List<String> resolvedHandlesReferralsFor = (handlesReferralsFor != null && !handlesReferralsFor.isEmpty()) ? handlesReferralsFor : null; Batch batch = new Batch(); batch.add(ldapConnection, Values.empty() .andOptional("name", connectionName) .andOptional("handles-referrals-for", initialContextFactory) .andOptional("initial-context-factory", initialContextFactory) .andOptional("referrals", referrals) .andOptional("search-credential", searchCredential) .andOptional("search-dn", searchDn) .andOptional("security-realm", securityRealm) .andOptional("url", url) .andListOptional(String.class, "handles-referrals-for", resolvedHandlesReferralsFor)); if (properties != null && !properties.isEmpty()) { for (Map.Entry<String, String> entry : properties.entrySet()) { batch.add(ldapConnection.and("property", entry.getKey()), Values.empty() .and("value", entry.getValue()) ); } } ops.batch(batch); }
Source:
public void openEditModal() { ItemObjectModel itemObjectModel = new ItemObjectModel(); itemObjectModel.setParameters(model.getParameters()); itemObjectModel.setResolver(model.getResolver()); BiConsumer<String,String> removeConsumer = (n,v) -> { super.remove(); }; BiConsumer<String,String> editConsumer = removeConsumer.andThen( (n,v) ->{ itemObjectModel.setName(n); itemObjectModel.setValue(v); this.getListPresenter().add(itemObjectModel); fireChangeEvent(); }); doubleValueModal.show(editConsumer); doubleValueModal.getView().setName(model.getName()); doubleValueModal.getView().setValue(model.getValue()); }

Target:
public void openEditModal() { doubleValueModal.show((n, v) -> { view.setName(n); model.setName(n); view.setValue(v); model.setValue(v); fireChangeEvent(); }, model.getName(), model.getValue()); }
Source:
public void run() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (!getEditorControl().isDisposed() && KeyPressCommitRunnable.this.toCommit != null && KeyPressCommitRunnable.this.toCommit.equals(getEditorValue())) { commit(MoveDirectionEnum.NONE, false); } } }); }

Target:
public void run() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (getEditorControl() != null && !getEditorControl().isDisposed() && KeyPressCommitRunnable.this.toCommit != null && KeyPressCommitRunnable.this.toCommit.equals(getEditorValue())) { commit(MoveDirectionEnum.NONE, false); } } }); }
Source:
public void testCreateComputationScheduler() { ThreadFactory factory = new ThreadFactory() { @Override public Thread newThread(Runnable r) { return new Thread("Test"); } }; Scheduler scheduler = RxJavaPlugins.createComputationScheduler(factory); verifyThread(scheduler.createWorker(), new Predicate<Thread>() { @Override public boolean test(Thread thread) throws Exception { return "Test".equals(thread.getName()); } }); }

Target:
public void testCreateComputationScheduler() { final String name = "ComputationSchedulerTest"; ThreadFactory factory = new ThreadFactory() { @Override public Thread newThread(Runnable r) { return new Thread(r, name); } }; final Scheduler customScheduler = RxJavaPlugins.createComputationScheduler(factory); RxJavaPlugins.setComputationSchedulerHandler(new Function<Scheduler, Scheduler>() { @Override public Scheduler apply(Scheduler scheduler) throws Exception { return customScheduler; } }); try { verifyThread(Schedulers.computation(), name); } finally { customScheduler.shutdown(); RxJavaPlugins.reset(); } }
Source:
public Options() { sendHwm = 1000; recvHwm = 1000; affinity = 0; identitySize = 0; rate = 100; recoveryIvl = 10000; multicastHops = 1; sndbuf = 0; rcvbuf = 0; tos = 0; type = -1; linger = -1; reconnectIvl = 100; reconnectIvlMax = 0; backlog = 100; maxMsgSize = -1; recvTimeout = -1; sendTimeout = -1; ipv6 = false; if ("false".equals(System.getProperty("java.net.preferIPv4Stack", null)) || "true".equals(System.getProperty("java.net.preferIPv6Addresses", null))) { ipv6 = true; } immediate = true; filter = false; recvIdentity = false; rawSocket = false; tcpKeepAlive = -1; tcpKeepAliveCnt = -1; tcpKeepAliveIdle = -1; tcpKeepAliveIntvl = -1; mechanism = Mechanisms.NULL; asServer = false; gssPlaintext = false; socketId = 0; conflate = false; handshakeIvl = 30000; heartbeatTtl = 0; heartbeatInterval = 0; heartbeatTimeout = -1; heartbeatContext = new byte[0]; identity = new byte[0]; identitySize = (byte) identity.length; curvePublicKey = new byte[CURVE_KEYSIZE]; curveSecretKey = new byte[CURVE_KEYSIZE]; curveServerKey = new byte[CURVE_KEYSIZE]; allocator = new MsgAllocatorThreshold(Config.MSG_ALLOCATION_HEAP_THRESHOLD.getValue()); selectorChooser = null; }

Target:
public Options() { sendHwm = 1000; recvHwm = 1000; affinity = 0; identitySize = 0; rate = 100; recoveryIvl = 10000; multicastHops = 1; sndbuf = 0; rcvbuf = 0; tos = 0; type = -1; linger = -1; reconnectIvl = 100; reconnectIvlMax = 0; backlog = 100; maxMsgSize = -1; recvTimeout = -1; sendTimeout = -1; ipv6 = "false".equals(System.getProperty("java.net.preferIPv4Stack", null)) || "true".equals(System.getProperty("java.net.preferIPv6Addresses", null)); immediate = true; filter = false; recvIdentity = false; rawSocket = false; tcpKeepAlive = -1; tcpKeepAliveCnt = -1; tcpKeepAliveIdle = -1; tcpKeepAliveIntvl = -1; mechanism = Mechanisms.NULL; asServer = false; gssPlaintext = false; socketId = 0; conflate = false; handshakeIvl = 30000; heartbeatTtl = 0; heartbeatInterval = 0; heartbeatTimeout = -1; heartbeatContext = new byte[0]; identity = new byte[0]; identitySize = (byte) identity.length; curvePublicKey = new byte[CURVE_KEYSIZE]; curveSecretKey = new byte[CURVE_KEYSIZE]; curveServerKey = new byte[CURVE_KEYSIZE]; allocator = new MsgAllocatorThreshold(Config.MSG_ALLOCATION_HEAP_THRESHOLD.getValue()); selectorChooser = null; }
Source:
private boolean checkForPendingAppHealthActions() { boolean kickedOff = false; if (RecoveryMeasuresHelper.recoveryMeasuresPending()) { finishWithExecutionIntent(); kickedOff = true; } else if (UpdateActivity.isUpdateBlockedOnSync()) { triggerSync(true); kickedOff = true; } else if (CommCareApplication.instance().isSyncPending(false)) { triggerSync(true); kickedOff = true; } else if (UpdatePromptHelper.promptForUpdateIfNeeded(this)) { kickedOff = true; } CommCareApplication.instance().getSession().setAppHealthChecksCompleted(); return kickedOff; }

Target:
private boolean checkForPendingAppHealthActions() { boolean kickedOff = false; if (RecoveryMeasuresHelper.recoveryMeasuresPending()) { finishWithExecutionIntent(); kickedOff = true; } else if (UpdateActivity.isUpdateBlockedOnSync() && UpdateActivity.sBlockedUpdateWorkflowInProgress) { triggerSync(true); kickedOff = true; } else if (CommCareApplication.instance().isSyncPending(false)) { triggerSync(true); kickedOff = true; } else if (UpdatePromptHelper.promptForUpdateIfNeeded(this)) { kickedOff = true; } String userId = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); if (HiddenPreferences.shouldForceLogs(userId)) { CommCareUtil.triggerLogSubmission(CommCareApplication.instance(), true); } CommCareApplication.instance().getSession().setAppHealthChecksCompleted(); return kickedOff; }
Source:
OperatorSpecGraph(StreamGraphSpec graphSpec) { this.inputOperators = graphSpec.getInputOperators(); this.outputStreams = graphSpec.getOutputStreams(); this.tables = graphSpec.getTables(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); hasWindowOrJoins = checkWindowOrJoins(); serializedGraphSpec = graphSpecSerde.toBytes(this); }

Target:
OperatorSpecGraph(StreamGraphSpec graphSpec) { this.inputOperators = graphSpec.getInputOperators(); this.outputStreams = graphSpec.getOutputStreams(); this.tables = graphSpec.getTables(); this.allOpSpecs = Collections.unmodifiableSet(this.findAllOperatorSpecs()); this.hasWindowOrJoins = checkWindowOrJoins(); this.serializedOpSpecGraph = opSpecGraphSerde.toBytes(this); }