auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean attachVolume(String volumeId) { String mountPoint = this.targetProperties.get(Ec2Constants.VOLUME_MOUNTPOINT); if(Utils.isEmptyOrWhitespaces(mountPoint)) mountPoint = "/dev/sdf"; AttachVolumeRequest attachRequest = new AttachVolumeRequest() .withInstanceId(this.machineId) .withDevice(mountPoint) .withVolumeId(volumeId); try { this.ec2Api.attachVolume(attachRequest); } catch(Exception e) { logger.info("EBS Volume attachment error: " + e); } if(Boolean.parseBoolean(this.targetProperties.get(Ec2Constants.VOLUME_VOLATILE))) { EbsInstanceBlockDeviceSpecification ebsSpecification = new EbsInstanceBlockDeviceSpecification() .withVolumeId(volumeId) .withDeleteOnTermination(true); InstanceBlockDeviceMappingSpecification mappingSpecification = new InstanceBlockDeviceMappingSpecification() .withDeviceName(mountPoint) .withEbs(ebsSpecification); ModifyInstanceAttributeRequest request = new ModifyInstanceAttributeRequest() .withInstanceId(this.machineId) .withBlockDeviceMappings(mappingSpecification); this.ec2Api.modifyInstanceAttribute(request); } return true; }

Target:
private boolean attachVolume(String volumeId) { String name = this.targetProperties.get(Ec2Constants.VOLUME_SNAPSHOT_ID); if(Utils.isEmptyOrWhitespaces(name)) name = "Created by Roboconf for " + this.tagName; tagResource(volumeId, name); String mountPoint = this.targetProperties.get(Ec2Constants.VOLUME_MOUNTPOINT); if(Utils.isEmptyOrWhitespaces(mountPoint)) mountPoint = "/dev/sdf"; AttachVolumeRequest attachRequest = new AttachVolumeRequest() .withInstanceId(this.machineId) .withDevice(mountPoint) .withVolumeId(volumeId); try { this.ec2Api.attachVolume(attachRequest); } catch(Exception e) { logger.warning("EBS Volume attachment error: " + e); } if(Boolean.parseBoolean(this.targetProperties.get(Ec2Constants.VOLUME_VOLATILE))) { EbsInstanceBlockDeviceSpecification ebsSpecification = new EbsInstanceBlockDeviceSpecification() .withVolumeId(volumeId) .withDeleteOnTermination(true); InstanceBlockDeviceMappingSpecification mappingSpecification = new InstanceBlockDeviceMappingSpecification() .withDeviceName(mountPoint) .withEbs(ebsSpecification); ModifyInstanceAttributeRequest request = new ModifyInstanceAttributeRequest() .withInstanceId(this.machineId) .withBlockDeviceMappings(mappingSpecification); this.ec2Api.modifyInstanceAttribute(request); } return true; }
Source:
protected final void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { String tokenString = req.getParameter("_token").replace(' ', '+'); ParsedToken token; try { token = verifier.decode(tokenString); } catch (InvalidTokenException err) { handleError(err, req, res); return; } CurrentUser user = currentUser.get(); if (user instanceof IdentifiedUser) { Account.Id userId = ((IdentifiedUser) user).getAccountId(); if (!token.getUser().equals(userId) || !token.getUrl().equals(getReqUrl(req))) { handleError(new InvalidTokenException(), req, res); return; } doRequest(req, res); } else { res.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }

Target:
protected final void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { if (!acceptsJson(req)) { handleError(new InvalidTokenException(), req, res); return; } JsonParser parser = new JsonParser(); JsonObject json = (JsonObject) parser.parse(req.getReader()); String tokenString = json.get("token").getAsString(); ParsedToken token; try { token = verifier.decode(tokenString); } catch (InvalidTokenException err) { handleError(err, req, res); return; } CurrentUser user = currentUser.get(); if (user instanceof IdentifiedUser) { Account.Id userId = ((IdentifiedUser) user).getAccountId(); if (!token.getAccountId().equals(userId) || !token.getUrl().equals(getReqUrl(req))) { handleError(new InvalidTokenException(), req, res); return; } doRequest(req, res); } else { res.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }
Source:
@Override public Properties build(Cluster cluster, Path buildPath) throws FalconException { WORKFLOWAPP workflow = new WORKFLOWAPP(); String wfName = EntityUtil.getWorkflowName(Tag.RETENTION, entity).toString(); ACTION eviction = unmarshalAction(EVICTION_ACTION_TEMPLATE); if (!isPostProcessingEnabled()){ addTransition(eviction, OK_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(eviction); }else{ addTransition(eviction, SUCCESS_POSTPROCESS_ACTION_NAME, FAIL_POSTPROCESS_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(eviction); ACTION success = getSuccessPostProcessAction(); addTransition(success, OK_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(success); ACTION fail = getFailPostProcessAction(); addTransition(fail, FAIL_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(fail); } decorateWorkflow(workflow, wfName, EVICTION_ACTION_NAME); addLibExtensionsToWorkflow(cluster, workflow, Tag.RETENTION); Properties props = getProperties(buildPath, wfName); props.putAll(getWorkflowProperties(cluster)); props.putAll(createDefaultConfiguration(cluster)); props.putAll(FeedHelper.getUserWorkflowProperties(getLifecycle())); if (EntityUtil.isTableStorageType(cluster, entity)) { setupHiveCredentials(cluster, buildPath, workflow); props.putAll(HiveUtil.getHiveCredentials(cluster)); } marshal(cluster, workflow, buildPath); marshal(cluster, workflow, getConfig(props), buildPath); return props; }

Target:
@Override public Properties build(Cluster cluster, Path buildPath) throws FalconException { WORKFLOWAPP workflow = new WORKFLOWAPP(); String wfName = EntityUtil.getWorkflowName(Tag.RETENTION, entity).toString(); ACTION eviction = unmarshalAction(EVICTION_ACTION_TEMPLATE); addPostProcessing(workflow, eviction); decorateWorkflow(workflow, wfName, EVICTION_ACTION_NAME); addLibExtensionsToWorkflow(cluster, workflow, Tag.RETENTION); Properties props = getProperties(buildPath, wfName); props.putAll(getWorkflowProperties(cluster)); props.putAll(createDefaultConfiguration(cluster)); props.putAll(FeedHelper.getUserWorkflowProperties(getLifecycle())); if (EntityUtil.isTableStorageType(cluster, entity)) { setupHiveCredentials(cluster, buildPath, workflow); props.putAll(HiveUtil.getHiveCredentials(cluster)); } marshal(cluster, workflow, buildPath); marshal(cluster, workflow, getConfig(props), buildPath); return props; }
Source:
private TimeoutException newTimeoutException(Object key, CacheTransaction tx, TxInvocationContext txContext) { String txLog = "(no transaction)"; if( tx != null ) txLog = tx.toString(); return new TimeoutException("Could not acquire lock on " + key + " on behalf of transaction " + txContext.getGlobalTransaction() + ". Waiting to complete tx: " + txLog + ". Lock is being held by " + lockManager.getOwner(key)); }

Target:
private TimeoutException newTimeoutException(Object key, CacheTransaction tx, TxInvocationContext txContext) { return new TimeoutException("Could not acquire lock on " + key + " on behalf of transaction " + txContext.getGlobalTransaction() + ". Waiting to complete tx: " + tx + "."); }
Source:
public Map<PageTitle, T> processResult(ApiResult result) throws Throwable { Map<PageTitle, T> map = new HashMap<>(); JSONObject data = result.asObject(); JSONObject query = data.optJSONObject("query"); if (query == null) { return map; } JSONObject pages = query.getJSONObject("pages"); Iterator<String> keys = pages.keys(); while (keys.hasNext()) { String key = keys.next(); int pageId = Integer.parseInt(key); JSONObject pageData = pages.getJSONObject(key); String titleString = pageData.getString("title"); PageTitle pageTitle = new PageTitle(null, titleString, site); T pageResult = processPage(pageId, pageTitle, pageData); map.put(pageTitle, pageResult); } return map; }

Target:
public Map<PageTitle, T> processResult(ApiResult result) throws Throwable { Map<PageTitle, T> map = new HashMap<>(); JSONObject data = result.asObject(); JSONObject query = data.getJSONObject("query"); JSONObject pages = query.getJSONObject("pages"); Iterator<String> keys = pages.keys(); while (keys.hasNext()) { String key = keys.next(); int pageId = Integer.parseInt(key); JSONObject pageData = pages.getJSONObject(key); String titleString = pageData.getString("title"); PageTitle pageTitle = new PageTitle(null, titleString, site); T pageResult = processPage(pageId, pageTitle, pageData); map.put(pageTitle, pageResult); } return map; }
Source:
public void getPermissions_noLongerValidWhenPermissionManagerIsClosed() { final PermissionManager pm = user.getPermissionManager(); looperThread.closeAfterTest(pm); pm.getPermissions(new PermissionManager.Callback<RealmResults<Permission>>() { @Override public void onSuccess(RealmResults<Permission> permissions) { RealmLog.error("OnSuccess"); try { assertTrue(permissions.isValid()); pm.close(); assertFalse(permissions.isValid()); } finally { user.logout(); } looperThread.testComplete(); } @Override public void onError(ObjectServerError error) { RealmLog.error("onError"); fail(error.toString()); } }); }

Target:
public void getPermissions_noLongerValidWhenPermissionManagerIsClosed() { final PermissionManager pm = user.getPermissionManager(); looperThread.closeAfterTest(pm); pm.getPermissions(new PermissionManager.Callback<RealmResults<Permission>>() { @Override public void onSuccess(RealmResults<Permission> permissions) { try { assertTrue(permissions.isValid()); pm.close(); assertFalse(permissions.isValid()); } finally { user.logout(); } looperThread.testComplete(); } @Override public void onError(ObjectServerError error) { fail(error.toString()); } }); }
Source:
void submitCallback(final int rc) { if (null != timeout) { timeout.cancel(); } if (LOG.isDebugEnabled()) { LOG.debug("Submit callback (lid:{}, eid: {}). rc:{}", new Object[] { lh.getId(), entryId, rc }); } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (rc != BKException.Code.OK) { addOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); LOG.error("Write of ledger entry to quorum failed: L{} E{}", lh.getId(), entryId); } else { addOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cb.addComplete(rc, lh, entryId, ctx); ReferenceCountUtil.release(toSend); }

Target:
void submitCallback(final int rc) { ReferenceCountUtil.release(toSend); if (null != timeout) { timeout.cancel(); } if (LOG.isDebugEnabled()) { LOG.debug("Submit callback (lid:{}, eid: {}). rc:{}", new Object[] { lh.getId(), entryId, rc }); } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (rc != BKException.Code.OK) { addOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); LOG.error("Write of ledger entry to quorum failed: L{} E{}", lh.getId(), entryId); } else { addOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cb.addComplete(rc, lh, entryId, ctx); cbCompleted = true; }
Source:
public void testShutdownService() throws Exception { service.shutdown(); service.awaitTermination(1000, TimeUnit.MILLISECONDS); try { createExecutor(DEFAULT_OPTIONS).batch(Arrays.asList(new Put(EMPTY_KEY))); } catch (RetriesExhaustedWithDetailsException e) { Assert.assertEquals(1, e.getCauses().size()); Assert.assertEquals(IOException.class, e.getCause(0).getClass()); Assert.assertTrue(e.getCause(0).getMessage().toLowerCase().contains("closed")); } }

Target:
public void testShutdownService() throws Exception { service.shutdown(); service.awaitTermination(1000, TimeUnit.MILLISECONDS); try { batch(Arrays.asList(randomPut())); } catch (RetriesExhaustedWithDetailsException e) { Assert.assertEquals(1, e.getCauses().size()); Assert.assertEquals(IOException.class, e.getCause(0).getClass()); Assert.assertTrue(e.getCause(0).getMessage().toLowerCase().contains("closed")); } }
Source:
ChannelStateWriteRequestDispatcherImpl(CheckpointStorageWorkerView streamFactoryResolver, ChannelStateSerializer serializer) { this.writers = new HashMap<>(); this.streamFactoryResolver = streamFactoryResolver; this.serializer = serializer; }

Target:
ChannelStateWriteRequestDispatcherImpl(CheckpointStorageWorkerView streamFactoryResolver, ChannelStateSerializer serializer) { this.writers = new HashMap<>(); this.streamFactoryResolver = checkNotNull(streamFactoryResolver); this.serializer = checkNotNull(serializer); }
Source:
private void updateVertexBuffers() { if(isUpdatingVertexBuffers) { return; } ThreadHelper.invokeLater(()-> { isUpdatingVertexBuffers = true; if (this.isDrawable) { Color color; int vertIndex = 0; int colorIndex = 0; byte[] c = new byte[3]; for (LineSegment ls : gcodeLineList) { if (ls.isArc()) { color = arcColor; } else if (ls.isFastTraverse()) { color = rapidColor; } else if (ls.isZMovement()) { color = plungeColor; } else { color = linearColor; } if (ls.getLineNumber() < this.currentCommandNumber) { color = completedColor; } { Point3d p1 = ls.getStart(); Point3d p2 = ls.getEnd(); c[0] = (byte) color.getRed(); c[1] = (byte) color.getGreen(); c[2] = (byte) color.getBlue(); lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineVertexData[vertIndex++] = (float) p1.x; lineVertexData[vertIndex++] = (float) p1.y; lineVertexData[vertIndex++] = (float) p1.z; lineVertexData[vertIndex++] = (float) p2.x; lineVertexData[vertIndex++] = (float) p2.y; lineVertexData[vertIndex++] = (float) p2.z; } } this.colorArrayDirty = true; this.vertexArrayDirty = true; } isUpdatingVertexBuffers = false; }); }

Target:
private void updateVertexBuffers() { if (this.isDrawable) { Color color; int vertIndex = 0; int colorIndex = 0; byte[] c = new byte[3]; for (LineSegment ls : gcodeLineList) { if (ls.isArc()) { color = arcColor; } else if (ls.isFastTraverse()) { color = rapidColor; } else if (ls.isZMovement()) { color = plungeColor; } else { color = linearColor; } if (ls.getLineNumber() < this.currentCommandNumber) { color = completedColor; } { Point3d p1 = ls.getStart(); Point3d p2 = ls.getEnd(); c[0] = (byte) color.getRed(); c[1] = (byte) color.getGreen(); c[2] = (byte) color.getBlue(); lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineVertexData[vertIndex++] = (float) p1.x; lineVertexData[vertIndex++] = (float) p1.y; lineVertexData[vertIndex++] = (float) p1.z; lineVertexData[vertIndex++] = (float) p2.x; lineVertexData[vertIndex++] = (float) p2.y; lineVertexData[vertIndex++] = (float) p2.z; } } this.colorArrayDirty = true; this.vertexArrayDirty = true; } }
Source:
public void testAppPath() throws Exception { TestGeneratorInputOperator o1 = dag.addOperator("o1", TestGeneratorInputOperator.class); o1.setMaxTuples(1); File relPath = new File(dag.getAttributes().get(DAGContext.APPLICATION_PATH)); String uriPath = relPath.toURI().toString(); dag.setAttribute(DAGContext.APPLICATION_PATH, uriPath); StramLocalCluster cluster = new StramLocalCluster(dag); cluster.shutdown(); Assert.assertTrue("app path exists", relPath.exists() && relPath.isDirectory()); File checkPointDir = new File(relPath, LogicalPlan.SUBDIR_CHECKPOINTS); Assert.assertTrue("checkpoint path exists", checkPointDir.exists() && checkPointDir.isDirectory()); }

Target:
public void testAppPath() throws Exception { TestGeneratorInputOperator o1 = dag.addOperator("o1", TestGeneratorInputOperator.class); o1.setMaxTuples(1); File relPath = new File(dag.getAttributes().get(DAGContext.APPLICATION_PATH)); String uriPath = relPath.toURI().toString(); dag.setAttribute(DAGContext.APPLICATION_PATH, uriPath); StramLocalCluster cluster = new StramLocalCluster(dag); Assert.assertFalse(cluster.isFinished()); Assert.assertTrue("app path exists", relPath.exists() && relPath.isDirectory()); File checkPointDir = new File(relPath, LogicalPlan.SUBDIR_CHECKPOINTS); Assert.assertTrue("checkpoint path exists", checkPointDir.exists() && checkPointDir.isDirectory()); }
Source:
private VdsNetworkInterface findNicToSetupManagementNetwork() { VdsNetworkInterface nic = Entities.entitiesByName(host.getInterfaces()).get(host.getActiveNic()); if (nic == null) { log.warn("Failed to find a valid interface for the management network." + " If the interface is a bridge, it should be torn-down manually.", host.getActiveNic(), host.getName()); throw new NetworkConfiguratorException( String.format("Invalid interface for management network")); } Network managementNetwork = getDbFacade().getNetworkDao() .getByNameAndDataCenter(NetworkUtils.getEngineNetwork(), host.getStoragePoolId()); if (managementNetwork.getName().equals(nic.getNetworkName())) { return null; } if (!nicHasValidVlanId(managementNetwork, nic)) { final AuditLogableBase event = createEvent(); event.addCustomValue("VlanId", resolveVlanId(nic.getVlanId())); event.addCustomValue("MgmtVlanId", resolveVlanId(managementNetwork.getVlanId())); event.addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(event, AuditLogType.VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } return nic; }

Target:
private VdsNetworkInterface findNicToSetupManagementNetwork() { VdsNetworkInterface nic = Entities.entitiesByName(host.getInterfaces()).get(host.getActiveNic()); if (nic == null) { log.warn("Failed to find a valid interface for the management network of host {}." + " If the interface is a bridge, it should be torn-down manually.", host.getName(), host.getActiveNic()); throw new NetworkConfiguratorException( String.format("Interface %s is invalid for management network", host.getActiveNic())); } final Network managementNetwork = getManagementNetworkUtil().getManagementNetwork(host.getVdsGroupId()); if (managementNetwork.getName().equals(nic.getNetworkName())) { return null; } if (!nicHasValidVlanId(managementNetwork, nic)) { final AuditLogableBase event = createEvent(); event.addCustomValue("VlanId", resolveVlanId(nic.getVlanId())); event.addCustomValue("MgmtVlanId", resolveVlanId(managementNetwork.getVlanId())); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } return nic; }
Source:
static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if (proxy.type() == Proxy.Type.HTTP) { if (!(proxy.address() instanceof InetSocketAddress)) throw new IOException("Unsupported proxy address type " + proxy.address().getClass()); InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address(); if(proxyAddress.isUnresolved()) proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); targetAddress = proxyAddress; } } if (targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if (httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { LOGGER.log(Level.WARNING, INVALID_HTTP_PROXY_MSG + " HTTP Proxy: " + httpProxy); } } } return targetAddress; }

Target:
static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if (proxy.type() == Proxy.Type.HTTP) { if (!(proxy.address() instanceof InetSocketAddress)) { throw new IOException("Unsupported proxy address type " + proxy.address().getClass()); } InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address(); if (proxyAddress == null) { targetAddress = null; } else if (proxyAddress.isUnresolved()) { proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); } targetAddress = proxyAddress; } } if (targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if (httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { LOGGER.log(Level.WARNING, INVALID_HTTP_PROXY_MSG + " HTTP Proxy: " + httpProxy); } } } return targetAddress; }
Source:
public void shouldReturnEmptyResultWhenFileNotFound() { Review review = new Review(ImmutableList.of(new ReviewFile("test"))); ReviewResult reviewResult = fixture.process(review); assertThat(reviewResult).isNotNull(); assert reviewResult != null; assertThat(reviewResult.getViolations()).isEmpty(); }

Target:
public void shouldReturnEmptyResultWhenFileNotFound() { Review review = new Review(ImmutableList.of(new ReviewFile("test"))); ReviewResult reviewResult = fixture.process(mock(Review.class)); assertThat(reviewResult).isNotNull(); assert reviewResult != null; assertThat(reviewResult.getViolations()).isEmpty(); }
Source:
public void push(T value) { Element<T> newElement = new Element<>(value); this.size++; if (Objects.isNull(head)) { head = newElement; } else { newElement.next = head; head = newElement; } }

Target:
public final void push(T value) { Element<T> newElement = new Element<>(value); this.size++; if (Objects.isNull(head)) { head = newElement; } else { newElement.next = head; head = newElement; } }
Source:
public Iterable<Component> getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of("worldedit.operation.deform.expression", TextComponent.of(expression).color(TextColor.LIGHT_PURPLE))); }

Target:
public Iterable<Component> getStatusMessages() { return ImmutableList.of(TranslatableComponent.of("worldedit.operation.deform.expression", TextComponent.of(expression).color(TextColor.LIGHT_PURPLE))); }
Source:
private void onTrendsTabSelected() { mainTabPanel.forceLayout(); controlTree.onSummaryTrendsTab(); if (!chosenMetrics.isEmpty() && hasChanged) { for(Map.Entry<MetricNode, SummaryIntegratedDto> entry : chosenMetrics.entrySet()) { String plotId = entry.getKey().getId(); if (plotTrendsPanel.containsElementWithId(plotId)) { continue; } SummaryIntegratedDto cur = entry.getValue(); renderPlots( plotTrendsPanel, entry.getKey(), cur.getPlotIntegratedDto(), plotId, true ); plotTrendsPanel.scrollToBottom(); } hasChanged = false; } }

Target:
private void onTrendsTabSelected() { mainTabPanel.forceLayout(); controlTree.onSummaryTrendsTab(); if (!chosenMetrics.isEmpty() && hasChanged) { for(Map.Entry<MetricNode, SummaryIntegratedDto> entry : chosenMetrics.entrySet()) { String plotId = entry.getKey().getId(); if (plotTrendsPanel.containsElementWithId(plotId)) { continue; } renderPlots( plotTrendsPanel, entry.getKey(), entry.getValue().getPlotIntegratedDto(), plotId, true ); plotTrendsPanel.scrollToBottom(); } hasChanged = false; } }
Source:
public void restart(){ }

Target:
public void restart(){ throw new UnsupportedOperationException("Restart container is not supported with Docker Compose"); }
Source:
private void loadPlugins(String[] pluginsUrls) { for (final String url : pluginsUrls) { ScriptInjector.fromUrl(url) .setWindow(ScriptInjector.TOP_WINDOW) .setCallback(new Callback<Void, Exception>() { @Override public void onSuccess(Void result) { } @Override public void onFailure(Exception reason) { new ErrorDialog("Failed load pluing: " + url).show(); } }).inject(); } }

Target:
private void loadPlugins(String[] pluginsUrls) { for (final String url : pluginsUrls) { ScriptInjector.fromUrl(url) .setWindow(ScriptInjector.TOP_WINDOW) .setCallback(new Callback<Void, Exception>() { @Override public void onSuccess(Void result) { } @Override public void onFailure(Exception reason) { new ErrorDialog("Failed to load plugin: " + url).show(); } }).inject(); } }
Source:
public List<Object> getScatterPlotPointsOfLatestVersion(long datasetId, ScatterPlotPoints scatterPlotPoints) throws MLDataProcessingException { try { List<MLDatasetVersion> versions = databaseService.getAllVersionsetsOfDataset( scatterPlotPoints.getTenantId(), scatterPlotPoints.getUser(), datasetId); if (versions.size() < 1) { throw new MLDataProcessingException(String.format("%s is not a valid dataset Id", datasetId)); } long versionsetId = versions.get(versions.size() - 1).getId(); scatterPlotPoints.setVersionsetId(versionsetId); return databaseService.getScatterPlotPoints(scatterPlotPoints); } catch (DatabaseHandlerException e) { throw new MLDataProcessingException(e.getMessage(), e); } }

Target:
public List<Object> getScatterPlotPointsOfLatestVersion(long datasetId, ScatterPlotPoints scatterPlotPoints) throws MLDataProcessingException { try { List<MLDatasetVersion> versions = databaseService.getAllVersionsetsOfDataset( scatterPlotPoints.getTenantId(), scatterPlotPoints.getUser(), datasetId); if (versions.size() == 0) { throw new MLDataProcessingException(String.format("%s is not a valid dataset Id", datasetId)); } long versionsetId = versions.get(versions.size() - 1).getId(); scatterPlotPoints.setVersionsetId(versionsetId); return databaseService.getScatterPlotPoints(scatterPlotPoints); } catch (DatabaseHandlerException e) { throw new MLDataProcessingException(e.getMessage(), e); } }
Source:
public void testValidateCodeFoundByCodingUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }

Target:
public void testValidateCodeFoundByCodingUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }
Source:
public NodeSelector createNodeSelector(ConnectorId connectorId, int maxTasksPerStage) { Supplier<NodeMap> nodeMap = Suppliers.memoizeWithExpiration(() -> { ImmutableMap.Builder<String, InternalNode> byNodeId = ImmutableMap.builder(); ImmutableSetMultimap.Builder<HostAddress, InternalNode> byHostAndPort = ImmutableSetMultimap.builder(); ImmutableSetMultimap.Builder<InetAddress, InternalNode> byHost = ImmutableSetMultimap.builder(); ImmutableSetMultimap.Builder<NetworkLocation, InternalNode> workersByNetworkPath = ImmutableSetMultimap.builder(); Set<InternalNode> nodes; if (connectorId != null) { nodes = nodeManager.getActiveConnectorNodes(connectorId); } else { nodes = nodeManager.getNodes(ACTIVE); } Set<String> coordinatorNodeIds = nodeManager.getCoordinators().stream() .map(InternalNode::getNodeIdentifier) .collect(toImmutableSet()); for (InternalNode node : nodes) { byNodeId.put(node.getNodeIdentifier(), node); if (useNetworkTopology && (includeCoordinator || !coordinatorNodeIds.contains(node.getNodeIdentifier()))) { NetworkLocation location = networkLocationCache.get(node.getHostAndPort()); for (int i = 0; i <= location.getSegments().size(); i++) { workersByNetworkPath.put(location.subLocation(0, i), node); } } try { byHostAndPort.put(node.getHostAndPort(), node); InetAddress host = InetAddress.getByName(node.getInternalUri().getHost()); byHost.put(host, node); } catch (UnknownHostException e) { } } return new NodeMap(byNodeId.build(), byHostAndPort.build(), byHost.build(), workersByNetworkPath.build(), coordinatorNodeIds); }, nodeMapRefreshInNanos, TimeUnit.NANOSECONDS); if (useNetworkTopology) { return new TopologyAwareNodeSelector( nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, topologicalSplitCounters, networkLocationSegmentNames, networkLocationCache); } else { return new SimpleNodeSelector(nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, maxTasksPerStage); } }

Target:
public NodeSelector createNodeSelector(ConnectorId connectorId, int maxTasksPerStage) { Supplier<NodeMap> nodeMap = nodeMapRefreshInterval.toMillis() > 0 ? memoizeWithExpiration(createNodeMapSupplier(connectorId), nodeMapRefreshInterval.toMillis(), MILLISECONDS) : createNodeMapSupplier(connectorId); if (useNetworkTopology) { return new TopologyAwareNodeSelector( nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, topologicalSplitCounters, networkLocationSegmentNames, networkLocationCache); } else { return new SimpleNodeSelector(nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, maxTasksPerStage); } }
Source:
private void deleteFromMessageMonitoringDB(final MonitoredMessage trackMessage) { try { MessageMonitoringDAOImpl.getInstance().deleteCompletedMessages(trackMessage); } catch (final MessageMonitoringDAOException ex) { LOG.debug("Error While deleting Message from MessageMonitoring Table: {}", ex); return; } LOG.debug("Completed message deleted."); }

Target:
private void deleteFromMessageMonitoringDB(final MonitoredMessage trackMessage) { try { MessageMonitoringDAOImpl.getInstance().deleteCompletedMessages(trackMessage); } catch (final MessageMonitoringDAOException ex) { LOG.debug("Error While deleting Message from MessageMonitoring Table: {}", ex); } LOG.debug("Completed message deleted."); }
Source:
private TypedValue createTypedValue(CursorQuad cursorQuad, DataSet dataSet) { String type = cursorQuad.getValuetype().isPresent() ? cursorQuad.getValuetype().get() : RdfConstants.STRING; return TypedValue.create(cursorQuad.getObject(), type, dataSet); }

Target:
private TypedValue createTypedValue(CursorQuad cursorQuad, DataSet dataSet) { String type = cursorQuad.getValuetype().isPresent() ? cursorQuad.getValuetype().get() : RdfConstants.URI; return TypedValue.create(cursorQuad.getObject(), type, dataSet); }
Source:
boolean isEitherPasswordOrPrivateKeyAndPassPhrase() { if (!StringUtils.hasText(password)) { return StringUtils.hasText(privateKey) && StringUtils.hasText(passPhrase); } else { return !StringUtils.hasText(privateKey) && !StringUtils.hasText(passPhrase); } }

Target:
boolean isEitherPasswordOrPrivateKeyAndPassPhrase() { if (!StringUtils.hasText(password)) { return StringUtils.hasText(privateKey) && StringUtils.hasText(passPhrase); } return !StringUtils.hasText(privateKey) && !StringUtils.hasText(passPhrase); }
Source:
public Option[] config() { return new Option[]{ karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz")) .karafVersion(MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")).name("Apache Karaf").unpackDirectory(new File("target/exam")), keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.INFO), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/system.properties", "hibernate3.version", System.getProperty("hibernate3.version")), editConfigurationFilePut("etc/system.properties", "hibernate42.version", System.getProperty("hibernate42.version")), editConfigurationFilePut("etc/system.properties", "hibernate43.version", System.getProperty("hibernate43.version")), editConfigurationFilePut("etc/system.properties", "spring31.version", System.getProperty("spring31.version")), editConfigurationFilePut("etc/system.properties", "spring32.version", System.getProperty("spring32.version")), editConfigurationFilePut("etc/system.properties", "spring40.version", System.getProperty("spring40.version")), editConfigurationFilePut("etc/system.properties", "spring41.version", System.getProperty("spring41.version")) }; }

Target:
public Option[] config() { return new Option[]{ karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz")) .karafVersion(MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")) .name("Apache Karaf") .unpackDirectory(new File("target/karaf")), keepRuntimeFolder(), configureConsole().ignoreRemoteShell(), logLevel(LogLevelOption.LogLevel.WARN), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", Integer.toString(AvailablePortFinder.getNextAvailable())), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", Integer.toString(AvailablePortFinder.getNextAvailable())), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", Integer.toString(AvailablePortFinder.getNextAvailable())), junitBundles(), KarafDistributionOption.features(getCamelKarafFeatureUrl(), "camel", "camel-test"), mavenBundle().groupId("org.apache.camel").artifactId("camel-test-karaf").versionAsInProject() }; }
Source:
protected List<String> getCommandLineArgs(RuntimeIdentity runtimeId) { return new ArrayList<String>( Arrays.asList( "-push-endpoint", cheWebsocketEndpoint, "-runtime-id", String.format( "%s:%s:%s", runtimeId.getWorkspaceId(), MoreObjects.firstNonNull(runtimeId.getEnvName(), ""), runtimeId.getOwnerId()), "-cacert", certProvisioner.isConfigured() ? certProvisioner.getCertPath() : "", "--registry-address", Strings.nullToEmpty(pluginRegistryUrl))); }

Target:
protected List<String> getCommandLineArgs(RuntimeIdentity runtimeId) { return new ArrayList<String>( Arrays.asList( "--push-endpoint", cheWebsocketEndpoint, "--runtime-id", String.format( "%s:%s:%s", runtimeId.getWorkspaceId(), MoreObjects.firstNonNull(runtimeId.getEnvName(), ""), runtimeId.getOwnerId()), "--cacert", certProvisioner.isConfigured() ? certProvisioner.getCertPath() : "", "--registry-address", Strings.nullToEmpty(pluginRegistryUrl))); }
Source:
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { KualiDecimal pdpTotal = KualiDecimal.ZERO; PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.StandardAccountingExtractPdpConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader( getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { if (StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.StandardAccountingExtractPdpConstants.PAYMENT_CODE_CASH)) { if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line)) { PdpFeedGroupEntry currentGroup = getGroupEntryForLine(pdpFeedFileBaseEntry, line); PdpFeedDetailEntry currentDetail = getDetailEntryForLine(currentGroup, line); PdpFeedAccountingEntry currentAccounting = getAccountingEntryForLine(currentDetail, line); pdpTotal = pdpTotal.add(line.getJournalAmount()); String newAmount = addAmounts(currentAccounting.getAmount(), line.getJournalAmount()); currentAccounting.setAmount(newAmount); } } } pdpFeedFileBaseEntry.setTrailer(buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, pdpTotal)); return pdpFeedFileBaseEntry; }

Target:
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { KualiDecimal pdpTotal = KualiDecimal.ZERO; PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.StandardAccountingExtractPdpConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader( getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { replacePendingClientWithOverride(line); if (StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.PAYMENT_CODE_CASH)) { if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line)) { buildAndUpdateAccountingEntryFromLine(pdpFeedFileBaseEntry, line); pdpTotal = pdpTotal.add(line.getJournalAmount()); } } } pdpFeedFileBaseEntry.setTrailer(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, pdpTotal)); return pdpFeedFileBaseEntry; }
Source:
private void runJob(long transactionId, OptionalInt bucketNumber, long tableId, Set<UUID> shardUuids) throws IOException { TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, bucketNumber, shardUuids, metadata); log.info("Compacted shards %s into %s", shardUuids, newShards.stream().map(ShardInfo::getShardUuid).collect(toList())); shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), null, newShards, OptionalLong.empty(), false); }

Target:
private void runJob(long transactionId, OptionalInt bucketNumber, long tableId, Set<UUID> shardUuids) throws IOException { TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, bucketNumber, shardUuids, metadata); log.info("Compacted shards %s into %s", shardUuids, newShards.stream().map(ShardInfo::getShardUuid).collect(toList())); }
Source:
public Context getContext() { if (sdkName == null) { sdkName = this.getClass().getPackage().getName(); } return new Context("Sdk-Name", sdkName) .addData("Sdk-Version", SDK_VERSION); }

Target:
public Context getContext() { return new Context("Sdk-Name", sdkName) .addData("Sdk-Version", SDK_VERSION); }
Source:
public void testShallowCommitParse() throws Exception { RevCommit a = commit(); RevCommit b = commit(a); createShallowFile(b); rw = createRevWalk(); b = rw.parseCommit(b); markStart(b); assertCommit(b, rw.next()); assertNull(rw.next()); }

Target:
public void testShallowCommitParse() throws Exception { RevCommit a = commit(); RevCommit b = commit(a); createShallowFile(b); rw.close(); rw = createRevWalk(); b = rw.parseCommit(b); markStart(b); assertCommit(b, rw.next()); assertNull(rw.next()); }
Source:
public void testBackgroundUpdater() throws InterruptedException, SQLException, IOException { mySqlConfigProps.setProperty(UPDATER_POLLING_INTERVAL_SECONDS, "1"); Account testAccount = new AccountBuilder((short) 1, "testAccount1", Account.AccountStatus.ACTIVE).build(); when(mockMySqlAccountStore.getNewAccounts(anyLong())).thenReturn(new ArrayList<>()) .thenReturn(new ArrayList<>(Collections.singletonList(testAccount))); mySqlAccountService = getAccountService(); assertEquals("Background account updater thread should have been started", 1, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); assertNull("Cache should be empty", mySqlAccountService.getAccountById(testAccount.getId())); Thread.sleep(Long.parseLong(mySqlConfigProps.getProperty(UPDATER_POLLING_INTERVAL_SECONDS)) * 1000 + 100); assertEquals("Mismatch in account retrieved by ID", testAccount, mySqlAccountService.getAccountById(testAccount.getId())); mySqlAccountService.close(); mySqlAccountService.getScheduler().shutdownNow(); Thread.sleep(100); assertEquals("Background account updater thread should be stopped", 0, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); }

Target:
public void testBackgroundUpdater() throws InterruptedException, SQLException, IOException { mySqlConfigProps.setProperty(UPDATER_POLLING_INTERVAL_SECONDS, "1"); Account testAccount = new AccountBuilder((short) 1, "testAccount1", Account.AccountStatus.ACTIVE).build(); when(mockMySqlAccountStore.getNewAccounts(anyLong())).thenReturn(new ArrayList<>()) .thenReturn(new ArrayList<>(Collections.singletonList(testAccount))); mySqlAccountService = getAccountService(); assertEquals("Background account updater thread should have been started", 1, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); assertNull("Cache should be empty", mySqlAccountService.getAccountById(testAccount.getId())); Thread.sleep(Long.parseLong(mySqlConfigProps.getProperty(UPDATER_POLLING_INTERVAL_SECONDS)) * 1000 + 100); assertEquals("Mismatch in account retrieved by ID", testAccount, mySqlAccountService.getAccountById(testAccount.getId())); mySqlAccountService.close(); mySqlAccountService.getScheduler().shutdownNow(); assertTrue("Background account updater thread should be stopped", TestUtils.checkAndSleep(0, () -> numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX), 1000)); }
Source:
default int compareTo(@Nullable ISegment arg0) { if (arg0 == null) { throw new IllegalArgumentException("Cannot compared to null"); } return DEFAULT_COMPARATOR.compare(this, arg0); }

Target:
default int compareTo(@Nullable ISegment arg0) { if (arg0 == null) { throw new IllegalArgumentException("Cannot compared to null"); } return SegmentComparators.INTERVAL_START_COMPARATOR. thenComparing(SegmentComparators.INTERVAL_END_COMPARATOR). compare(this, arg0); }
Source:
public AlterConsumerGroupOffsetsResult(KafkaFuture<Map<TopicPartition, Errors>> future) { this.future = future; }

Target:
AlterConsumerGroupOffsetsResult(KafkaFuture<Map<TopicPartition, Errors>> future) { this.future = future; }
Source:
public NIC update(NIC device) { if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() == 1 && device.getPortMirroring().getNetworks().getNetworks().get(0).isSetId() && device.isSetNetwork() && device.getNetwork().isSetId() && !device.getNetwork() .getId() .equals(device.getPortMirroring().getNetworks().getNetworks().get(0).getId())) { Fault fault = new Fault(); fault.setReason("port mirrorings network must match to Nics network"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } else if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() > 1) { Fault fault = new Fault(); fault.setReason("cannot set more then one network to port mirroring"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } return super.update(device); }

Target:
public NIC update(NIC device) { if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() == 1 && device.getPortMirroring().getNetworks().getNetworks().get(0).isSetId() && device.isSetNetwork() && device.getNetwork().isSetId() && !device.getNetwork() .getId() .equals(device.getPortMirroring().getNetworks().getNetworks().get(0).getId())) { Fault fault = new Fault(); fault.setReason("The port mirroring network must match the Network set on the NIC"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } else if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() > 1) { Fault fault = new Fault(); fault.setReason("cannot set more than one network in port mirroring mode"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } return super.update(device); }
Source:
private boolean isInliningCandidate(Expression expression, ProjectNode node) { Set<Symbol> childOutputSet = ImmutableSet.copyOf(node.getOutputSymbols()); Map<Symbol, Long> dependencies = SymbolsExtractor.extractAll(expression).stream() .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> tryArguments = extractTryArguments(expression); return dependencies.entrySet().stream() .allMatch(entry -> (entry.getValue() == 1 || node.getAssignments().get(entry.getKey()) instanceof Literal) && !tryArguments.contains(entry.getKey())); }

Target:
private boolean isInliningCandidate(Expression expression, ProjectNode node) { Verify.verify(AstUtils.preOrder(expression).noneMatch(TryExpression.class::isInstance)); Set<Symbol> childOutputSet = ImmutableSet.copyOf(node.getOutputSymbols()); Map<Symbol, Long> dependencies = SymbolsExtractor.extractAll(expression).stream() .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); return dependencies.entrySet().stream() .allMatch(entry -> entry.getValue() == 1 || node.getAssignments().get(entry.getKey()) instanceof Literal); }
Source:
private void createRunConfigsTasks(@Nonnull Project project, ExtractNatives extractNatives, DownloadAssets downloadAssets, Map<String, RunConfig> runs) { project.getTasks().withType(GenerateEclipseClasspath.class, t -> { t.dependsOn(extractNatives, downloadAssets); }); TaskProvider<Task> prepareRun = project.getTasks().register("prepareRun", Task.class); prepareRun.configure(task -> { task.dependsOn(project.getTasks().getByName("classes"), extractNatives, downloadAssets); }); VersionJson json = null; try { json = Utils.loadJson(extractNatives.getMeta(), VersionJson.class); } catch (IOException e) List<String> additionalClientArgs = json != null ? json.getPlatformJvmArgs() : Collections.EMPTY_LIST; runs.values().forEach(runConfig -> { if (runConfig.isClient()) { runConfig.setJvmArgs(additionalClientArgs); } }); EclipseHacks.doEclipseFixes(project, extractNatives, downloadAssets, runs); IntellijUtils.createIntellijRunsTask(project, extractNatives, downloadAssets, prepareRun.get(), runs); }

Target:
private void createRunConfigsTasks(@Nonnull Project project, ExtractNatives extractNatives, DownloadAssets downloadAssets, Map<String, RunConfig> runs) { project.getTasks().withType(GenerateEclipseClasspath.class, t -> { t.dependsOn(extractNatives, downloadAssets); }); TaskProvider<Task> prepareRun = project.getTasks().register("prepareRun", Task.class); prepareRun.configure(task -> { task.dependsOn(project.getTasks().getByName("classes"), extractNatives, downloadAssets); }); VersionJson json = null; try { json = Utils.loadJson(extractNatives.getMeta(), VersionJson.class); } catch (IOException e) List<String> additionalClientArgs = json != null ? json.getPlatformJvmArgs() : Collections.emptyList(); runs.values().forEach(runConfig -> { if (runConfig.isClient()) { runConfig.jvmArgs(additionalClientArgs); } }); EclipseHacks.doEclipseFixes(project, extractNatives, downloadAssets, runs); IntellijUtils.createIntellijRunsTask(project, extractNatives, downloadAssets, prepareRun.get(), runs); }
Source:
private static File getFile(String path, HttpServletResponse response) throws IOException { if (path == null) { if (response != null) { response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, "Missing path parameter"); } return null; } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { if (response != null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); } return null; } return file; }

Target:
private static File getFile(String path, HttpServletResponse response) throws IOException { if (path == null) { if (response != null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Missing path parameter"); } return null; } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { if (response != null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); } return null; } return file; }