auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private CacheTopology getCacheTopology(int requestTopologyId, Address destination, boolean isReqForTransactions) throws InterruptedException { CacheTopology cacheTopology = stateConsumer.getCacheTopology(); int currentTopologyId = cacheTopology != null ? cacheTopology.getTopologyId() : -1; if (requestTopologyId < currentTopologyId) { if (isReqForTransactions) log.debugf("Transactions were requested by node %s with topology %d, older than the local topology (%d)", destination, requestTopologyId, currentTopologyId); else log.debugf("Segments were requested by node %s with topology %d, older than the local topology (%d)", destination, requestTopologyId, currentTopologyId); } else if (requestTopologyId > currentTopologyId) { if (trace) { log.tracef("%s were requested by node %s with topology %d, greater than the local " + "topology (%d). Waiting for topology %d to be installed locally.", isReqForTransactions ? "Transactions" : "Segments", destination, requestTopologyId, currentTopologyId, requestTopologyId); } try { stateTransferLock.waitForTopology(requestTopologyId, timeout, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { throw new CacheException("Failed waiting for topology " + requestTopologyId, e); } cacheTopology = stateConsumer.getCacheTopology(); } return cacheTopology; }

Target:
private CacheTopology getCacheTopology(int requestTopologyId, Address destination, boolean isReqForTransactions) throws InterruptedException { CacheTopology cacheTopology = stateConsumer.getCacheTopology(); int currentTopologyId = cacheTopology != null ? cacheTopology.getTopologyId() : -1; if (requestTopologyId < currentTopologyId) { if (isReqForTransactions) log.debugf("Transactions were requested by node %s with topology %d, older than the local topology (%d)", destination, requestTopologyId, currentTopologyId); else log.debugf("Segments were requested by node %s with topology %d, older than the local topology (%d)", destination, requestTopologyId, currentTopologyId); } else if (requestTopologyId > currentTopologyId) { if (trace) { log.tracef("%s were requested by node %s with topology %d, greater than the local " + "topology (%d). Waiting for topology %d to be installed locally.", isReqForTransactions ? "Transactions" : "Segments", destination, requestTopologyId, currentTopologyId, requestTopologyId); } try { stateTransferLock.waitForTopology(requestTopologyId, timeout, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { throw log.failedWaitingForTopology(requestTopologyId); } cacheTopology = stateConsumer.getCacheTopology(); } return cacheTopology; }
Source:
private void createStreamInputReaders() throws CTFException { for (CTFStream stream : fTrace.getStreams()) { Set<CTFStreamInput> streamInputs = stream.getStreamInputs(); for (CTFStreamInput streamInput : streamInputs) { fStreamInputReaders.add(new CTFStreamInputReader(NonNullUtils.checkNotNull(streamInput))); } } fEventCountPerTraceFile = new long[fStreamInputReaders.size()]; }

Target:
private void createStreamInputReaders() throws CTFException { for (CTFStream stream : fTrace.getStreams()) { Set<CTFStreamInput> streamInputs = stream.getStreamInputs(); for (CTFStreamInput streamInput : streamInputs) { fStreamInputReaders.add(new CTFStreamInputReader(checkNotNull(streamInput))); } } fEventCountPerTraceFile = new long[fStreamInputReaders.size()]; }
Source:
private static boolean isLegacyImplementationPresent() { try { Thread.currentThread().getContextClassLoader().loadClass("org.kie.pmml.pmml_4_2.PMML4ExecutionHelper"); return true; } catch (NoClassDefFoundError | ClassNotFoundException e) { return false; } }

Target:
private static boolean isLegacyImplementationPresent() { try { Class.forName("org.kie.pmml.pmml_4_2.PMML4ExecutionHelper"); return true; } catch (NoClassDefFoundError | ClassNotFoundException e) { return false; } }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } final MacPoolValidator validator = new MacPoolValidator(null, getMacPool()); return validate(validator.defaultPoolFlagIsNotSet()) && validate(validator.hasUniqueName()); }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } final MacPoolValidator validator = new MacPoolValidator(getMacPoolEntity()); return validate(validator.defaultPoolFlagIsNotSet()) && validate(validator.hasUniqueName()); }
Source:
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { if (installableConnectors.isEmpty()) { throw new IllegalArgumentException(); } try { SubMonitor monitor = SubMonitor.convert(progressMonitor, org.jboss.tools.project.examples.Messages.preparingUninstall, 100); try { final IInstallableUnit[] ius = computeInstallableUnits(monitor.newChild(50)); checkCancelled(monitor); final UninstallOperation uninstallOperation = resolveUninstall(monitor.newChild(50), ius, repositoryLocations.toArray(new URI[0])); checkCancelled(monitor); final RemediationOperation[] rops = new RemediationOperation[1]; rops[0] = null; if (uninstallOperation != null && uninstallOperation.getResolutionResult().getSeverity() == IStatus.ERROR) { rops[0] = new RemediationOperation(ProvisioningUI.getDefaultUI() .getSession(), uninstallOperation.getProfileChangeRequest()); rops[0].resolveModal(monitor.newChild(500)); } checkCancelled(monitor); Display.getDefault().asyncExec(new Runnable() { public void run() { provisioningUI.openUninstallWizard(Arrays.asList(ius), uninstallOperation, null); } }); } finally { monitor.done(); } } catch (OperationCanceledException e) { throw new InterruptedException(); } catch (Exception e) { throw new InvocationTargetException(e); } }

Target:
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { if (installableConnectors.isEmpty()) { throw null; } try { SubMonitor monitor = SubMonitor.convert(progressMonitor, org.jboss.tools.project.examples.Messages.preparingUninstall, 100); try { final IInstallableUnit[] ius = computeInstallableUnits(monitor.newChild(50)); checkCancelled(monitor); final UninstallOperation uninstallOperation = resolveUninstall(monitor.newChild(50), ius, repositoryLocations.toArray(new URI[0])); checkCancelled(monitor); final RemediationOperation[] rops = new RemediationOperation[1]; rops[0] = null; if (uninstallOperation != null && uninstallOperation.getResolutionResult().getSeverity() == IStatus.ERROR) { rops[0] = new RemediationOperation(ProvisioningUI.getDefaultUI() .getSession(), uninstallOperation.getProfileChangeRequest()); rops[0].resolveModal(monitor.newChild(500)); } checkCancelled(monitor); Display.getDefault().asyncExec(new Runnable() { public void run() { provisioningUI.openUninstallWizard(Arrays.asList(ius), uninstallOperation, null); } }); } finally { monitor.done(); } } catch (OperationCanceledException e) { throw new InterruptedException(); } catch (Exception e) { throw new InvocationTargetException(e); } }
Source:
public void TestFilterNonAdminOnlyFlowParams() throws IOException, ExecutorManagerException, UserManagerException { final ExecutableFlow flow = createExecutableFlow(); final UserManager manager = TestUtils.createTestXmlUserManager(); final User user = manager.getUser("testUser", "testUser"); Props props = new Props(); HttpRequestUtils.filterAdminOnlyFlowParams(manager, flow.getExecutionOptions(), user, props); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.FLOW_PRIORITY)); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.USE_EXECUTOR)); }

Target:
public void TestFilterNonAdminOnlyFlowParams() throws IOException, ExecutorManagerException, UserManagerException { final ExecutableFlow flow = createExecutableFlow(); final UserManager manager = TestUtils.createTestXmlUserManager(); final User user = manager.getUser("testUser", "testUser"); final Props props = new Props(); HttpRequestUtils.filterAdminOnlyFlowParams(manager, flow.getExecutionOptions(), user, props); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.FLOW_PRIORITY)); Assert.assertFalse(flow.getExecutionOptions().getFlowParameters() .containsKey(ExecutionOptions.USE_EXECUTOR)); }
Source:
public void process(StripeNotification notification) { try { var dataObject = objectMapper.readValue(notification.getObject(), DataObject.class); LOGGER.info(String.format("Received an account.updated event for stripe account %s", dataObject.getId()), kv("payouts_enabled", dataObject.isPayoutsEnabled()), kv("requirements", dataObject.getRequirements())); } catch (Exception e) { LOGGER.error("{} notification parsing for source object failed: {}", STRIPE.getName(), e); } }

Target:
public void process(StripeNotification notification) { try { var dataObject = objectMapper.readValue(notification.getObject(), DataObject.class); LOGGER.info(String.format("Received an account.updated event for stripe account %s", dataObject.getId()), kv("stripe_account_id", dataObject.getId()), kv("payouts_enabled", dataObject.isPayoutsEnabled()), kv("requirements", dataObject.getRequirements())); } catch (Exception e) { LOGGER.error("{} notification parsing for source object failed: {}", STRIPE.getName(), e); } }
Source:
public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); subnet.setExternalNetwork(getExternalNetwork()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); subnet.setGateway(getGateway().getEntity()); List<String> dnsServers = new ArrayList<String>(); for (EntityModel<String> dnsServer : getDnsServers().getItems()) { if (dnsServer.getEntity() != null && !dnsServer.getEntity().isEmpty()) { dnsServers.add(dnsServer.getEntity()); } } subnet.setDnsServers(dnsServers); }

Target:
public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); subnet.setExternalNetwork(getExternalNetwork()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); subnet.setGateway(getGateway().getEntity()); List<String> dnsServers = new ArrayList<String>(); for (EntityModel<String> dnsServer : getDnsServers().getItems()) { if (StringUtils.isNotEmpty(dnsServer.getEntity())) { dnsServers.add(dnsServer.getEntity()); } } subnet.setDnsServers(dnsServers); }
Source:
public InputStream getInputStream() throws IOException { loadResource(); if (inputStreamDataCache == null) { if (inputStream == null) { throw new IOException(String.format("Tried to get input stream for %s but was null", name)); } inputStreamDataCache = new TemporaryFileBackedOutputStream(32 * 1024); IOUtils.copyLarge(inputStream, inputStreamDataCache); IOUtils.closeQuietly(inputStream); } return inputStreamDataCache.asByteSource().openStream(); }

Target:
public synchronized InputStream getInputStream() throws IOException { if (resourceDataCache == null) { loadResource(); if (inputStream == null) { throw new IOException(String.format("Tried to get input stream for %s but was null", name)); } resourceDataCache = new TemporaryFileBackedOutputStream(FILE_BACKED_OUTPUT_STREAM_THRESHOLD); IOUtils.copyLarge(inputStream, resourceDataCache); IOUtils.closeQuietly(inputStream); streamCloser.register(resourceDataCache); } InputStream newInputStream = resourceDataCache.asByteSource().openStream(); streamCloser.register(newInputStream); return newInputStream; }
Source:
private void assertCorrections_f1fb6b13d57e25be69d1159356655528_afterUpdate() { NationalAppealChamberJudgment judgment = judgmentRepository.findOneBySourceCodeAndSourceJudgmentId( SourceCode.NATIONAL_APPEAL_CHAMBER, "f1fb6b13d57e25be69d1159356655528", NationalAppealChamberJudgment.class); judgment = judgmentRepository.findOneAndInitialize(judgment.getId()); Judge correctedJudge = judgment.getJudge("Adam Jamróz"); List<JudgmentCorrection> judgmentCorrections = judgmentCorrectionRepository.findAllByJudgmentId(judgment.getId()); assertEquals(1, judgmentCorrections.size()); assertTrue(judgmentCorrections.contains( createFor(judgment).update(correctedJudge).property(NAME) .oldValue("sędzia Katarzyna Brzeska").newValue("Katarzyna Brzeska").build())); }

Target:
private void assertCorrections_f1fb6b13d57e25be69d1159356655528_afterUpdate() { NationalAppealChamberJudgment judgment = judgmentRepository.findOneBySourceCodeAndSourceJudgmentId( SourceCode.NATIONAL_APPEAL_CHAMBER, "f1fb6b13d57e25be69d1159356655528", NationalAppealChamberJudgment.class); judgment = judgmentRepository.findOneAndInitialize(judgment.getId()); Judge correctedJudge = judgment.getJudge("Katarzyna Brzeska"); List<JudgmentCorrection> judgmentCorrections = judgmentCorrectionRepository.findAllByJudgmentId(judgment.getId()); assertEquals(1, judgmentCorrections.size()); assertTrue(judgmentCorrections.contains( createFor(judgment).update(correctedJudge).property(NAME) .oldValue("sędzia Katarzyna Brzeska").newValue("Katarzyna Brzeska").build())); }
Source:
public void testRemoveChildOfRootNode(final int childIndex) { final Node child = rootNode.jjtGetChild(childIndex); assertEquals(NUM_CHILDREN, rootNode.jjtGetNumChildren()); assertEquals(rootNode, child.jjtGetParent()); assertEquals(NUM_GRAND_CHILDREN, child.jjtGetNumChildren()); final Node[] grandChildren = new Node[child.jjtGetNumChildren()]; for (int i = 0; i < grandChildren.length; i++) { final Node grandChild = child.jjtGetChild(i); grandChildren[i] = grandChild; assertEquals(child, grandChild.jjtGetParent()); } child.remove(); assertEquals(NUM_CHILDREN - 1, rootNode.jjtGetNumChildren()); assertNull(child.jjtGetParent()); assertEquals(0, child.jjtGetNumChildren()); for (final Node grandChild : grandChildren) { assertNull(grandChild.jjtGetParent()); } }

Target:
public void testRemoveChildOfRootNode(final int childIndex) { final Node child = rootNode.jjtGetChild(childIndex); final Node[] grandChildren = new Node[child.jjtGetNumChildren()]; for (int i = 0; i < grandChildren.length; i++) { final Node grandChild = child.jjtGetChild(i); grandChildren[i] = grandChild; } child.remove(); assertEquals(NUM_CHILDREN - 1, rootNode.jjtGetNumChildren()); assertNull(child.jjtGetParent()); assertEquals(NUM_GRAND_CHILDREN, child.jjtGetNumChildren()); for (final Node grandChild : grandChildren) { assertEquals(child, grandChild.jjtGetParent()); } }
Source:
private MaterialRevisions fanInOffTriangleDependency(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig) { LOGGER.debug("[Revision Resolution] Triangle Resolution is active for pipeline " + pipelineName); PipelineConfigDependencyGraph dependencyGraph = goConfigService.upstreamDependencyGraphOf(pipelineName, cruiseConfig); if (hasAnyUnsharedMaterialChanged(dependencyGraph, originalMaterialRevisions) || dependencyGraph.isRevisionsOfSharedMaterialsIgnored(originalMaterialRevisions)) { return pipelineService.getRevisionsBasedOnDependencies(dependencyGraph, originalMaterialRevisions); } return null; }

Target:
private MaterialRevisions fanInOffTriangleDependency(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig) { LOGGER.debug("[Revision Resolution] Triangle Resolution is active for pipeline {}", pipelineName); PipelineConfigDependencyGraph dependencyGraph = goConfigService.upstreamDependencyGraphOf(pipelineName, cruiseConfig); if (hasAnyUnsharedMaterialChanged(dependencyGraph, originalMaterialRevisions) || dependencyGraph.isRevisionsOfSharedMaterialsIgnored(originalMaterialRevisions)) { return pipelineService.getRevisionsBasedOnDependencies(dependencyGraph, originalMaterialRevisions); } return null; }
Source:
public void detectExposureTo3rdPartyUnquotedHREF() throws HttpMalformedHeaderException, URIException { String testURI = "<LINK_1>"; String body = "<html>\n<body>\n<h2>HTML Links</h2>\n" + "<p><a href=<LINK_2>>Testing ZAP</a>" + "</p>\n" + "</body>\n</html>"; HttpMessage msg = createHttpMessageWithRespBody(body); msg.getRequestHeader().setURI(new URI(testURI, false)); rule.scanHttpRequestSend(msg, -1); assertEquals(2, alertsRaised.size()); }

Target:
public void detectExposureTo3rdPartyUnquotedHREF() throws HttpMalformedHeaderException, URIException { String testURI = "<LINK_1>"; String body = "<html>\n<body>\n<h2>HTML Links</h2>\n" + "<p><a href=<LINK_0>>Testing ZAP</a>" + "</p>\n" + "</body>\n</html>"; HttpMessage msg = createHttpMessageWithRespBody(body); msg.getRequestHeader().setURI(new URI(testURI, false)); rule.scanHttpResponseReceive(msg, -1, new Source(body)); assertEquals(2, alertsRaised.size()); }
Source:
public static void main(String[] args) throws RunnerException, IOException { Context context = new Context(); context.setUp(); BenchmarkSpatialJoin benchmark = new BenchmarkSpatialJoin(); benchmark.benchmarkJoin(context); benchmark.benchmarkUserOptimizedJoin(context); Options options = new OptionsBuilder() .verbosity(VerboseMode.NORMAL) .include(".*" + BenchmarkSpatialJoin.class.getSimpleName() + ".*") .build(); new Runner(options).run(); }

Target:
public static void main(String[] args) throws Exception { new BenchmarkSpatialJoin().verify(); Options options = new OptionsBuilder() .verbosity(VerboseMode.NORMAL) .include(".*" + BenchmarkSpatialJoin.class.getSimpleName() + ".*") .build(); new Runner(options).run(); }
Source:
void read() throws IOException { final XMLReader xr; try { xr = XMLReaderFactory.createXMLReader(); } catch (SAXException e) { throw new IOException(JGitText.get().noXMLParserAvailable); } xr.setContentHandler(this); final FileInputStream in = new FileInputStream(filename); try { xr.parse(new InputSource(in)); } catch (SAXException e) { throw new IOException(MessageFormat.format( RepoText.get().errorParsingFromFile, filename), e); } finally { in.close(); } }

Target:
void read() throws IOException { final XMLReader xr; try { xr = XMLReaderFactory.createXMLReader(); } catch (SAXException e) { throw new IOException(JGitText.get().noXMLParserAvailable); } xr.setContentHandler(this); final FileInputStream in = new FileInputStream(filename); try { xr.parse(new InputSource(in)); } catch (SAXException e) { IOException error = new IOException(MessageFormat.format( RepoText.get().errorParsingManifestFile, filename)); error.initCause(e); throw error; } finally { in.close(); } }
Source:
private static boolean getSystemProperty(final String name, boolean defaultValue) { final SecurityManager sm = System.getSecurityManager(); String systemProperty; if(sm == null) { systemProperty = System.getProperty(name); } else { systemProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(name)); } if (systemProperty == null) { return defaultValue; } else { return Boolean.parseBoolean(systemProperty); } }

Target:
private static boolean getSystemProperty(final String name, boolean defaultValue) { String systemProperty; if(System.getSecurityManager() == null) { systemProperty = System.getProperty(name); } else { systemProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(name)); } if (systemProperty == null) { return defaultValue; } else { return Boolean.parseBoolean(systemProperty); } }
Source:
public static Bind parse(String serialized) { try { String[] parts = serialized.split(":"); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 4: { parts = new String[]{parts[0] + ":" + parts[1], parts[2], parts[3]}; } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }

Target:
public static Bind parse(String serialized) { try { String[] parts = serialized.split(":(?!\\\\)"); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }
Source:
private static final long[] splitRangeIntoEqualParts(long start, long end, int n) { long delta = (end - start); if (delta < 0) { throw new IllegalArgumentException("End value must be greater than start value"); } double stepSize = delta / ((double) n - 1); long[] result = new long[n]; double curTime = start; for (int i = 0; i < n; i++) { result[i] = (long) Math.ceil(curTime); curTime += stepSize; } return result; }

Target:
private static final long[] splitRangeIntoEqualParts(long start, long end, int n) { if (n < 1) { throw new IllegalArgumentException("Number of entries must be greater than 1"); } long delta = (end - start); if (delta < 0) { throw new IllegalArgumentException("End value must be greater than start value"); } double stepSize = delta / ((double) n - 1); long[] result = new long[n]; double curTime = start; for (int i = 0; i < n; i++) { result[i] = (long) Math.ceil(curTime); curTime += stepSize; } return result; }
Source:
private void calculateDropoutMetrics(final Collection<GcBiasDetailMetrics> details, final GcBiasSummaryMetrics summary) { double totalReads = 0; double totalWindows = 0; for (final GcBiasDetailMetrics detail : details) { totalReads += detail.READ_STARTS; totalWindows += detail.WINDOWS; } double atDropout = 0; double gcDropout = 0; for (final GcBiasDetailMetrics detail : details) { final double relativeReads = detail.READ_STARTS / totalReads; final double relativeWindows = detail.WINDOWS / totalWindows; final double dropout = (relativeWindows - relativeReads) * 100; if (dropout > 0) { if (detail.GC <= 50) atDropout += dropout; if (detail.GC >= 50) gcDropout += dropout; } } summary.AT_DROPOUT = atDropout; summary.GC_DROPOUT = gcDropout; }

Target:
private void calculateDropoutMetrics(final Collection<GcBiasDetailMetrics> details, final GcBiasSummaryMetrics summary) { double totalReads = 0; double totalWindows = 0; for (final GcBiasDetailMetrics detail : details) { totalReads += detail.READ_STARTS; totalWindows += detail.WINDOWS; } double atDropout = 0; double gcDropout = 0; for (final GcBiasDetailMetrics detail : details) { final double relativeReads = detail.READ_STARTS / totalReads; final double relativeWindows = detail.WINDOWS / totalWindows; final double dropout = (relativeWindows - relativeReads) * 100; if (dropout > 0) { if (detail.GC <= 50) atDropout += dropout; else{ gcDropout += dropout; } } } summary.AT_DROPOUT = atDropout; summary.GC_DROPOUT = gcDropout; }
Source:
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) { return isInitialized == 1; } if (!hasYear()) { memoizedIsInitialized = 0; return false; } if (!hasMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfWeek()) { memoizedIsInitialized = 0; return false; } if (!hasHour()) { memoizedIsInitialized = 0; return false; } if (!hasMinute()) { memoizedIsInitialized = 0; return false; } if (!hasSecond()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }

Target:
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasYear()) { memoizedIsInitialized = 0; return false; } if (!hasMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfMonth()) { memoizedIsInitialized = 0; return false; } if (!hasDayOfWeek()) { memoizedIsInitialized = 0; return false; } if (!hasHour()) { memoizedIsInitialized = 0; return false; } if (!hasMinute()) { memoizedIsInitialized = 0; return false; } if (!hasSecond()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
Source:
public static Slice stSphericalAsText(@SqlType(SPHERICAL_GEOGRAPHY_TYPE_NAME) Slice input) { if (input == null) { return utf8Slice("POINT EMPTY"); } return utf8Slice(wktFromJtsGeometry(deserialize(input))); }

Target:
public static Slice stSphericalAsText(@SqlType(SPHERICAL_GEOGRAPHY_TYPE_NAME) Slice input) { return utf8Slice(wktFromJtsGeometry(deserialize(input))); }
Source:
public ItemRest patchTemplateItem(Item item, JsonNode jsonNode) throws SQLException, AuthorizeException { ObjectMapper mapper = new ObjectMapper(); JsonPatchConverter patchConverter = new JsonPatchConverter(mapper); Patch patch = patchConverter.convert(jsonNode); ItemRest patchedItemRest = itemPatch.patch(itemConverter.fromModel(item), patch.getOperations()); updateDSpaceObject(item, patchedItemRest); return itemConverter.fromModel(item); }

Target:
public ItemRest patchTemplateItem(Item item, JsonNode jsonNode) throws SQLException, AuthorizeException { ObjectMapper mapper = new ObjectMapper(); JsonPatchConverter patchConverter = new JsonPatchConverter(mapper); Patch patch = patchConverter.convert(jsonNode); ItemRest patchedItemRest = dsoPatch.patch(converter.toRest(item, Projection.DEFAULT), patch.getOperations()); updateDSpaceObject(item, patchedItemRest); return converter.toRest(item, Projection.DEFAULT); }
Source:
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); String resourcePathForQueue = null; String resourcePathForTopic = null; if (subscriptionId.contains(":")) { resourcePathForQueue = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + subscriptionId.split(":")[1]; resourcePathForTopic = CommonsUtil.getSubscriptionID(topicName, subscriptionId.split(":")[1]); userRegistry.delete(resourcePathForTopic); userRegistry.delete(resourcePathForQueue); } } catch (RegistryException e) { String message = e.getMessage(); throw new QueueManagerException("Failed to delete topic: " + topicName + " from " + "registry " + message, e); } }

Target:
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); if (subscriptionId.contains(":")) { String resourcePathForQueue = null; String resourcePathForTopic = null; resourcePathForQueue = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + subscriptionId.split(":")[1]; resourcePathForTopic = CommonsUtil.getSubscriptionID(topicName, subscriptionId.split(":")[1]); userRegistry.delete(resourcePathForTopic); userRegistry.delete(resourcePathForQueue); } } catch (RegistryException e) { String message = e.getMessage(); throw new QueueManagerException("Failed to delete topic: " + topicName + " from " + "registry " + message, e); } }
Source:
public QuickAccessElement[] getElements() { if (!allCommandsRetrieved) { ICommandService commandService = getCommandService(); Collection<String> commandIds = commandService.getDefinedCommandIds(); for (String commandId : commandIds) { retrieveCommand(commandId); } allCommandsRetrieved = true; } return idToCommand.values().toArray( new QuickAccessElement[idToCommand.values().size()]); }

Target:
public QuickAccessElement[] getElements() { if (!allCommandsRetrieved) { ICommandService commandService = getCommandService(); Collection<String> commandIds = commandService.getDefinedCommandIds(); for (String commandId : commandIds) { retrieveCommand(commandId); } allCommandsRetrieved = true; } return idToCommand.values().stream().toArray(QuickAccessElement[]::new); }
Source:
public void detachView() { super.detachView(); mSubscriptions.unsubscribe(); }

Target:
public void detachView() { super.detachView(); mSubscriptions.clear(); }
Source:
public void processLockRelease() { log.debug("Lock released"); isLeader.set(false); stopLogReplication(); interClusterReplicationService.getLogReplicationServer().setLeadership(false); recordLockRelease(lockAcquireSample); }

Target:
public void processLockRelease() { log.debug("Lock released"); isLeader.set(false); stopLogReplication(); interClusterReplicationService.getLogReplicationServer().setLeadership(false); recordLockRelease(); }
Source:
String value() default ""; EmptyHandling onEmpty() default EmptyHandling.THROW; enum EmptyHandling { VOID, NULL, THROW, EMPTY_LIST }

Target:
String value() default ""; EmptyHandling onEmpty() default EmptyHandling.THROW; enum EmptyHandling { VOID((stmt, name) -> stmt.define(name, "")), @Deprecated NULL((stmt, name) -> stmt.define(name, "null")), NULL_STRING((stmt, name) -> stmt.define(name, "null")), NULL_VALUE((stmt, name) -> stmt.define(name, null)), THROW((stmt, name) -> { throw new IllegalArgumentException("argument is null or empty; this was explicitly forbidden on this instance of BindList"); }); private final BiConsumer<SqlStatement, String> rendering; EmptyHandling(BiConsumer<SqlStatement, String> rendering) { this.rendering = rendering; } public void define(SqlStatement stmt, String name) { rendering.accept(stmt, name); } }
Source:
public void testOverriddenExtendedNestedClass() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(FinalClassCheck.class); final String[] expected = {}; verify(checkConfig, getPath("InputFinalClassExtendedOverriddenNested.java"), expected); }

Target:
public void testOverriddenExtendedNestedClass() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(FinalClassCheck.class); verify(checkConfig, getPath("InputFinalClassExtendedOverriddenNested.java"), EMPTY_STRING_ARRAY); }
Source:
public OpenIDServerAssociationStore(String associationsType) { try { SecureRandom secureRandom = SecureRandom.getInstance(SHA_1_PRNG); storeId = secureRandom.nextInt(9999); } catch (NoSuchAlgorithmException e) { if (log.isDebugEnabled()) { log.debug(e.getMessage(), e); } } timestamp = Long.toString(new Date().getTime()); counter = 0; cache = OpenIDAssociationCache.getCacheInstance(); dao = new OpenIDAssociationDAO(associationsType); }

Target:
public OpenIDServerAssociationStore(String associationsType) { try { SecureRandom secureRandom = SecureRandom.getInstance(SHA_1_PRNG); storeId = secureRandom.nextInt(9999); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("SHA1PRNG algorithm could not be found."); } timestamp = Long.toString(new Date().getTime()); counter = 0; cache = OpenIDAssociationCache.getCacheInstance(); dao = OpenIDAssociationDAO.getInstance(associationsType); }
Source:
private <R> CompletionStage<PublisherResult<R>> handleSpecificEntries(boolean parallelPublisher, Set<K> keysToInclude, Set<K> keysToExclude, DeliveryGuarantee deliveryGuarantee, Function<? super Publisher<CacheEntry<K, V>>, ? extends CompletionStage<R>> collator, Function<? super Publisher<R>, ? extends CompletionStage<R>> finalizer) { AdvancedCache<K, V> cache = deliveryGuarantee == DeliveryGuarantee.AT_MOST_ONCE ? this.cache : remoteCache; return handleSpecificObjects(parallelPublisher, keysToInclude, keysToExclude, keyFlowable -> keyFlowable.concatMapMaybe(k -> { CompletableFuture<CacheEntry<K, V>> future = cache.getCacheEntryAsync(k); future.thenApply(entry -> { if (entry instanceof MVCCEntry) { entry = new ImmortalCacheEntry(entry.getKey(), entry.getValue()); } return entry; }); return RxJavaInterop.completionStageToMaybe(future); }).filter(e -> e != NullCacheEntry.getInstance()) , collator, finalizer); }

Target:
private <R> CompletionStage<PublisherResult<R>> handleSpecificEntries(boolean parallelPublisher, Set<K> keysToInclude, Set<K> keysToExclude, DeliveryGuarantee deliveryGuarantee, Function<? super Publisher<CacheEntry<K, V>>, ? extends CompletionStage<R>> collator, Function<? super Publisher<R>, ? extends CompletionStage<R>> finalizer) { AdvancedCache<K, V> cache = deliveryGuarantee == DeliveryGuarantee.AT_MOST_ONCE ? this.cache : remoteCache; return handleSpecificObjects(parallelPublisher, keysToInclude, keysToExclude, keyFlowable -> keyFlowable.concatMapMaybe(k -> { CompletableFuture<CacheEntry<K, V>> future = cache.getCacheEntryAsync(k); future = future.thenApply(entry -> { if (entry instanceof MVCCEntry) { entry = new ImmortalCacheEntry(entry.getKey(), entry.getValue()); } return entry; }); return RxJavaInterop.completionStageToMaybe(future); }).filter(e -> e != NullCacheEntry.getInstance()) , collator, finalizer); }
Source:
public void onPlayerInteract(PlayerInteractEvent event) { if (platform == null) { return; } if (!platform.isHookingEvents()) return; if ((event instanceof PlayerInteractEvent.LeftClickBlock && ((PlayerInteractEvent.LeftClickBlock) event) .getUseItem() == Result.DENY) || (event instanceof PlayerInteractEvent.RightClickBlock && ((PlayerInteractEvent.RightClickBlock) event) .getUseItem() == Result.DENY) || event.getEntity().worldObj.isRemote) return; WorldEdit we = WorldEdit.getInstance(); ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer()); ForgeWorld world = getWorld(event.getEntityPlayer().worldObj); if (event instanceof PlayerInteractEvent.LeftClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCanceled(true); } if (we.handleArmSwing(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCanceled(true); } if (we.handleRightClick(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickEmpty) { if (we.handleRightClick(player)) { event.setCanceled(true); } } }

Target:
public void onPlayerInteract(PlayerInteractEvent event) { if (platform == null) { return; } if (!platform.isHookingEvents()) return; boolean isLeftDeny = event instanceof PlayerInteractEvent.LeftClickBlock && ((PlayerInteractEvent.LeftClickBlock) event) .getUseItem() == Result.DENY; boolean isRightDeny = event instanceof PlayerInteractEvent.RightClickBlock && ((PlayerInteractEvent.RightClickBlock) event) .getUseItem() == Result.DENY; if (isLeftDeny || isRightDeny || event.getEntity().worldObj.isRemote) { return; } WorldEdit we = WorldEdit.getInstance(); ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer()); ForgeWorld world = getWorld(event.getEntityPlayer().worldObj); if (event instanceof PlayerInteractEvent.LeftClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCanceled(true); } if (we.handleArmSwing(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCanceled(true); } if (we.handleRightClick(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickEmpty) { if (we.handleRightClick(player)) { event.setCanceled(true); } } }
Source:
public void dispose() { if (fLaunch != null && fLaunch.canTerminate() && !isTerminating) { isTerminating = true; try { fLaunch.terminate(); } catch (DebugException e) { GdbTraceCorePlugin.logError(GDB_EXCEPTION, e); } fLaunch = null; } }

Target:
public void dispose() { if (fLaunch != null && fLaunch.canTerminate() && !isTerminating) { isTerminating = true; try { fLaunch.terminate(); } catch (DebugException e) { GdbTraceCorePlugin.logError(e.getMessage(), e); } fLaunch = null; } }
Source:
static Map<String, Set<String>> findIslands(final Map<String, List<Polygon>> polygons) { final Set<String> seaTerritories = filterSeaTerritories(polygons.keySet()); final Set<String> landTerritories = filterNotSeaTerritories(polygons.keySet()); return seaTerritories.stream() .collect( Collectors.toMap(sea -> sea, findIslandsForSeaTerritory(landTerritories, polygons))); }

Target:
static Map<String, Set<String>> findIslands(final Map<String, List<Polygon>> polygons) { final Set<String> seaTerritories = filterSeaTerritories(polygons.keySet()); final Set<String> landTerritories = filterNotSeaTerritories(polygons.keySet()); return seaTerritories.stream() .collect( Collectors.toMap( Function.identity(), findIslandsForSeaTerritory(landTerritories, polygons))); }
Source:
public SortedSet<String> getRequestedProjects() { if (requestedProjects == null) { requestedProjects = getRequestedProjects("project", "group", OPEN_GROK_PROJECT); } return requestedProjects; }

Target:
public SortedSet<String> getRequestedProjects() { if (requestedProjects == null) { requestedProjects = getRequestedProjects(PROJECT_PARAM_NAME, GROUP_PARAM_NAME, OPEN_GROK_PROJECT); } return requestedProjects; }
Source:
public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) { super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK_AND_BLOCK, manaCosts); staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ") + "creature can't attack unless its controller pays " + (manaCosts == null ? "" : manaCosts.getText()); }

Target:
public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) { super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK, manaCosts); staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ") + "creature can't attack unless its controller pays " + (manaCosts == null ? "" : manaCosts.getText()); }
Source:
private boolean cleanPrivateStorage() { cleanPrivateFiles("Images"); cleanPrivateFiles("Videos"); cleanPrivateFiles("Files"); cleanPrivateFiles("Recordings"); return true; }

Target:
private boolean cleanPrivateStorage() { for(String type : Arrays.asList("Images", "Videos", "Files", "Recordings")) { cleanPrivateFiles(type); } return true; }
Source:
protected void map(NullWritable key, ViewInfoTracker value, Context context) { final Configuration config = context.getConfiguration(); if (this.multiViewJobStatusTracker == null) { initMultiViewJobStatusTracker(config); } LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d", value.getViewName(), value.getTenantId(), value.getViewTtl())); try (PhoenixConnection connection =(PhoenixConnection) ConnectionUtil.getInputConnection(config) ){ if (value.getTenantId() != null && !value.getTenantId().equals("NULL")) { try (PhoenixConnection tenantConnection = (PhoenixConnection)PhoenixViewTtlUtil. buildTenantConnection(connection.getURL(), value.getTenantId())) { deletingExpiredRows(tenantConnection, value, config); } } else { deletingExpiredRows(connection, value, config); } } catch (SQLException e) { LOGGER.error("Mapper got an exception while deleting expired rows : " + e.getErrorCode() + e.getSQLState(), e.getStackTrace()); } }

Target:
protected void map(NullWritable key, ViewInfoTracker value, Context context) throws IOException { try { final Configuration config = context.getConfiguration(); if (this.multiViewJobStatusTracker == null) { initMultiViewJobStatusTracker(config); } LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d", value.getViewName(), value.getTenantId(), value.getViewTtl())); try (PhoenixConnection connection = (PhoenixConnection) ConnectionUtil.getInputConnection(config)) { if (value.getTenantId() != null && !value.getTenantId().equals("NULL")) { try (PhoenixConnection tenantConnection = (PhoenixConnection) PhoenixMultiInputUtil. buildTenantConnection(connection.getURL(), value.getTenantId())) { deletingExpiredRows(tenantConnection, value, config); } } else { deletingExpiredRows(connection, value, config); } } } catch (SQLException e) { LOGGER.error("Mapper got an exception while deleting expired rows : " + e.getMessage() ); throw new IOException(e.getMessage(), e.getCause()); } catch (Exception e) { LOGGER.error("Getting IOException while running View TTL Deletion Job mapper with error : " + e.getMessage()); throw new IOException(e.getMessage(), e.getCause()); } }
Source:
public ArrayDefinition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); if(isString()){ byte[] data = new byte[fLength]; input.get(data); return new FixedStringDefintion(this, definitionScope, fieldName, new String(data)); } List<Definition> definitions = read(input, definitionScope, fieldName); return new CompoundDefinition(this, definitionScope, fieldName, definitions); }

Target:
public ArrayDefinition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, BitBuffer input) throws CTFReaderException { alignRead(input); if(isString()){ byte[] data = new byte[fLength]; input.get(data); return new FixedStringDefinition(this, definitionScope, fieldName, new String(data)); } List<Definition> definitions = read(input, definitionScope, fieldName); return new CompoundDefinition(this, definitionScope, fieldName, definitions); }
Source:
public void onDeleteListConfirmed(int position) { dataSource.deleteList(nameListsAdapter.getItem(position)); preferencesManager.removeNameList(nameListsAdapter.getItem(position)); nameListsAdapter.deleteItem(position); nameListsAdapter.notifyItemRemoved(position); setNoContent(); }

Target:
public void onDeleteListConfirmed(int position) { dataSource.deleteList(nameListsAdapter.getItem(position)); preferencesManager.removeNameList(nameListsAdapter.getItem(position)); nameListsAdapter.deleteItem(position); }
Source:
public void close() throws IOException, TimeoutException { try { delegate.close(); } finally { recoveryCleanup(); } }

Target:
public void close() throws IOException, TimeoutException { try { delegate.close(); } finally { for (String consumerTag : consumerTags) { this.connection.deleteRecordedConsumer(consumerTag); } this.connection.unregisterChannel(this); } }
Source:
public void onCompletion(RecordMetadata md, Exception e) { if ( e != null ) { e.printStackTrace(); } else { try { if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> " + md.topic() + ":" + md.offset()); LOGGER.debug(" partition:" + md.partition()); LOGGER.debug(" " + event.toJSON()); LOGGER.debug(" " + event.getNextBinlogPosition()); LOGGER.debug(""); } config.setInitialPosition(event.getNextBinlogPosition()); } catch (IOException | SQLException e1) { e1.printStackTrace(); } } }

Target:
public void onCompletion(RecordMetadata md, Exception e) { if ( e != null ) { e.printStackTrace(); } else { try { if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> topic:" + md.topic() + ", partition:" +md.partition() + ", offset:" + md.offset()); LOGGER.debug(" " + event.toJSON()); LOGGER.debug(" " + event.getNextBinlogPosition()); LOGGER.debug(""); } config.setInitialPosition(event.getNextBinlogPosition()); } catch (IOException | SQLException e1) { e1.printStackTrace(); } } }
Source:
public Persister<Message>[] getPersister() { return new Persister[]{OpenWireMessagePersister.getInstance()}; }

Target:
public Persister<Message>[] getPersister() { return OPENWIRE_MESSAGE_PERSISTER; }
Source:
public void withdrawConsentRemovesDataGroups() throws Exception { account.setConsentSignatureHistory(SUBPOP_GUID, ImmutableList.of(CONSENT_SIGNATURE)); when(subpopulation.getDataGroupsAssignedWhileConsented()).thenReturn(TestConstants.USER_DATA_GROUPS); when(subpopService.getSubpopulation(study.getStudyIdentifier(), SUBPOP_GUID)).thenReturn(subpopulation); when(accountDao.getAccount(any())).thenReturn(account); consentService.withdrawConsent(study, SUBPOP_GUID, PARTICIPANT, CONTEXT, WITHDRAWAL, WITHDREW_ON); assertTrue(account.getDataGroups().isEmpty()); verify(subpopulation).getDataGroupsAssignedWhileConsented(); verify(subpopulation, never()).getSubstudyIdsAssignedOnConsent(); }

Target:
public void withdrawConsentRemovesDataGroups() throws Exception { Set<String> dataGroups = Sets.newHashSet(TestConstants.USER_DATA_GROUPS); dataGroups.add("leaveBehind1"); dataGroups.add("leaveBehind2"); account.setConsentSignatureHistory(SUBPOP_GUID, ImmutableList.of(CONSENT_SIGNATURE)); account.setDataGroups(dataGroups); when(subpopulation.getDataGroupsAssignedWhileConsented()).thenReturn(TestConstants.USER_DATA_GROUPS); when(subpopService.getSubpopulation(study.getStudyIdentifier(), SUBPOP_GUID)).thenReturn(subpopulation); when(accountDao.getAccount(any())).thenReturn(account); consentService.withdrawConsent(study, SUBPOP_GUID, PARTICIPANT, CONTEXT, WITHDRAWAL, WITHDREW_ON); assertEquals(ImmutableSet.of("leaveBehind1", "leaveBehind2"), account.getDataGroups()); verify(subpopulation).getDataGroupsAssignedWhileConsented(); verify(subpopulation, never()).getSubstudyIdsAssignedOnConsent(); }
Source:
public void testAddFieldThrowsWhenInitialized() throws Exception { assertThrows(IllegalStateException.class, () -> { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); mapEntryStructField.addField(new StringField("val", 2)); }); }

Target:
public void testAddFieldThrowsWhenInitialized() throws Exception { StructField mapEntryStructField = new StructField("entry", 5); mapEntryStructField.addField(new StringField("key", 1)); mapEntryStructField.init(); assertThrows(IllegalStateException.class, () -> { mapEntryStructField.addField(new StringField("val", 2)); }); }
Source:
public void close() { if(closed.getAndSet(true)){ return; } NettyClientBase client = null; try { client = manager.getConnection(getTajoMasterAddr(), TajoMasterClientProtocol.class, false); TajoMasterClientProtocolService.BlockingInterface tajoMaster = client.getStub(); tajoMaster.removeSession(null, sessionId); } catch (Throwable e) { } finally { manager.cleanup(client); } }

Target:
public void close() { if(closed.getAndSet(true)){ return; } NettyClientBase client = null; try { client = manager.getClient(getTajoMasterAddr(), TajoMasterClientProtocol.class, false); TajoMasterClientProtocolService.BlockingInterface tajoMaster = client.getStub(); tajoMaster.removeSession(null, sessionId); } catch (Throwable e) { } finally { RpcClientManager.cleanup(client); } }