auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static String getPushServiceClassName( Context appContext ) { if( BackendlessPushService.pushServiceClassName != null ) return BackendlessPushService.pushServiceClassName; ClassLoader clsLoader = appContext.getClassLoader(); PackageManager packageManager = appContext.getPackageManager(); PackageInfo packageInfo; try { packageInfo = packageManager.getPackageInfo( appContext.getPackageName(), PackageManager.GET_SERVICES ); ServiceInfo[] services = packageInfo.services; for( ServiceInfo srvInfo : services ) { try { if( BackendlessPushService.class.isAssignableFrom( clsLoader.loadClass( srvInfo.name ) ) ) { BackendlessPushService.pushServiceClassName = srvInfo.name; break; } } catch( ClassNotFoundException e ) { Log.e( TAG, "Can not load declared service class.", e ); } } } catch( PackageManager.NameNotFoundException e ) { Log.e( TAG, "Can not load current app package." ); throw new IllegalStateException( "Can not load current app package." ); } if( BackendlessPushService.pushServiceClassName == null ) throw new IllegalStateException( "Can not find 'com.backendless.push.BackendlessPushService' or it inheritor in AndroidManifest.xml." ); else return BackendlessPushService.pushServiceClassName; }

Target:
private static String getPushServiceClassName( Context appContext ) { if( BackendlessPushService.pushServiceClassName != null ) return BackendlessPushService.pushServiceClassName; ClassLoader clsLoader = appContext.getClassLoader(); PackageManager packageManager = appContext.getPackageManager(); PackageInfo packageInfo; try { packageInfo = packageManager.getPackageInfo( appContext.getPackageName(), PackageManager.GET_SERVICES ); ServiceInfo[] services = packageInfo.services; for( ServiceInfo srvInfo : services ) { try { if( BackendlessPushService.class.isAssignableFrom( clsLoader.loadClass( srvInfo.name ) ) ) { BackendlessPushService.pushServiceClassName = srvInfo.name; break; } } catch( ClassNotFoundException e ) { Log.w( TAG, "You have declared class in AndroidManifest.xml that is not present in your app.", e ); } } } catch( PackageManager.NameNotFoundException e ) { Log.e( TAG, "Can not load current app package." ); throw new IllegalStateException( "Can not load current app package.", e ); } if( BackendlessPushService.pushServiceClassName == null ) { throw new IllegalStateException( "A reference to BackendlessPushService is missing in AndroidManifest.xml. Make sure to add" + "<service android:name=\"com.backendless.push.BackendlessPushService\" /> to the manifest file." + "Alternatively, if you have a custom push service implementation, make sure your class inherits from" + "\"com.backendless.push.BackendlessPushService\" and is registered in the manifest file" + "as <service android:name=\"your push service fully qualified class name\" />" ); } else return BackendlessPushService.pushServiceClassName; }
Source:
protected UsageAwareDatastoreConnection<UpdateableDataContext> createDatastoreConnection() { Object client = null; switch (_clientType) { case NODE: client = getClientForJoingClusterAsNode(); break; case TRANSPORT: client = getClientForTransportProtocol(); break; case REST: client = getClientForRestProtocol(); default: } final DataContext dataContext; if (_tableDefs == null || _tableDefs.length == 0) { if (_clientType == ClientType.NODE || _clientType == ClientType.TRANSPORT) { dataContext = new ElasticSearchDataContext((Client) client, _indexName); } else { dataContext = new ElasticSearchRestDataContext((JestClient) client, _indexName); } } else { if (_clientType == ClientType.NODE || _clientType == ClientType.TRANSPORT) { dataContext = new ElasticSearchDataContext((Client) client, _indexName, _tableDefs); } else { dataContext = new ElasticSearchRestDataContext((JestClient) client, _indexName, _tableDefs); } } switch (_clientType) { case NODE: case TRANSPORT: return new UpdateableDatastoreConnectionImpl<UpdateableDataContext>((ElasticSearchDataContext) dataContext, this, (Client) client); case REST: return new UpdateableDatastoreConnectionImpl<UpdateableDataContext>( (ElasticSearchRestDataContext) dataContext, this); } return null; }

Target:
protected UsageAwareDatastoreConnection<UpdateableDataContext> createDatastoreConnection() { final DataContext dataContext; if (_tableDefs == null || _tableDefs.length == 0) { if (_clientType.equals(ClientType.NODE) || _clientType.equals(ClientType.TRANSPORT)) { final Client client = getClientForNodeAndTransportProtocol(); dataContext = new ElasticSearchDataContext(client, _indexName); return createConnection(dataContext, client); } else { dataContext = new ElasticSearchRestDataContext(getClientForRestProtocol(), _indexName); return createConnection(dataContext, null); } } else { if (_clientType.equals(ClientType.NODE) || _clientType.equals(ClientType.TRANSPORT)) { final Client client = getClientForNodeAndTransportProtocol(); dataContext = new ElasticSearchDataContext(client, _indexName, _tableDefs); return createConnection(dataContext, client); } else { dataContext = new ElasticSearchRestDataContext(getClientForRestProtocol(), _indexName, _tableDefs); return createConnection(dataContext, null); } } }
Source:
static String buildDeadlockInfo() { ThreadMXBean threadBean = ManagementFactory.getThreadMXBean(); long[] threadIds = threadBean.findMonitorDeadlockedThreads(); if (threadIds != null && threadIds.length > 0) { StringWriter stringWriter = new StringWriter(); PrintWriter out = new PrintWriter(stringWriter); ThreadInfo[] infos = threadBean.getThreadInfo(threadIds, true, true); for (ThreadInfo ti : infos) { printThreadInfo(ti, out); printLockInfo(ti.getLockedSynchronizers(), out); out.println(); } out.close(); return stringWriter.toString(); } else { return null; } }

Target:
private static String buildDeadlockInfo() { ThreadMXBean threadBean = ManagementFactory.getThreadMXBean(); long[] threadIds = threadBean.findMonitorDeadlockedThreads(); if (threadIds != null && threadIds.length > 0) { StringBuilder sb = new StringBuilder(); ThreadInfo[] infos = threadBean.getThreadInfo(threadIds, true, true); for (ThreadInfo ti : infos) { printThreadInfo(ti, sb); printLockInfo(ti.getLockedSynchronizers(), sb); sb.append(System.getProperty("line.separator")); } return sb.toString(); } else { return null; } }
Source:
static void addJarToClassPath( File jarFile, Path distributedClassPath, Path intermediateClassPath, FileSystem fs, Job job ) throws IOException { fs.mkdirs(distributedClassPath); final Path hdfsPath = new Path(distributedClassPath, jarFile.getName()); if (!fs.exists(hdfsPath)) { final Path intermediateHdfsPath = new Path(intermediateClassPath, jarFile.getName()); uploadJar(jarFile, intermediateHdfsPath, fs); IOException exception = null; try { log.info("Renaming jar to path[%s]", hdfsPath); fs.rename(intermediateHdfsPath, hdfsPath); if (!fs.exists(hdfsPath)) { throw new IOException( String.format( "File does not exist even after moving from[%s] to [%s]", intermediateHdfsPath, hdfsPath ) ); } } catch (IOException e) { try { if (!fs.exists(hdfsPath)) { log.error(e, "IOException while Renaming jar file"); exception = e; } } catch (IOException e1) { e.addSuppressed(e1); exception = e; } } finally { try { if (fs.exists(intermediateHdfsPath)) { fs.delete(intermediateHdfsPath, false); } } catch (IOException e) { if (exception != null) { exception.addSuppressed(e); } else { exception = e; } } if (exception != null) { throw exception; } } } job.addFileToClassPath(hdfsPath); }

Target:
static void addJarToClassPath( File jarFile, Path distributedClassPath, Path intermediateClassPath, FileSystem fs, Job job ) throws IOException { fs.mkdirs(distributedClassPath); final Path hdfsPath = new Path(distributedClassPath, jarFile.getName()); if (!fs.exists(hdfsPath)) { final Path intermediateHdfsPath = new Path(intermediateClassPath, jarFile.getName()); uploadJar(jarFile, intermediateHdfsPath, fs); IOException exception = null; try { log.info("Renaming jar to path[%s]", hdfsPath); fs.rename(intermediateHdfsPath, hdfsPath); if (!fs.exists(hdfsPath)) { throw new IOException( String.format( "File does not exist even after moving from[%s] to [%s]", intermediateHdfsPath, hdfsPath ) ); } } catch (IOException e) { try { if (!fs.exists(hdfsPath)) { log.error(e, "IOException while Renaming jar file"); exception = e; } } catch (IOException e1) { e.addSuppressed(e1); exception = e; } } finally { try { if (fs.exists(intermediateHdfsPath)) { fs.delete(intermediateHdfsPath, false); } } catch (IOException e) { if (exception == null) { exception = e; } else { exception.addSuppressed(e); } } if (exception != null) { throw exception; } } } job.addFileToClassPath(hdfsPath); }
Source:
private <T extends EntityAttributes<?>> void sanitizeMapForSaving(Map<String, T> map) { for (T attribute : map.values()) { attribute.sanitizeForSaving(); } }

Target:
private <T extends EntityAttributes<? extends BaseEntity>> void sanitizeMapForSaving(Map<String, T> map) { for (T attribute : map.values()) { attribute.sanitizeForSaving(); } }
Source:
private boolean isHostSwapping(VDS host, int allowedSwapUsage) { if (host.getSwapTotal() == null || host.getSwapFree() == null || host.getMemFree() == null || host.getMemAvailable() <= 0 || host.getPhysicalMemMb() == null || host.getPhysicalMemMb() <= 0) { return false; } long swapTotal = host.getSwapTotal(); long swapFree = host.getSwapFree(); long memFree = host.getMemFree(); long physicalMemMb = host.getPhysicalMemMb(); return ((swapTotal - swapFree - memFree) * 100 / physicalMemMb) > allowedSwapUsage; }

Target:
private boolean isHostSwapping(VDS host, int allowedSwapUsage) { if (host.getSwapTotal() == null || host.getSwapFree() == null || host.getMemFree() == null || host.getMemFree() <= 0 || host.getPhysicalMemMb() == null || host.getPhysicalMemMb() <= 0) { return false; } long swapTotal = host.getSwapTotal(); long swapFree = host.getSwapFree(); long memFree = host.getMemFree(); long physicalMemMb = host.getPhysicalMemMb(); return ((swapTotal - swapFree - memFree) * 100 / physicalMemMb) > allowedSwapUsage; }
Source:
private void logStart() { log(3, "Running test " + m_testName + " on " + m_classMap.size() + " " + " classes, " + " included groups:[" + Strings.mapToString(m_xmlMethodSelector.getIncludedGroups()) + "] excluded groups:[" + Strings.mapToString(m_xmlMethodSelector.getExcludedGroups()) + "]"); if (getVerbose() >= 3) { for (ITestClass tc : m_classMap.values()) { ((TestClass) tc).dump(); } } }

Target:
private void logStart() { log(3, "Running test " + m_testName + " on " + m_classMap.size() + " " + " classes, " + " included groups:[" + Strings.valueOf(m_xmlMethodSelector.getIncludedGroups()) + "] excluded groups:[" + Strings.valueOf(m_xmlMethodSelector.getExcludedGroups()) + "]"); if (getVerbose() >= 3) { for (ITestClass tc : m_classMap.values()) { ((TestClass) tc).dump(); } } }
Source:
protected void validateMatchers(Invocation invocation, List<LocalizedMatcher> lastMatchers) { if (!lastMatchers.isEmpty()) { int recordedMatchersSize = lastMatchers.size(); int expectedMatchersSize = invocation.getArguments().length; if (expectedMatchersSize != recordedMatchersSize) { throw invalidUseOfMatchers(expectedMatchersSize, lastMatchers); } } }

Target:
private void validateMatchers(Invocation invocation, List<LocalizedMatcher> lastMatchers) { if (!lastMatchers.isEmpty()) { int recordedMatchersSize = lastMatchers.size(); int expectedMatchersSize = invocation.getArguments().length; if (expectedMatchersSize != recordedMatchersSize) { throw invalidUseOfMatchers(expectedMatchersSize, lastMatchers); } } }
Source:
default <R> IModel<R> flatMap(WicketFunction<? super T, IModel<R>> mapper) { return new IModel<R>() { @Override public R getObject() { T object = IModel.this.getObject(); if (object != null) { return mapper.apply(object).getObject(); } else { return null; } } @Override public void setObject(R object) { T modelObject = IModel.this.getObject(); if (modelObject != null) { mapper.apply(modelObject).setObject(object); } } @Override public void detach() { T object = IModel.this.getObject(); if (object != null) { IModel<R> model = mapper.apply(object); if (model != null) { model.detach(); } } } }; }

Target:
default <R> IModel<R> flatMap(WicketFunction<? super T, IModel<R>> mapper) { return new IModel<R>() { @Override public R getObject() { T object = IModel.this.getObject(); if (object != null) { IModel<R> model = mapper.apply(object); if (model != null) { return model.getObject(); } else { return null; } } else { return null; } } @Override public void setObject(R object) { T modelObject = IModel.this.getObject(); if (modelObject != null) { IModel<R> model = mapper.apply(modelObject); if (model != null) { model.setObject(object); } } } @Override public void detach() { T object = IModel.this.getObject(); if (object != null) { IModel<R> model = mapper.apply(object); if (model != null) { model.detach(); } } } }; }
Source:
public int getHttp2Port() { return -1; }

Target:
public int getHttp2Port() { if (hasHttp2Port()) { return http2Port.getPort(); } else { throw new IllegalStateException("No HTTP2 port exists for the Data Node " + hostName + ":" + plainTextPort); } }
Source:
public int compare(Viewer viewer, Object e1, Object e2) { MyModel location_1 = (MyModel) e1; MyModel location_2 = (MyModel) e2; return Integer.compare(location_2.populationSize, location_1.populationSize); }

Target:
public int compare(Viewer viewer, Object e1, Object e2) { MyModel location1 = (MyModel) e1; MyModel location2 = (MyModel) e2; return Integer.compare(location2.getPopulationSize(), location1.getPopulationSize()); }
Source:
private static String unwrap(final String stringToUnwrap, final Character wrappingCharacterStart, final Character wrappingCharacterEnd) { int start = stringToUnwrap.indexOf(wrappingCharacterStart); int end = stringToUnwrap.lastIndexOf(wrappingCharacterEnd); if (start < 0 || end < 0) { return stringToUnwrap; } return stringToUnwrap.substring(start + 1, end).trim(); }

Target:
private static String unwrap(final String stringToUnwrap, final Character wrappingCharacterStart, final Character wrappingCharacterEnd) { int start = stringToUnwrap.indexOf(wrappingCharacterStart); int end = stringToUnwrap.lastIndexOf(wrappingCharacterEnd); if (start < 0 && end < 0) { return stringToUnwrap; } if (start < 0 || end < 0 || end <= start) { final String message = String.format("\"%s\" had not characters '%c':%d and '%c':%d in appropriate order.", stringToUnwrap, wrappingCharacterStart, start, wrappingCharacterEnd, end); throw new IllegalArgumentException(message); } return stringToUnwrap.substring(start + 1, end).trim(); }
Source:
public ImmutableBitmap getBitmapIndex(final BitmapIndexSelector selector) { final Context cx = Context.enter(); try { ImmutableBitmap bitmap; boolean hasEmptyDimension = false; Indexed<String> dimValuesList = new Indexed[dimension.length]; Iterator<String> dimValuesIterator = new Iterator[dimension.length]; String[] currentDim = new String[dimension.length]; for(int idx = 0; idx < dimension.length; idx++) { dimValuesList[idx] = selector.getDimensionValues(dimension[idx]); if (dimValuesList[idx].size() == 0) { hasEmptyDimension = true; break; } dimValuesIterator[idx] = dimValuesList[idx].iterator(); if (idx != 0) { currentDim[idx] = dimValuesIterator[idx].next(); } } bitmap = selector.getBitmapFactory().makeEmptyImmutableBitmap(); if (!hasEmptyDimension) { int iteratingIndex = 0; while(true) { Iterator<String> iterator = dimValuesIterator[iteratingIndex]; if (iterator.hasNext()) { currentDim[iteratingIndex] = iterator.next(); if (iteratingIndex > 0) { for (int idx = 0; idx < iteratingIndex; idx++) { dimValuesIterator[idx] = dimValuesList[idx].iterator(); currentDim[idx] = dimValuesIterator[idx].next(); } iteratingIndex = 0; } if (predicate.applyInContext(cx, currentDim)) { ImmutableBitmap overlap = null; for (int idx = 0; idx < dimension.length; idx++) { ImmutableBitmap dimBitMap = selector.getBitmapIndex(dimension[idx], currentDim[idx]); overlap = (overlap == null) ? dimBitMap : overlap.intersection(dimBitMap); } bitmap = bitmap.union(overlap); } } else { iteratingIndex++; if (iteratingIndex == dimension.length) break; } } } return bitmap; } finally { Context.exit(); } }

Target:
public ImmutableBitmap getBitmapIndex(final BitmapIndexSelector selector) { Iterable<String>[] dimValuesList = new Iterable[dimensions.length]; for (int idx = 0; idx < dimensions.length; idx++) { Indexed<String> dimValues = selector.getDimensionValues(dimensions[idx]); if (dimValues == null || dimValues.size() == 0) { dimValuesList[idx] = EMPTY_STR_DIM_VAL; } else { dimValuesList[idx] = dimValues; } } ImmutableBitmap bitmap = selector.getBitmapFactory().makeEmptyImmutableBitmap(); final Context cx = Context.enter(); try { for (String[] param : IterableUtils.cartesian(String.class, dimValuesList)) { if (predicate.applyInContext(cx, param)) { ImmutableBitmap overlap = null; for (int idx = 0; idx < dimensions.length; idx++) { ImmutableBitmap dimBitMap = selector.getBitmapIndex(dimensions[idx], param[idx]); overlap = overlap == null ? dimBitMap : overlap.intersection(dimBitMap); } bitmap = bitmap.union(overlap); } } return bitmap; } finally { Context.exit(); } }
Source:
public void makeFeedInstanceAvailable(String feedName, String clusterName, Date nominalTime) { LOG.info("Removing feed's instance in cluster from pendingSLA", feedName, clusterName, nominalTime); if (CollectionUtils.isEmpty(MONITORING_JDBC_STATE_STORE.getNominalInstances(feedName, clusterName))){ MONITORING_JDBC_STATE_STORE.deletePendingNominalInstances(feedName, clusterName, nominalTime); } }

Target:
public void makeFeedInstanceAvailable(String feedName, String clusterName, Date nominalTime) throws FalconException { LOG.info("Removing feed's instance in cluster from pendingSLA", feedName, clusterName, nominalTime); List<Date> instances = (MONITORING_JDBC_STATE_STORE.getNominalInstances(feedName, clusterName)); if (CollectionUtils.isEmpty(instances)){ MONITORING_JDBC_STATE_STORE.deletePendingInstance(feedName, clusterName, nominalTime); } }
Source:
public void connectionEvent(Connection connection, Events events) { switch (events) { case DISCONNECTED: isNatsRunning = false; LOGGER.error("Nats connection disconnected"); if (!context.getConfig().ignoreProducerError) { this.context.terminate(new RuntimeException("Nats Disconnected")); return; } break; case CLOSED: isNatsRunning = false; LOGGER.error("Nats connection closed"); break; case RECONNECTED: isNatsRunning = true; LOGGER.info("Nats connection reconnected"); break; } }

Target:
public void connectionEvent(Connection connection, Events events) { switch (events) { case DISCONNECTED: isNatsRunning = false; LOGGER.error("Nats connection disconnected"); break; case CLOSED: isNatsRunning = false; LOGGER.error("Nats connection closed"); this.context.terminate(new RuntimeException("Nats Disconnected")); break; case RECONNECTED: isNatsRunning = true; LOGGER.info("Nats connection reconnected"); break; } }
Source:
public void downloadRegister_shouldReturnAZipfile() throws IOException { Response response = getRequest("/download-register"); assertThat(response.getHeaderString("Content-Type"), equalTo(MediaType.APPLICATION_OCTET_STREAM)); assertThat(response.getHeaderString("Content-Disposition"), startsWith("attachment; filename=")); assertThat(response.getHeaderString("Content-Disposition"), endsWith(".zip")); InputStream is = response.readEntity(InputStream.class); assertTrue(getEntries(is).contains("register.json")); }

Target:
public void downloadRegister_shouldReturnAZipfile() throws IOException { Response response = getRequest("/download-register"); assertThat(response.getHeaderString("Content-Type"), equalTo(MediaType.APPLICATION_OCTET_STREAM)); assertThat(response.getHeaderString("Content-Disposition"), startsWith("attachment; filename=")); assertThat(response.getHeaderString("Content-Disposition"), endsWith(".zip")); InputStream is = response.readEntity(InputStream.class); assertThat(getEntries(is), hasItem("register.json")); }
Source:
public static BufferedImage mergeLegends(Rule[] rules, GetLegendGraphicRequest req, MergeOptions mergeOptions) { List<RenderedImage> imageStack= mergeOptions.getImageStack(); final int imgCount = imageStack.size(); List<BufferedImage> nodes = new ArrayList<BufferedImage>(); if (imgCount == 1 && (!mergeOptions.isForceLabelsOn() || rules == null)) { return (BufferedImage) imageStack.get(0); } else { for (int i = 0; i < imgCount; i++) { BufferedImage img = (BufferedImage) imageStack.get(i); if (rules != null && rules[i] != null) { BufferedImage label = renderLabel(img, rules[i], req, mergeOptions); if (label != null) { img = joinBufferedImageHorizzontally(img, label, mergeOptions.getLabelFont(), mergeOptions.isAntialias(), mergeOptions.isTransparent(), mergeOptions.getBackgroundColor(), mergeOptions.getLabelMargin()); } nodes.add(img); } else { nodes.add(img); } } } LegendLayout layout = mergeOptions.getLayout(); BufferedImage finalLegend = null; if (layout == LegendLayout.HORIZONTAL) { Row[] rows = createRows(nodes, mergeOptions.getRowWidth(), mergeOptions.getRows()); finalLegend = buildFinalHLegend(rows, mergeOptions); } if (layout == LegendLayout.VERTICAL) { Column[] columns = createNRColumns(nodes, mergeOptions.getColumnHeight(), mergeOptions.getColumns(), req); finalLegend = buildFinalVLegend(columns, mergeOptions); } return finalLegend; }

Target:
public static BufferedImage mergeLegends(Rule[] rules, GetLegendGraphicRequest req, MergeOptions mergeOptions) { List<RenderedImage> imageStack= mergeOptions.getImageStack(); final int imgCount = imageStack.size(); List<BufferedImage> nodes = new ArrayList<BufferedImage>(); if (imgCount == 1 && (!mergeOptions.isForceLabelsOn() || rules == null)) { return (BufferedImage) imageStack.get(0); } else { for (int i = 0; i < imgCount; i++) { BufferedImage img = (BufferedImage) imageStack.get(i); if (rules != null && rules[i] != null) { BufferedImage label = renderLabel(img, rules[i], req, mergeOptions); if (label != null) { img = joinBufferedImageHorizzontally(img, label, mergeOptions.getLabelFont(), mergeOptions.isAntialias(), mergeOptions.isTransparent(), mergeOptions.getBackgroundColor(), mergeOptions.getLabelMargin()); } nodes.add(img); } else { nodes.add(img); } } } LegendLayout layout = mergeOptions.getLayout(); BufferedImage finalLegend = null; if (layout == LegendLayout.HORIZONTAL) { Row[] rows = createRows(nodes, mergeOptions.getRowWidth(), mergeOptions.getRows()); finalLegend = buildFinalHLegend(rows, mergeOptions); } if (layout == LegendLayout.VERTICAL) { Column[] columns = createColumns(nodes, mergeOptions.getColumnHeight(), mergeOptions.getColumns(), req, true); finalLegend = buildFinalVLegend(columns, mergeOptions); } return finalLegend; }
Source:
public String sanitize(String title) { return removeCommonPrefixes(titleTransform.apply(title) .replaceAll(" & ", " and ") .replaceAll("[^\\d\\w\\s]", "").toLowerCase()); }

Target:
private String sanitize(String title) { return removeCommonPrefixes(titleTransform.apply(title) .replaceAll(" & ", " and ") .replaceAll("[^\\d\\w\\s]", "").toLowerCase()); }
Source:
private boolean checkOvsNetwork(final String networkName) { s_logger.debug("Checking if network " + networkName + " exists as openvswitch bridge"); if (networkName == null) { return true; } final Script command = new Script("/bin/sh", _timeout.getMillis()); command.add("-c"); command.add("ovs-vsctl br-exists " + networkName); return "0".equals(command.execute(null)); }

Target:
private boolean checkOvsNetwork(final String networkName) { s_logger.debug("Checking if network " + networkName + " exists as openvswitch bridge"); if (networkName == null) { return true; } final Script command = new Script("/bin/sh", _timeout); command.add("-c"); command.add("ovs-vsctl br-exists " + networkName); return "0".equals(command.execute(null)); }
Source:
public void listenTo(final TextBoxBase tb) { strings.put(tb, tb.getText()); tb.addKeyPressHandler(this); tb.addMouseUpHandler(this); tb.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { strings.put(tb, tb.getText()); } }); tb.sinkEvents(Event.ONPASTE); Element el = tb.getElement(); tbis.put(el, new TBBInfo(tb, Event.getEventListener(el))); Event.setEventListener(el, this); }

Target:
public void listenTo(final TextBoxBase tb) { strings.put(tb, tb.getText()); tb.addKeyPressHandler(this); tb.addMouseUpHandler(this); tb.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { strings.put(tb, tb.getText()); } }); tb.addKeyDownHandler(this); }
Source:
public final MultipartPart call() { return uploadMultipartPart(mpu, partNumber, payload); }

Target:
public MultipartPart call() { return uploadMultipartPart(mpu, partNumber, payload); }
Source:
public void exerciseAvailable() { Exercise exercise = adaptiveParser.parseFromJson("{ available: true, zip_url: someUrl }"); assertEquals(URI.create("http://someUrl"), exercise.getZipUrl()); }

Target:
public void exerciseAvailable() { Exercise exercise = adaptiveParser.parseFromJson("{ available: true, zip_url: example.com }"); assertEquals(URI.create("<LINK_0>"), exercise.getZipUrl()); }
Source:
protected void doDestroy() { session.ifPresent(s -> { final CanvasHandler canvasHandler = s.getCanvasHandler(); if (canvasHandler instanceof AbstractCanvasHandler) { final AbstractCanvasHandler abstractCanvasHandler = (AbstractCanvasHandler) canvasHandler; abstractCanvasHandler.removeRegistrationListener(redrawElementListener); abstractCanvasHandler.removeDomainObjectListener(redrawDomainObjectListener); } }); session = Optional.empty(); gridLayer = null; }

Target:
protected void doDestroy() { withCanvasHandler(abstractCanvasHandler -> { abstractCanvasHandler.removeRegistrationListener(redrawElementListener); abstractCanvasHandler.removeDomainObjectListener(redrawDomainObjectListener); }); session = Optional.empty(); gridLayer = null; }
Source:
public static int sample_value(double lambda) { if (lambda < 15) return sampleSmall(lambda); double alpha = 7.0 / 8.0; int m = (int) Math.floor(alpha * lambda); double x = Gamma.sampleVal(m, 1); int r; if (x < lambda) { r = m + Poisson.sample_value(lambda - x); } else { r = Binomial.sampleVal(m - 1, lambda / x); } return r; }

Target:
public static int sample_value(double lambda) { if (lambda < 15) return sampleSmall(lambda); double alpha = 7.0 / 8.0; int m = (int) Math.floor(alpha * lambda); double x = Gamma.sampleVal(m, 1); int r; if (x < lambda) { r = m + Poisson.sample_value(lambda - x); } else { r = Binomial.sample_value(m - 1, lambda / x); } return r; }
Source:
public void copyObject(String bucketName, String objectName, Map<String,String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException, InvalidResponseException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } checkObjectName(objectName); checkWriteRequestSse(sse); if ((srcBucketName == null) || (srcBucketName.isEmpty())) { throw new InvalidArgumentException("Source bucket name cannot be empty"); } if (srcObjectName == null) { srcObjectName = objectName; } checkReadRequestSse(srcSse); if (headerMap == null) { headerMap = new HashMap<>(); } headerMap.put("x-amz-copy-source", S3Escaper.encodePath(srcBucketName + "/" + srcObjectName)); if (sse != null) { headerMap.putAll(sse.headers()); } if (srcSse != null) { headerMap.putAll(srcSse.copySourceHeaders()); } if (copyConditions != null) { headerMap.putAll(copyConditions.getConditions()); } HttpResponse response = executePut(bucketName, objectName, headerMap, null, "", 0, false); CopyObjectResult result = new CopyObjectResult(); try (ResponseBody body = response.body()) { result.parseXml(body.charStream()); } }

Target:
public void copyObject(String bucketName, String objectName, Map<String,String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException, InvalidResponseException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } checkObjectName(objectName); checkWriteRequestSse(sse); if ((srcBucketName == null) || (srcBucketName.isEmpty())) { throw new InvalidArgumentException("Source bucket name cannot be empty"); } if (srcObjectName == null) { srcObjectName = objectName; } checkReadRequestSse(srcSse); if (headerMap == null) { headerMap = new HashMap<>(); } headerMap.put("x-amz-copy-source", S3Escaper.encodePath(srcBucketName + "/" + srcObjectName)); if (sse != null) { headerMap.putAll(sse.headers()); } if (srcSse != null) { headerMap.putAll(srcSse.copySourceHeaders()); } if (copyConditions != null) { headerMap.putAll(copyConditions.getConditions()); } HttpResponse response = executePut(bucketName, objectName, headerMap, null, "", 0); CopyObjectResult result = new CopyObjectResult(); try (ResponseBody body = response.body()) { result.parseXml(body.charStream()); } }
Source:
private HibernateOrmSearchManagerBuilder createSearchManagerBuilder(EntityManager entityManager) { SessionImplementor sessionImplementor = entityManager.unwrap( SessionImplementor.class ); SessionFactoryImplementor givenSessionFactory = sessionImplementor.getSessionFactory(); if ( !givenSessionFactory.getUuid().equals( sessionFactoryImplementor.getUuid() ) ) { throw log.usingDifferentSessionFactories( sessionFactoryImplementor, givenSessionFactory ); } return new HibernateOrmSearchManagerImpl.Builder( getDelegate(), sessionImplementor ); }

Target:
private HibernateOrmSearchManagerBuilder createSearchManagerBuilder(EntityManager entityManager) { SessionImplementor sessionImplementor = entityManager.unwrap( SessionImplementor.class ); SessionFactoryImplementor givenSessionFactory = sessionImplementor.getSessionFactory(); if ( !givenSessionFactory.equals( sessionFactoryImplementor ) ) { throw log.usingDifferentSessionFactories( sessionFactoryImplementor, givenSessionFactory ); } return new HibernateOrmSearchManagerImpl.Builder( getDelegate(), sessionImplementor ); }
Source:
public void apply() { if (!ItemMorb.validMobs.contains(entityId)) { CraftTweakerAPI.logError("Not a valid morb entity: " + entityId); return; } if (energy==null) { this.energy=CentrifugeManager.DEFAULT_ENERGY*2; } if (fluid==null) { this.fluid=new FluidStack(TFFluids.fluidExperience, xp * CoreProps.MB_PER_XP); ArrayList<ItemStack> outputStandard = new ArrayList<ItemStack>(Arrays.asList(outputs)); ArrayList<ItemStack> outputReusable = new ArrayList<ItemStack>(Arrays.asList(outputs)); ArrayList<Integer> chanceStandard = new ArrayList<Integer>(Arrays.asList(chances)); ArrayList<Integer> chanceReusable = new ArrayList<Integer>(Arrays.asList(chances)); outputStandard.add(ItemHelper.cloneStack(ItemMorb.morbStandard)); outputReusable.add(ItemHelper.cloneStack(ItemMorb.morbReusable)); chanceStandard.add(ItemMorb.REUSE_CHANCE); chanceReusable.add(100); CentrifugeManager.addRecipeMob(energy, ItemMorb.setTag(ItemHelper.cloneStack(ItemMorb.morbStandard), this.entityId, false), outputStandard, chanceStandard, fluid); CentrifugeManager.addRecipeMob(energy, ItemMorb.setTag(ItemHelper.cloneStack(ItemMorb.morbReusable), this.entityId, false), outputReusable, chanceReusable, fluid); } @Override protected String getRecipeInfo() { return entityId; } }

Target:
public void apply() { if (!ItemMorb.validMobs.contains(entityId)) { CraftTweakerAPI.logError("Not a valid morb entity: " + entityId); return; } if (fluid==null) { this.fluid=new FluidStack(TFFluids.fluidExperience, xp * CoreProps.MB_PER_XP); } ArrayList<ItemStack> outputStandard = new ArrayList<ItemStack>(Arrays.asList(outputs)); ArrayList<ItemStack> outputReusable = new ArrayList<ItemStack>(Arrays.asList(outputs)); ArrayList<Integer> chanceStandard = new ArrayList<Integer>(Arrays.asList(chances)); ArrayList<Integer> chanceReusable = new ArrayList<Integer>(Arrays.asList(chances)); outputStandard.add(ItemHelper.cloneStack(ItemMorb.morbStandard)); outputReusable.add(ItemHelper.cloneStack(ItemMorb.morbReusable)); chanceStandard.add(ItemMorb.REUSE_CHANCE); chanceReusable.add(100); CentrifugeManager.addRecipeMob(energy, ItemMorb.setTag(ItemHelper.cloneStack(ItemMorb.morbStandard), this.entityId, false), outputStandard, chanceStandard, fluid); CentrifugeManager.addRecipeMob(energy, ItemMorb.setTag(ItemHelper.cloneStack(ItemMorb.morbReusable), this.entityId, false), outputReusable, chanceReusable, fluid); }
Source:
public CopyRatioState.OutlierIndicators sample(final RandomGenerator rng, final CopyRatioState state, final CopyRatioData dataCollection) { final double outlierUnnormalizedLogProbability = Math.log(state.outlierProbability()) + outlierUniformLogLikelihood; final double notOutlierUnnormalizedLogProbabilityPrefactor = Math.log(1. - state.outlierProbability()) - 0.5 * Math.log(2 * Math.PI * state.variance()); final List<Boolean> indicators = new ArrayList<>(); for (int segment = 0; segment < dataCollection.getNumSegments(); segment++) { final List<CopyRatioData.IndexedCoverage> indexedCoveragesInSegment = dataCollection.getIndexedCoveragesInSegment(segment); for (final CopyRatioData.IndexedCoverage c : indexedCoveragesInSegment) { final double notOutlierUnnormalizedLogProbability = notOutlierUnnormalizedLogProbabilityPrefactor - normalTerm(c.getCoverage(), state.segmentMean(segment), state.variance()); final double conditionalProbability = MathUtils.normalizeFromLog10(new double[]{ outlierUnnormalizedLogProbability / ln10, notOutlierUnnormalizedLogProbability / ln10})[0]; indicators.add(rng.nextDouble() < conditionalProbability); } } return new CopyRatioState.OutlierIndicators(indicators); }

Target:
public CopyRatioState.OutlierIndicators sample(final RandomGenerator rng, final CopyRatioState state, final CopyRatioData dataCollection) { final double outlierUnnormalizedLogProbability = Math.log(state.outlierProbability()) + outlierUniformLogLikelihood; final double notOutlierUnnormalizedLogProbabilityPrefactor = Math.log(1. - state.outlierProbability()) - 0.5 * Math.log(2 * Math.PI * state.variance()); final List<Boolean> indicators = new ArrayList<>(); for (int segment = 0; segment < dataCollection.getNumSegments(); segment++) { final List<CopyRatioData.IndexedCoverage> indexedCoveragesInSegment = dataCollection.getIndexedCoveragesInSegment(segment); for (final CopyRatioData.IndexedCoverage c : indexedCoveragesInSegment) { final double notOutlierUnnormalizedLogProbability = notOutlierUnnormalizedLogProbabilityPrefactor - normalTerm(c.getCoverage(), state.segmentMean(segment), state.variance()); final double conditionalProbability = MathUtils.normalizeFromLog10(new double[]{ MathUtils.logToLog10(outlierUnnormalizedLogProbability), MathUtils.logToLog10(notOutlierUnnormalizedLogProbability)})[0]; indicators.add(rng.nextDouble() < conditionalProbability); } } return new CopyRatioState.OutlierIndicators(indicators); }
Source:
protected void executeCommand() { VDSGroup vdsGroup = getVdsGroup(); boolean initSucceeded = true; if (vdsGroup.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && vdsGroup.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && vdsGroup.supportsGlusterService()) { initSucceeded = initGlusterHost(); } setSucceeded(initSucceeded); if (getSucceeded()) { AuditLogableBase logable = new AuditLogableBase(getVds().getId()); logable.addCustomValue("VdsStatus", getVds().getStatus().toString()); AuditLogDirector.log(logable, AuditLogType.VDS_DETECTED); } }

Target:
protected void executeCommand() { VDSGroup vdsGroup = getVdsGroup(); boolean initSucceeded = true; getVds().setPowerManagementControlledByPolicy(true); DbFacade.getInstance().getVdsDynamicDao().updateVdsDynamicPowerManagementPolicyFlag( getVds().getId(), getVds().isPowerManagementControlledByPolicy()); if (vdsGroup.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && vdsGroup.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && vdsGroup.supportsGlusterService()) { initSucceeded = initGlusterHost(); } setSucceeded(initSucceeded); if (getSucceeded()) { AuditLogableBase logable = new AuditLogableBase(getVds().getId()); logable.addCustomValue("HostStatus", getVds().getStatus().toString()); AuditLogDirector.log(logable, AuditLogType.VDS_DETECTED); } }
Source:
private void testGetSectionsNameForCourse() throws Exception { ______TS("Typical case: course with sections"); CourseAttributes typicalCourse1 = dataBundle.courses.get("typicalCourse1"); assertEquals(2, coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).size()); assertEquals("Section 1", coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).get(0)); assertEquals("Section 2", coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).get(1)); ______TS("Typical case: course without sections"); CourseAttributes typicalCourse2 = dataBundle.courses.get("typicalCourse2"); List<String> emptySectionNameList = new ArrayList<>(); assertEquals(emptySectionNameList, coursesLogic.getSectionsNameForCourse(typicalCourse2.getId())); ______TS("Failure case: course does not exists"); EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, () -> coursesLogic.getSectionsNameForCourse("non-existent-course")); AssertHelper.assertContains("does not exist", ednee.getMessage()); ______TS("Failure case: null parameter"); AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getSectionsNameForCourse(null)); assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); }

Target:
private void testGetSectionsNameForCourse() throws Exception { ______TS("Typical case: course with sections"); CourseAttributes typicalCourse1 = dataBundle.courses.get("typicalCourse1"); assertEquals(2, coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).size()); assertEquals("Section 1", coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).get(0)); assertEquals("Section 2", coursesLogic.getSectionsNameForCourse(typicalCourse1.getId()).get(1)); ______TS("Typical case: course without sections"); CourseAttributes typicalCourse2 = dataBundle.courses.get("typicalCourse2"); assertTrue(coursesLogic.getSectionsNameForCourse(typicalCourse2.getId()).isEmpty()); ______TS("Failure case: course does not exists"); EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, () -> coursesLogic.getSectionsNameForCourse("non-existent-course")); AssertHelper.assertContains("does not exist", ednee.getMessage()); ______TS("Failure case: null parameter"); AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getSectionsNameForCourse(null)); assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); }
Source:
void error(Throwable e) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); exceptions.add(e); complete(); }

Target:
void error(Throwable e) { exceptions.add(e); complete(); }
Source:
public TwillSpecification configure() { log.info("Configuring a Fluo instance with " + config.getOracleInstances() + " Oracle instances and " + config.getWorkerInstances() + " Worker instances with following properties:"); log.info("Max memory per oracle = " + config.getOracleMaxMemory() + " MB"); log.info("Max memory per worker = " + config.getWorkerMaxMemory() + " MB"); MoreRunnable moreRunnable = TwillSpecification.Builder.with() .setName(FLUO_APP_NAME).withRunnable(); ResourceSpecification oracleResources = ResourceSpecification.Builder.with() .setVirtualCores(1) .setMemory(config.getOracleMaxMemory(), SizeUnit.MEGA) .setInstances(config.getOracleInstances()).build(); MoreFile moreFile = moreRunnable.add(OracleRunnable.ORACLE_NAME, new OracleRunnable(), oracleResources) .withLocalFiles().add("./conf/fluo.properties", new File(String.format("%s/fluo.properties", fluoConf))); moreFile = addConfigFiles(moreFile); moreRunnable = moreFile.apply(); ResourceSpecification workerResources = ResourceSpecification.Builder.with() .setVirtualCores(1) .setMemory(config.getWorkerMaxMemory(), SizeUnit.MEGA) .setInstances(config.getWorkerInstances()).build(); moreFile = moreRunnable.add(WorkerRunnable.WORKER_NAME, new WorkerRunnable(), workerResources) .withLocalFiles().add("./conf/fluo.properties", new File(String.format("%s/fluo.properties", fluoConf))); moreFile = addConfigFiles(moreFile); return moreFile.apply().withOrder().begin(OracleRunnable.ORACLE_NAME).nextWhenStarted(WorkerRunnable.WORKER_NAME).build(); }

Target:
public TwillSpecification configure() { log.info("Configuring a Fluo instance with Oracle instances and Worker instances with following properties:", config.getOracleInstances(), config.getWorkerInstances()); log.info("{} = {}", FluoConfiguration.ORACLE_MAX_MEMORY_MB_PROP, config.getOracleMaxMemory()); log.info("{} = {}", FluoConfiguration.WORKER_MAX_MEMORY_MB_PROP, config.getWorkerMaxMemory()); log.info("{} = {}", FluoConfiguration.ORACLE_NUM_CORES_PROP, config.getOracleNumCores()); log.info("{} = {}", FluoConfiguration.WORKER_NUM_CORES_PROP, config.getWorkerNumCores()); MoreRunnable moreRunnable = TwillSpecification.Builder.with() .setName(FLUO_APP_NAME).withRunnable(); ResourceSpecification oracleResources = ResourceSpecification.Builder.with() .setVirtualCores(config.getOracleNumCores()) .setMemory(config.getOracleMaxMemory(), SizeUnit.MEGA) .setInstances(config.getOracleInstances()).build(); LocalFileAdder fileAdder = moreRunnable.add(OracleRunnable.ORACLE_NAME, new OracleRunnable(), oracleResources).withLocalFiles(); RunnableSetter runnableSetter = addConfigFiles(fileAdder).apply(); ResourceSpecification workerResources = ResourceSpecification.Builder.with() .setVirtualCores(config.getWorkerNumCores()) .setMemory(config.getWorkerMaxMemory(), SizeUnit.MEGA) .setInstances(config.getWorkerInstances()).build(); fileAdder = runnableSetter.add(WorkerRunnable.WORKER_NAME, new WorkerRunnable(), workerResources).withLocalFiles(); runnableSetter = addConfigFiles(fileAdder).apply(); return runnableSetter.withOrder().begin(OracleRunnable.ORACLE_NAME).nextWhenStarted(WorkerRunnable.WORKER_NAME).build(); }
Source:
void setPattern(Session session, Object pattern) { isNull = pattern == null; if (isNull) { return; } if (isIgnoreCase) { pattern = (String) ((CharacterType) dataType).upper(null, pattern); } iLen = 0; int l = getLength(session, pattern, ""); cLike = new char[l]; for (int i = 0; i < l; i++) { char c = getChar(pattern, i); cLike[iLen++] = c; } }

Target:
void setPattern(Session session, Object pattern) { isNull = pattern == null; if (isNull) { return; } iLen = 0; int l = getLength(session, pattern, ""); cStartsWith = new char[l]; for (int i = 0; i < l; i++) { char c = getChar(pattern, i); cStartsWith[iLen++] = c; } }
Source:
public AclClassIdUtils() { this(null); }

Target:
public AclClassIdUtils() { GenericConversionService genericConversionService = new GenericConversionService(); genericConversionService.addConverter(String.class, Long.class, new StringToLongConverter()); genericConversionService.addConverter(String.class, UUID.class, new StringToUUIDConverter()); this.conversionService = genericConversionService; }
Source:
public void multiDimensionalArraysDifferentLengthMessage() { try { assertArrayEquals("message", new Object[][]{{true, true}, {false, false}}, new Object[][]{{true, true}, {false}}); fail(); } catch (AssertionError exception) { assertEquals("message: arrays first differed at element [1]; array lengths differed, expected.length=2 actual.length=1", exception.getMessage()); } }

Target:
public void multiDimensionalArraysDifferentLengthMessage() { try { assertArrayEquals("message", new Object[][]{{true, true}, {false, false}}, new Object[][]{{true, true}, {false}}); } catch (AssertionError exception) { assertEquals("message: arrays first differed at element [1]; array lengths differed, expected.length=2 actual.length=1", exception.getMessage()); return; } fail("Expected AssertionError to be thrown"); }
Source:
private static Request parse(final InputStream input) throws IOException { final List<String> head = new LinkedList<String>(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); while (true) { final int data = input.read(); if (data < 0) { break; } if (data == '\r') { if (input.read() != '\n') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "there is no LF after CR in header, line #%d: \"%s\"", head.size() + 1, new String(baos.toByteArray()) ) ); } if (baos.size() == 0) { break; } final String header = new String(baos.toByteArray()); checkAndAddHeader(head, header); baos.reset(); continue; } if ((data > 0x7f || data < 0x20) && data != '\t') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "illegal character 0x%02X in HTTP header line #%d: \"%s\"", data, head.size() + 1, new String(baos.toByteArray()) ) ); } baos.write(data); } return new Request() { @Override public Iterable<String> head() { return head; } @Override public InputStream body() { return input; } }; }

Target:
private static Request parse(final InputStream input) throws IOException { final List<String> head = new LinkedList<String>(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Opt<Integer> data = new Opt.Empty<Integer>(); while (true) { data = data(input, data); if (data.get() < 0) { break; } if (data.get() == '\r') { if (input.read() != '\n') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "there is no LF after CR in header, line #%d: \"%s\"", head.size() + 1, new String(baos.toByteArray()) ) ); } if (baos.size() == 0) { break; } data = new Opt.Single<Integer>(input.read()); if (data.get() != ' ' && data.get() != '\t') { head.add(new String(baos.toByteArray())); baos.reset(); } continue; } if ((data.get() > 0x7f || data.get() < 0x20) && data.get() != '\t') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "illegal character 0x%02X in HTTP header line #%d: \"%s\"", data.get(), head.size() + 1, new String(baos.toByteArray()) ) ); } baos.write(data.get()); data = new Opt.Empty<Integer>(); } return new Request() { @Override public Iterable<String> head() { return head; } @Override public InputStream body() { return input; } }; }