auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void fullExample() { StringBuilder text = new StringBuilder(); text.append("Header 1\n"); text.append("-------\n"); text.append("\n"); text.append("Lorem ipsum *dolor* sit amet, \n"); text.append("\n"); text.append("=== Header 2\n"); text.append("\n"); text.append("consetetur _adipisici_ elit.\n"); String html = parseToHtml(text.toString()); assertTrue(html.contains("Header 1</h2>")); assertTrue(html.contains("<p>Lorem ipsum")); assertTrue(html.contains("<strong>dolor")); assertTrue(html.contains("Header 2</h3>")); assertTrue(html.contains("<em>adipisici</em>")); }

Target:
public void fullExample() { StringBuilder text = new StringBuilder(); text.append("Header 2\n"); text.append("-------\n"); text.append("\n"); text.append("Lorem ipsum *dolor* sit amet, \n"); text.append("\n"); text.append("=== Header 3\n"); text.append("\n"); text.append("consetetur _adipisici_ elit.\n"); String html = parseToHtml(text.toString()); assertEquals( "<h2>Header 2</h2><p>Lorem ipsum <strong>dolor</strong> sit amet, </p>\n" + "<h3>Header 3</h3><p>consetetur <em>adipisici</em> elit.</p>\n" , html); }
Source:
public static @Nullable Map<Integer, TraceCompassFilter> getFilterForTrace(ITmfTrace trace) { Map<Integer, TraceCompassFilter> map = FILTERS_MAP.get(trace); if (map == null) { return Collections.emptyMap(); } return map; }

Target:
public static @Nullable Map<Integer, TraceCompassFilter> getFilterForTrace(ITmfTrace trace) { return FILTERS_MAP.getOrDefault(trace, Collections.emptyMap()); }
Source:
public void visitToken(DetailAST ast) { defined = true; if (!ignoreMismatch) { final String fileName = getFileContents().getFileName(); final int lastPos = fileName.lastIndexOf(File.separatorChar); final String directoryName = fileName.substring(0, lastPos); final DetailAST nameAST = ast.getLastChild().getPreviousSibling(); final FullIdent full = FullIdent.createFullIdent(nameAST); final String expected = full.getText().replace('.', File.separatorChar); if (!directoryName.endsWith(expected)) { log(full.getLineNo(), MSG_KEY_MISMATCH, expected); } } }

Target:
public void visitToken(DetailAST ast) { defined = true; if (matchDirectoryStructure) { final DetailAST packageNameAst = ast.getLastChild().getPreviousSibling(); final FullIdent fullIdent = FullIdent.createFullIdent(packageNameAst); final String packageName = fullIdent.getText().replace('.', File.separatorChar); final String directoryName = getDirectoryName(); if (!directoryName.endsWith(packageName)) { log(fullIdent.getLineNo(), MSG_KEY_MISMATCH, packageName); } } }
Source:
private static String getCredential(String username, String password) { if (username == null || password == null) { return null; } else { return okhttp3.Credentials.basic(buildDomainUser(username), buildAppPassword(password)); } }

Target:
private static String getCredential(String username, String password) { if (username == null || password == null) { return null; } else { return Credentials.basic(username, buildAppPassword(password)); } }
Source:
private void doInit(ExtMap inputMap, ExtMap outputMap) { context = inputMap.<ExtMap> get(Base.InvokeKeys.CONTEXT); configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); Config.setConfiguration((Properties) configuration.get("config")); broker = LdapFactory.getInstance(getAuthzName()); context.<List<String>> get( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ).add("config.authn.user.password"); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project").mput( Base.ContextKeys.EXTENSION_NAME, "Kerberos/Ldap Authn (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authn.ContextKeys.CAPABILITIES, Authn.Capabilities.AUTHENTICATE_PASSWORD ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT); KerberosManager.getInstance(); UsersDomainsCacheManagerService.getInstance().init(); }

Target:
private void doInit(ExtMap inputMap, ExtMap outputMap) { context = inputMap.<ExtMap> get(Base.InvokeKeys.CONTEXT); configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); broker = LdapFactory.getInstance(getAuthzName()); context.<List<String>> get( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ).add("config.authn.user.password"); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project").mput( Base.ContextKeys.EXTENSION_NAME, "Kerberos/Ldap Authn (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authn.ContextKeys.CAPABILITIES, Authn.Capabilities.AUTHENTICATE_PASSWORD ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT); KerberosManager.getInstance(configuration); UsersDomainsCacheManagerService.getInstance().init(configuration); }
Source:
public void questionableMatchFails() { TimeLimitedMatcher.create(Pattern.compile("(a+)+"), StringUtils.repeat("a", 1000) + "!"); }

Target:
public void questionableMatchFails() throws Exception { TimeLimitedMatcher.create(Pattern.compile("(a+)+"), StringUtils.repeat("a", 1000) + "!"); }
Source:
protected Set<E> parseData(Parser<E> parser, URL url, Bundle bundle) { InputStreamReader reader = null; InputStream is = null; try { is = url.openStream(); reader = new InputStreamReader(is, "UTF-8"); return parser.parse(reader); } catch (ParsingException e) { logger.error(e.getLocalizedMessage(), e); } catch (IOException e) { logger.error("Can't read from resource of bundle with ID {}", bundle.getBundleId(), e); processAutomationProviderUninstalled(bundle); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignore) { } } if (is != null) { try { is.close(); } catch (IOException ignore) { } } } return null; }

Target:
protected Set<E> parseData(Parser<E> parser, URL url, Bundle bundle) { InputStreamReader reader = null; InputStream is = null; try { is = url.openStream(); reader = new InputStreamReader(is, StandardCharsets.UTF_8); return parser.parse(reader); } catch (ParsingException e) { logger.error(e.getLocalizedMessage(), e); } catch (IOException e) { logger.error("Can't read from resource of bundle with ID {}", bundle.getBundleId(), e); processAutomationProviderUninstalled(bundle); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignore) { } } if (is != null) { try { is.close(); } catch (IOException ignore) { } } } return null; }
Source:
private int index(Iterator<Item> iterator) throws DSpaceSolrIndexerException { try { int i = 0; int batchSize = configurationService.getIntProperty("oai.import.batch.size", 1000); SolrServer server = solrServerResolver.getServer(); ArrayList<SolrInputDocument> list = new ArrayList<>(); while (iterator.hasNext()) { try { Item item = iterator.next(); if (item.getHandle() == null) { log.warn("Skipped item without handle: " + item.getID()); } else { list.add(this.index(item)); } context.uncacheEntity(item); } catch (SQLException | MetadataBindException | ParseException | XMLStreamException | WritingXmlException ex) { log.error(ex.getMessage(), ex); } i++; if (i % 1000 == 0) { System.out.println(i + " items imported so far..."); } if (i % batchSize == 0) { System.out.println(i + " items imported so far..."); server.add(list); server.commit(); list.clear(); } } System.out.println("Total: " + i + " items"); server.add(list); server.commit(true, true); list.clear(); return i; } catch (SolrServerException | IOException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } }

Target:
private int index(Iterator<Item> iterator) throws DSpaceSolrIndexerException { try { int i = 0; int batchSize = configurationService.getIntProperty("oai.import.batch.size", 1000); SolrServer server = solrServerResolver.getServer(); ArrayList<SolrInputDocument> list = new ArrayList<>(); while (iterator.hasNext()) { try { Item item = iterator.next(); if (item.getHandle() == null) { log.warn("Skipped item without handle: " + item.getID()); } else { list.add(this.index(item)); } context.uncacheEntity(item); } catch (SQLException | MetadataBindException | ParseException | XMLStreamException | WritingXmlException ex) { log.error(ex.getMessage(), ex); } i++; if (i % 1000 == 0 && batchSize != 1000) { System.out.println(i + " items imported so far..."); } if (i % batchSize == 0) { System.out.println(i + " items imported so far..."); server.add(list); server.commit(); list.clear(); } } System.out.println("Total: " + i + " items"); server.add(list); server.commit(true, true); list.clear(); return i; } catch (SolrServerException | IOException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } }
Source:
private static boolean isTable(TagNode node) { return "TABLE".equalsIgnoreCase(node.getLocalName()); }

Target:
private static boolean isTable(TagNode node) { return "TABLE".equalsIgnoreCase(node.getNodeName()); }
Source:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometrySerializationType geometryType = GeometrySerializationType.getForEsriGeometryType(geometry.geometryType()); if (geometryType == POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } Point centroid; switch (geometryType) { case MULTI_POINT: centroid = computePointsCentroid((MultiVertexGeometry) geometry.getEsriGeometry()); break; case LINE_STRING: case MULTI_LINE_STRING: centroid = computeLineCentroid((Polyline) geometry.getEsriGeometry()); break; case POLYGON: centroid = computePolygonCentroid((Polygon) geometry.getEsriGeometry()); break; case MULTI_POLYGON: centroid = computeMultiPolygonCentroid((OGCMultiPolygon) geometry); break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Unexpected geometry type: " + geometryType); } return serialize(createFromEsriGeometry(centroid, geometry.getEsriSpatialReference())); }

Target:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometryType geometryType = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (geometryType == GeometryType.POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } Point centroid; switch (geometryType) { case MULTI_POINT: centroid = computePointsCentroid((MultiVertexGeometry) geometry.getEsriGeometry()); break; case LINE_STRING: case MULTI_LINE_STRING: centroid = computeLineCentroid((Polyline) geometry.getEsriGeometry()); break; case POLYGON: centroid = computePolygonCentroid((Polygon) geometry.getEsriGeometry()); break; case MULTI_POLYGON: centroid = computeMultiPolygonCentroid((OGCMultiPolygon) geometry); break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Unexpected geometry type: " + geometryType); } return serialize(createFromEsriGeometry(centroid, geometry.getEsriSpatialReference())); }
Source:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null && getVm().getStatus() != VMStatus.Down) { HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId()); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { AuditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } }

Target:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null && getVm().getStatus() != VMStatus.Down) { HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId()); params.setShouldBeLogged(false); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { AuditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } }
Source:
public boolean equals(Object obj) { return (this == obj) || (obj instanceof ErrorMessage) && equalTo((ErrorMessage) obj); }

Target:
public boolean equals(Object obj) { return (this == obj) || (obj instanceof NotifiedMessage) && equalTo((NotifiedMessage) obj); }
Source:
public Builder(HttpResponse response) { this(response.getStatusCode(), response.getStatusMessage(), response.getHeaders()); try { content = response.parseAsString(); if (content.length() == 0) { content = null; } } catch (IOException exception) { exception.printStackTrace(); } catch (IllegalCharsetNameException exception) { exception.printStackTrace(); } StringBuilder builder = computeMessageBuffer(response); if (content != null) { builder.append(StringUtils.LINE_SEPARATOR).append(content); } message = builder.toString(); }

Target:
public Builder(HttpResponse response) { this(response.getStatusCode(), response.getStatusMessage(), response.getHeaders()); try { content = response.parseAsString(); if (content.length() == 0) { content = null; } } catch (IOException exception) { exception.printStackTrace(); } catch (IllegalArgumentException exception) { exception.printStackTrace(); } StringBuilder builder = computeMessageBuffer(response); if (content != null) { builder.append(StringUtils.LINE_SEPARATOR).append(content); } message = builder.toString(); }
Source:
public NotAnOutputTypeError(TypeDefinition typeDefinition) { super(typeDefinition, format("The %s type is used as an OutputType, but is not declared as one", typeDefinition.getName())); }

Target:
public NotAnOutputTypeError(TypeDefinition typeDefinition) { super(typeDefinition, format("expected OutputType, but found %s type", typeDefinition.getName())); }
Source:
public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { super.eventRaised(ev, sender, args); if (ev.matchesDefinition(RegistrationResult.RetrievedEventDefinition)) { asyncResult_Retrieved(); } if (ev.matchesDefinition(ProvideTickEvent.definition)) { syncSearch(); } entityModel.eventRaised(ev, sender, args); }

Target:
public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { super.eventRaised(ev, sender, args); entityModel.eventRaised(ev, sender, args); if (ev.matchesDefinition(RegistrationResult.RetrievedEventDefinition)) { asyncResult_Retrieved(); } if (ev.matchesDefinition(ProvideTickEvent.definition)) { syncSearch(); } }
Source:
public ModelAndView newServiceRecord(@PathVariable(value = "sequencerReferenceId") Long sequencerReferenceId, ModelMap model) throws IOException { SequencerReference sequencer = requestManager.getSequencerReferenceById(sequencerReferenceId); if (sequencer == null) { throw new IOException("Cannot retrieve the requested Sequencer Reference"); } SequencerServiceRecord record = dataObjectFactory.getSequencerServiceRecord(); record.setSequencerReference(sequencer); model.put("serviceRecord", record); return new ModelAndView("/pages/editServiceRecord.jsp", model); }

Target:
public ModelAndView newServiceRecord(@PathVariable(value = "sequencerReferenceId") Long sequencerReferenceId, ModelMap model) throws IOException { SequencerReference sequencer = requestManager.getSequencerReferenceById(sequencerReferenceId); if (sequencer == null) { throw new IOException("No such Sequencer Reference"); } SequencerServiceRecord record = dataObjectFactory.getSequencerServiceRecord(); record.setSequencerReference(sequencer); model.put(ModelKeys.RECORD.getKey(), record); return new ModelAndView("/pages/editServiceRecord.jsp", model); }
Source:
public static ProcessInstanceCustomVarsList convertToProcessInstanceCustomVarsList(Collection<ProcessInstanceCustomDesc> instances) { if (instances == null) { return new ProcessInstanceCustomVarsList(new org.kie.server.api.model.instance.ProcessInstanceCustomVars[0]); } List<ProcessInstanceCustomVars> processInstances = new ArrayList<ProcessInstanceCustomVars>(instances.size()); for (ProcessInstanceCustomDesc pi : instances) { org.kie.server.api.model.instance.ProcessInstanceCustomVars instance = convertToProcessInstanceCustomVars(pi); instance.setVariables(pi.getVariables()); processInstances.add(instance); } return new ProcessInstanceCustomVarsList(processInstances); }

Target:
public static ProcessInstanceCustomVarsList convertToProcessInstanceCustomVarsList(Collection<ProcessInstanceCustomDesc> instances) { if (instances == null) { return new ProcessInstanceCustomVarsList(new org.kie.server.api.model.instance.ProcessInstanceCustomVars[0]); } List<ProcessInstanceCustomVars> processInstances = new ArrayList<ProcessInstanceCustomVars>(instances.size()); for (ProcessInstanceCustomDesc pi : instances) { org.kie.server.api.model.instance.ProcessInstanceCustomVars instance = convertToProcessInstanceCustomVars(pi); processInstances.add(instance); } return new ProcessInstanceCustomVarsList(processInstances); }
Source:
public MetadataSchema[] getSchemas(@QueryParam("expand") @DefaultValue("fields") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading all metadata schemas."); org.dspace.core.Context context = null; ArrayList<MetadataSchema> metadataSchemas = null; try { context = createContext(getUser(headers)); List<org.dspace.content.MetadataSchema> schemas = metadataSchemaService.findAll(context); metadataSchemas = new ArrayList<MetadataSchema>(); for(org.dspace.content.MetadataSchema schema: schemas) { metadataSchemas.add(new MetadataSchema(schema, expand, context)); } context.complete(); } catch (SQLException e) { processException("Could not read metadata schemas, SQLException. Message:" + e, context); log.error(e.getMessage()); throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } catch (ContextException e) { processException("Could not read metadata schemas, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("All metadata schemas successfully read."); return metadataSchemas.toArray(new MetadataSchema[0]); }

Target:
public MetadataSchema[] getSchemas(@QueryParam("expand") @DefaultValue("fields") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading all metadata schemas."); org.dspace.core.Context context = null; ArrayList<MetadataSchema> metadataSchemas = null; try { context = createContext(getUser(headers)); List<org.dspace.content.MetadataSchema> schemas = metadataSchemaService.findAll(context); metadataSchemas = new ArrayList<MetadataSchema>(); for(org.dspace.content.MetadataSchema schema: schemas) { metadataSchemas.add(new MetadataSchema(schema, expand, context)); } context.complete(); } catch (SQLException e) { processException("Could not read metadata schemas, SQLException. Message:" + e, context); } catch (ContextException e) { processException("Could not read metadata schemas, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("All metadata schemas successfully read."); return metadataSchemas.toArray(new MetadataSchema[0]); }
Source:
private void handleNoInternet() { if (null != getView()) { if (null != progressBar) { progressBar.setVisibility(GONE); } ViewUtil.showShortSnackbar(imagesRecyclerView, R.string.no_internet); } else { Timber.d(TAG + ": attempt to update fragment ui after its view was destroyed"); } }

Target:
private void handleNoInternet() { if (null != getView()) { if (null != progressBar) { progressBar.setVisibility(GONE); } ViewUtil.showShortSnackbar(imagesRecyclerView, R.string.no_internet); } else { Timber.d("Attempt to update fragment ui after its view was destroyed"); } }
Source:
public static void main(String[] args) { System.loadLibrary(args[0]); System.out.println("Startup completed: " + hasStartupCompleted()); Thread workerThread = new WorkerThread(); workerThread.start(); do { resetStartupCompleted(); VMRuntime.getRuntime().notifyStartupCompleted(); } while (!completed.get()); try { workerThread.join(); } catch (Throwable e) { System.err.println(e); } System.out.println("Startup completed: " + hasStartupCompleted()); }

Target:
public static void main(String[] args) { System.loadLibrary(args[0]); System.out.println("Startup completed: " + hasStartupCompleted()); Thread workerThread = new WorkerThread(); workerThread.start(); do { resetStartupCompleted(); VMRuntime.getRuntime().notifyStartupCompleted(); Thread.yield(); } while (!completed.get()); try { workerThread.join(); } catch (Throwable e) { System.err.println(e); } System.out.println("Startup completed: " + hasStartupCompleted()); }
Source:
protected void updateModelDataCenterFromVds(ArrayList<StoragePool> dataCenters, VDS vds) { if (dataCenters != null && vds.getStoragePoolId() != null) { getDataCenter().setItems(dataCenters); getDataCenter().setSelectedItem(Linq.firstOrDefault(dataCenters, new Linq.DataCenterPredicate(vds.getStoragePoolId()))); if (getDataCenter().getSelectedItem() == null) { getDataCenter().setSelectedItem(Linq.firstOrDefault(dataCenters)); } } }

Target:
protected void updateModelDataCenterFromVds(ArrayList<StoragePool> dataCenters, VDS vds) { if (dataCenters != null) { getDataCenter().setItems(dataCenters); getDataCenter().setSelectedItem(Linq.firstOrDefault(dataCenters, new Linq.DataCenterPredicate(vds.getStoragePoolId()))); if (getDataCenter().getSelectedItem() == null) { getDataCenter().setSelectedItem(Linq.firstOrDefault(dataCenters)); } } }
Source:
public String format(LocalDate value) { if (value == null) return "NULL"; return "'" + ISO_LOCAL_DATE.format(value) + "'"; }

Target:
public String format(LocalDate value) { if (value == null) return "NULL"; return quote(ISO_LOCAL_DATE.format(value)); }
Source:
private synchronized void createResults() { if (d_results.getNumberOfSamples() < 2) return; d_quantiles = new double[3]; d_quantiles[1] = RANDOM.nextDouble() * 4 - 2; d_quantiles[2] = d_quantiles[1] + RANDOM.nextDouble() * 1.5; d_quantiles[0] = d_quantiles[2] - d_quantiles[1]; d_defined = true; firePropertyChange(PROPERTY_DEFINED, null, d_defined); }

Target:
private synchronized void createResults() { if (d_results.getNumberOfSamples() < 2) return; d_quantiles = new double[3]; d_quantiles[1] = RANDOM.nextDouble() * 4 - 2; d_quantiles[2] = d_quantiles[1] + RANDOM.nextDouble() * 1.5; d_quantiles[0] = d_quantiles[1] - (d_quantiles[2] - d_quantiles[1]); d_defined = true; firePropertyChange(PROPERTY_DEFINED, null, d_defined); }
Source:
public void onCacheEvent(CacheEntryEvent<byte[], byte[]> event) { if (isSendEvent(event)) { long version; Metadata metadata; if ((metadata = event.getMetadata()) != null && metadata.version() != null) { version = ((NumericVersion) metadata.version()).getVersion(); } else { version = 0; } Object k = event.getKey(); Object v = event.getValue(); if (keyDataConversion.isStorageFormatFilterable() && k != null) { k = keyDataConversion.fromStorage(k); } if (valueDataConversion.isStorageFormatFilterable() && v != null) { v = valueDataConversion.fromStorage(v); } sendEvent((byte[]) k, (byte[]) v, version, event); } }

Target:
public void onCacheEvent(CacheEntryEvent<byte[], byte[]> event) { if (isSendEvent(event)) { long version; Metadata metadata; if ((metadata = event.getMetadata()) != null && metadata.version() != null) { version = ((NumericVersion) metadata.version()).getVersion(); } else { version = 0; } Object k = event.getKey(); Object v = event.getValue(); if (keyDataConversion.isStorageFormatFilterable()) { k = keyDataConversion.fromStorage(k); } if (valueDataConversion.isStorageFormatFilterable()) { v = valueDataConversion.fromStorage(v); } sendEvent((byte[]) k, (byte[]) v, version, event); } }
Source:
public Tuple<Integer, String> getBonusType() { return bonusType; }

Target:
public BonusType getBonusType() { return bonusType; }
Source:
private AutoCompletionCandidates doAutoCompleteBranchesSpec(final Job<?, ?> job, @QueryParameter final String value) { String query = value.toLowerCase(); final AutoCompletionCandidates ac = new AutoCompletionCandidates(); List<String> values = ac.getValues(); try { List<String> branches = this.getProjectBranches(job); if (query.length() < 2){ values.addAll(branches); } else { for (String branch : branches){ if (branch.toLowerCase().indexOf(query) > -1){ values.add(branch); } } } } catch (final IllegalStateException ex) { LOGGER.log(Level.FINEST, "Ka-Boom!", ex); } catch (final IOException ex) { LOGGER.log(Level.FINEST, "Ka-Boom!", ex); } return ac; }

Target:
private AutoCompletionCandidates doAutoCompleteBranchesSpec(final Job<?, ?> job, @QueryParameter final String value) { String query = value.toLowerCase(); final AutoCompletionCandidates ac = new AutoCompletionCandidates(); List<String> values = ac.getValues(); try { List<String> branches = this.getProjectBranches(job); if (query.length() < 2){ values.addAll(branches); } else { for (String branch : branches){ if (branch.toLowerCase().indexOf(query) > -1){ values.add(branch); } } } } catch (final IllegalStateException ex) { LOGGER.log(Level.FINEST, "Unexpected IllegalStateException. Please check the logs and your configuration.", ex); } catch (final IOException ex) { LOGGER.log(Level.FINEST, "Unexpected IllegalStateException. Please check the logs and your configuration.", ex); } return ac; }
Source:
public static UdpOutboundChannelAdapterSpec outboundAdapter(String destinationExpression) { return new UdpOutboundChannelAdapterSpec(destinationExpression); }

Target:
public static UdpUnicastOutboundChannelAdapterSpec outboundAdapter(String destinationExpression) { return new UdpUnicastOutboundChannelAdapterSpec(destinationExpression); }
Source:
private boolean shouldRunControl(ResultSetNode resultSet) throws StandardException { DataSetProcessorType type = getCompilerContext().getDataSetProcessorType(); if (type.isForced()) { return (!type.isSpark()); } resultSet.getFromList().verifyProperties(getDataDictionary()); CollectNodesVisitor cnv = new CollectNodesVisitor(FromTable.class); resultSet.accept(cnv); for (Object obj : cnv.getList()) { type = type.combine(((FromTable) obj).getDataSetProcessorType()); } getCompilerContext().setDataSetProcessorType(type); return !type.isSpark(); }

Target:
private boolean shouldRunControl(ResultSetNode resultSet) throws StandardException { DataSetProcessorType type = getCompilerContext().getDataSetProcessorType(); if (type.isForced()) { return (!type.isSpark()); } CollectNodesVisitor cnv = new CollectNodesVisitor(FromTable.class); resultSet.accept(cnv); for (Object obj : cnv.getList()) { FromTable ft = (FromTable) obj; ft.verifyProperties(getDataDictionary()); type = type.combine(ft.getDataSetProcessorType()); } getCompilerContext().setDataSetProcessorType(type); return !type.isSpark(); }
Source:
private int writeBatch(final OutputStream outputStream, final Partition.PartitionKey partitionKey, final long offset, final List<byte[]> events, final Optional<String> metadata) throws IOException { final Timeline timeline = getContext().getTimelinesForTopics().get(partitionKey.getTopic()); final String token = getContext().getCursorTokenService().generateToken(); final SubscriptionCursor cursor = getContext().getCursorConverter().convert( partitionKey.createKafkaCursor(offset).toNakadiCursor(timeline), token); final String cursorSerialized = getContext().getObjectMapper().writeValueAsString(cursor); final CountingOutputStream countingOutputStream = new CountingOutputStream(outputStream) { @Override public void flush() throws IOException { } }; final Writer writer = new OutputStreamWriter(countingOutputStream); writer.write("{\"cursor\":"); writer.write(cursorSerialized); if (!events.isEmpty()) { writer.write(",\"events\":["); writer.flush(); boolean first = true; for (final byte[] event : events) { if (!first) { countingOutputStream.write(','); } countingOutputStream.write(event); first = false; } countingOutputStream.write(']'); } if (metadata.isPresent()) { writer.write(",\"info\":{\"debug\":\""); writer.write(metadata.get()); writer.write("\"}"); writer.flush(); } writer.append("}").append(EventStream.BATCH_SEPARATOR); writer.flush(); outputStream.flush(); return countingOutputStream.getCount(); }

Target:
private int writeBatch(final OutputStream outputStream, final Partition.PartitionKey partitionKey, final long offset, final List<byte[]> events, final Optional<String> metadata) throws IOException { final Timeline timeline = getContext().getTimelinesForTopics().get(partitionKey.getTopic()); final String token = getContext().getCursorTokenService().generateToken(); final SubscriptionCursor cursor = getContext().getCursorConverter().convert( partitionKey.createKafkaCursor(offset).toNakadiCursor(timeline), token); final String cursorSerialized = getContext().getObjectMapper().writeValueAsString(cursor); final CountingOutputStream countingOutputStream = new CountingOutputStream(outputStream) { @Override public void flush() throws IOException { } }; final Writer writer = new OutputStreamWriter(countingOutputStream, UTF_8); writer.write("{\"cursor\":"); writer.write(cursorSerialized); if (!events.isEmpty()) { writer.write(",\"events\":["); writer.flush(); boolean first = true; for (final byte[] event : events) { if (!first) { countingOutputStream.write(','); } countingOutputStream.write(event); first = false; } countingOutputStream.write(']'); } if (metadata.isPresent()) { writer.write(",\"info\":{\"debug\":\""); writer.write(metadata.get()); writer.write("\"}"); writer.flush(); } writer.append("}").append(EventStream.BATCH_SEPARATOR); writer.flush(); outputStream.flush(); return countingOutputStream.getCount(); }
Source:
public boolean setAndValidateQuota() { if (Guid.isNullOrEmpty(getDestinationQuotaId())) { Guid quotaId = getQuotaManager().getFirstQuotaForUser( getImage().getQuotaId(), getStoragePoolId(), getCurrentUser() ); getParameters().setQuotaId(quotaId); } QuotaValidator validator = createQuotaValidator(getDestinationQuotaId()); return validate(validator.isValid()) && validate(validator.isDefinedForStorageDomain(getParameters().getStorageDomainId())); }

Target:
public boolean setAndValidateQuota() { if (Guid.isNullOrEmpty(getDestinationQuotaId())) { Guid quotaId = getQuotaManager().getDefaultQuotaIfNull( getImage().getQuotaId(), getStoragePoolId() ); getParameters().setQuotaId(quotaId); } QuotaValidator validator = createQuotaValidator(getDestinationQuotaId()); return validate(validator.isValid()) && validate(validator.isDefinedForStorageDomain(getParameters().getStorageDomainId())); }
Source:
private void handleTagDeleted(ContentTagDeletedEvent evt) { if (evt.getDeletedTagInfo() == null) { LOGGER.log(Level.SEVERE, "ContentTagDeletedEvent did not have valid content to provide a content id."); return; } try { Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(evt.getDeletedTagInfo().getContentID()); if (content == null) { LOGGER.log(Level.WARNING, String.format("Unable to get content for item with content id: %d.", evt.getDeletedTagInfo().getContentID())); return; } handleTagChange(content); } catch (NoCurrentCaseException | TskCoreException ex) { Long contentID = (evt != null && evt.getDeletedTagInfo() != null) ? evt.getDeletedTagInfo().getContentID() : null; LOGGER.log(Level.WARNING, "Error updating non-file object: " + contentID, ex); } }

Target:
private void handleTagDeleted(ContentTagDeletedEvent evt) { if (evt.getDeletedTagInfo() == null) { LOGGER.log(Level.SEVERE, "ContentTagDeletedEvent did not have valid content to provide a content id."); return; } try { Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(evt.getDeletedTagInfo().getContentID()); if (content == null) { LOGGER.log(Level.WARNING, String.format("Unable to get content for item with content id: %d.", evt.getDeletedTagInfo().getContentID())); return; } handleTagChange(content); } catch (NoCurrentCaseException | TskCoreException ex) { LOGGER.log(Level.WARNING, "Error updating non-file object: " + evt.getDeletedTagInfo().getContentID(), ex); } }
Source:
private void checkAuthorization(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { if (isAuthorized(request)) { chain.doFilter(request, response); } else { LOG.warn("CapAssetInventoryApi unauthorized " + request.getMethod() + " " + request.getPathInfo()); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.getWriter().println(new Gson().toJson(CuCamsConstants.CapAssetApi.UNAUTHORIZED)); } }

Target:
private void checkAuthorization(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { if (isAuthorized(request)) { chain.doFilter(request, response); } else { LOG.warn("CapAssetInventoryApi checkAuthorization unauthorized " + request.getMethod() + " " + request.getPathInfo()); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.getWriter().println(new Gson().toJson(CuCamsConstants.CapAssetApi.UNAUTHORIZED)); } }
Source:
Object[][] TrueFalse() { return new Object[][]{ new Object[]{true}, new Object[]{false}, }; }

Target:
Object[][] TrueFalse() { return new Object[][]{ {true}, {false}, }; }
Source:
private UrlSelectorImpl( ImmutableList<HttpUrl> baseUrls, boolean reshuffle, Duration failedUrlCooldown, Clock clock) { Preconditions.checkArgument(!baseUrls.isEmpty(), "Must specify at least one URL"); Preconditions.checkArgument(!failedUrlCooldown.isNegative(), "Cache expiration must be non-negative"); if (reshuffle) { Duration jitter = Duration.ofSeconds(ThreadLocalRandom.current().nextLong(-30, 30)); this.baseUrls = Suppliers.memoizeWithExpiration( () -> shuffle(baseUrls), RANDOMIZE.plus(jitter).toMillis(), TimeUnit.MILLISECONDS); } else { this.baseUrls = () -> baseUrls; } this.lastBaseUrl = new AtomicReference<>(baseUrls.get(0)); this.clock = clock; this.failedUrls = Caffeine.newBuilder() .executor(MoreExecutors.directExecutor()) .maximumSize(baseUrls.size()) .build(key -> clock.instant().plus(failedUrlCooldown)); this.useFailedUrlCache = !failedUrlCooldown.isNegative() && !failedUrlCooldown.isZero(); }

Target:
private UrlSelectorImpl( ImmutableList<HttpUrl> baseUrls, boolean reshuffle, Duration failedUrlCooldown, Clock clock) { Preconditions.checkArgument(!baseUrls.isEmpty(), "Must specify at least one URL"); Preconditions.checkArgument(!failedUrlCooldown.isNegative(), "Cache expiration must be non-negative"); if (reshuffle) { Duration jitter = Duration.ofSeconds(ThreadLocalRandom.current().nextLong(-30, 30)); this.baseUrls = Suppliers.memoizeWithExpiration( () -> shuffle(baseUrls), RANDOMIZE.plus(jitter).toMillis(), TimeUnit.MILLISECONDS); } else { this.baseUrls = () -> baseUrls; } this.lastBaseUrl = new AtomicReference<>(baseUrls.get(0)); this.clock = clock; this.failedUrlCooldown = failedUrlCooldown; this.failedUrls = new ConcurrentHashMap<>(baseUrls.size()); this.useFailedUrlCache = !failedUrlCooldown.isNegative() && !failedUrlCooldown.isZero(); }
Source:
public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } else { previous = now; } logPoolState("Before cleanup "); final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); for (PoolBagEntry bagEntry : bag) { if (removable <= 0) { break; } if (connectionBag.reserve(bagEntry)) { if (idleTimeout > 0L && clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } else { connectionBag.unreserve(bagEntry); } } } logPoolState("After cleanup "); fillPool(); }

Target:
public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } previous = now; logPoolState("Before cleanup\t"); final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); for (PoolBagEntry bagEntry : bag) { if (removable > 0 && idleTimeout > 0L && clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { if (connectionBag.reserve(bagEntry)) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } } } logPoolState("After cleanup\t"); fillPool(); }
Source:
public void reset_shouldCleanupTempDirectories() { ShadowEnvironment.getExternalStorageDirectory(); ShadowEnvironment.getExternalStoragePublicDirectory(null); File c = ShadowEnvironment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); ShadowEnvironment.reset(); assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); assertThat(c).doesNotExist(); }

Target:
public void reset_shouldCleanupTempDirectories() { Environment.getExternalStorageDirectory(); Environment.getExternalStoragePublicDirectory(null); File c = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); ShadowEnvironment.reset(); assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); assertThat(c).doesNotExist(); }
Source:
public void run(BrowserCommandWithAppRunner command) { try { this.app.start(); command.login(login()) .andThen((app, driver, wait) -> LOGGER.info("Test ===> {}.{}() has finished running.", Thread.currentThread().getStackTrace()[6].getClassName(), Thread.currentThread().getStackTrace()[6].getMethodName())) .run(this.app, this.driver, this.wait); } catch (Exception e) { throw new RuntimeException(e); } finally { if (this.driver != null) { this.driver.quit(); } if (this.app != null) { this.app.close(); } } }

Target:
public void run(BrowserCommandWithAppRunner command) { try { this.app.start(); command.login((app, driver) -> { WebDriverWait wait = new WebDriverWait(this.driver, 10); driver.get(app.root() + "oauth2/authorization/azure"); wait.until(presenceOfElementLocated(By.name("loginfmt"))) .sendKeys(this.username + Keys.ENTER); Thread.sleep(10000); driver.findElement(By.name("passwd")) .sendKeys(this.password + Keys.ENTER); Thread.sleep(10000); driver.findElement(By.cssSelector("input[type='submit']")).click(); Thread.sleep(10000); }).run(this.app, this.driver); } catch (Exception e) { throw new RuntimeException(e); } finally { if (this.driver != null) { this.driver.quit(); } if (this.app != null) { this.app.close(); } } }
Source:
public JobIdData submitFromUrl(@HeaderParam("sessionid") String sessionId, @HeaderParam("link") String url, @PathParam("path") PathSegment pathSegment, @Context UriInfo contextInfos) throws JobCreationRestException, NotConnectedRestException, PermissionRestException, SubmissionClosedRestException, IOException { Scheduler s = checkAccess(sessionId, "jobs"); File tmpWorkflowFile = null; try { String jobXml = downloadWorkflowContent(sessionId, url); tmpWorkflowFile = File.createTempFile("job", "d"); JobId jobId; try (OutputStream outputStream = new FileOutputStream(tmpWorkflowFile)) { IOUtils.write(jobXml, outputStream, Charset.forName(FILE_ENCODING)); WorkflowSubmitter workflowSubmitter = new WorkflowSubmitter(s); Map genericInfos = null; if (contextInfos != null) genericInfos = getMapWithFirstValues(contextInfos.getQueryParameters()); jobId = workflowSubmitter.submit(tmpWorkflowFile, workflowVariablesTransformer.getWorkflowVariablesFromPathSegment(pathSegment), genericInfos); } return mapper.map(jobId, JobIdData.class); } catch (IOException e) { throw new IOException("Cannot save temporary job file on submission: " + e.getMessage(), e); } finally { FileUtils.deleteQuietly(tmpWorkflowFile); } }

Target:
public JobIdData submitFromUrl(@HeaderParam("sessionid") String sessionId, @HeaderParam("link") String url, @PathParam("path") PathSegment pathSegment, @Context UriInfo contextInfos) throws JobCreationRestException, NotConnectedRestException, PermissionRestException, SubmissionClosedRestException, IOException { Scheduler s = checkAccess(sessionId, "jobs"); File tmpWorkflowFile = null; try { String jobXml = downloadWorkflowContent(sessionId, url); tmpWorkflowFile = File.createTempFile("job", "d"); JobId jobId; try (OutputStream outputStream = new FileOutputStream(tmpWorkflowFile)) { IOUtils.write(jobXml, outputStream, Charset.forName(FILE_ENCODING)); Map<String, String> jobVariables = workflowVariablesTransformer.getWorkflowVariablesFromPathSegment(pathSegment); Map<String, String> genericInfos = null; if (contextInfos != null) genericInfos = getMapWithFirstValues(contextInfos.getQueryParameters()); WorkflowSubmitter workflowSubmitter = new WorkflowSubmitter(s); jobId = workflowSubmitter.submit(tmpWorkflowFile, jobVariables, genericInfos); } return mapper.map(jobId, JobIdData.class); } catch (IOException e) { throw new IOException("Cannot save temporary job file on submission: " + e.getMessage(), e); } finally { FileUtils.deleteQuietly(tmpWorkflowFile); } }
Source:
public boolean isUnix() { return File.pathSeparatorChar == ':'; }

Target:
public boolean isUnix() { return !Functions.isWindows(); }
Source:
public FileLogSource(final File file) { this.file = file; try { this.raf = new RandomAccessFile(file, "r"); this.channel = this.raf.getChannel(); mapBuffer(0); } catch (IOException e) { throw new CantReadFromSourceException(e); } }

Target:
public FileLogSource(final File file) { this.file = file; try { raf = new RandomAccessFile(file, "r"); channel = raf.getChannel(); mapBuffer(0); } catch (IOException e) { throw new CantReadFromSourceException(e); } }
Source:
public void addSecurityFilter(SecurityFilter filter) { if (filter == null) { throw new IllegalArgumentException("Cannot add null filter to chain."); } if (iterator != null) { throw new IllegalStateException("Cannot add filter to current running chain."); } filters.add(0, filter); LOGGER.debug("Added filter to filter chain.", filter.getClass().getName()); }

Target:
public void addSecurityFilter(SecurityFilter filter) { if (filter == null) { throw new IllegalArgumentException("Cannot add null filter to chain."); } if (iterator != null) { throw new IllegalStateException("Cannot add filter to current running chain."); } filters.addFirst(filter); LOGGER.debug("Added filter to filter chain.", filter.getClass().getName()); }
Source:
public RsXembly(final Node dom, final XeSource src) { super( new RsOf( () -> new RsWithType( new RsWithStatus( new RsEmpty(), HttpURLConnection.HTTP_OK ), "text/xml" ).head(), () -> RsXembly.render(dom, src) ) ); }

Target:
public RsXembly(final Node dom, final XeSource src) { super( new ResponseOf( () -> new RsWithType( new RsWithStatus( new RsEmpty(), HttpURLConnection.HTTP_OK ), "text/xml" ).head(), () -> RsXembly.render(dom, src) ) ); }
Source:
public String getURL(){ int selectedPrefix = prefixURLSpinner.getSelectedItemPosition(); String url = profileLocation.getText().toString(); if(url == null || url.length() == 0) return url; if(selectedPrefix < prefixURLSpinner.getCount() - 1) { url = prefixURLSpinner.getSelectedItem() + "/" + url; } if(!url.startsWith("http")){ url = "http://" + url; } return url; }

Target:
public String getURL(){ int selectedPrefix = prefixURLSpinner.getSelectedItemPosition(); String url = profileLocation.getText().toString(); if (url == null || url.length() == 0) { return url; } if(selectedPrefix < prefixURLSpinner.getCount() - 1) { url = prefixURLSpinner.getSelectedItem() + "/" + url; } if(!url.startsWith("http")){ url = "http://" + url; } return url; }
Source:
private AsyncFuture<FetchData.Result> fetchBatch( final FetchQuotaWatcher watcher, final MetricType type, final List<PreparedQuery> prepared, final BigtableConnection c, final Consumer<MetricCollection> metricsConsumer ) { final BigtableDataClient client = c.dataClient(); final List<AsyncFuture<FetchData.Result>> fetches = new ArrayList<>(prepared.size()); for (final PreparedQuery p : prepared) { QueryTrace.NamedWatch fs = QueryTrace.watch(FETCH_SEGMENT); final AsyncFuture<List<FlatRow>> readRows = client.readRows(table, ReadRowsRequest .builder() .rowKey(p.request.getRowKey()) .filter(RowFilter.chain(Arrays.asList(RowFilter .newColumnRangeBuilder(p.request.getColumnFamily()) .startQualifierOpen(p.request.getStartQualifierOpen()) .endQualifierClosed(p.request.getEndQualifierClosed()) .build(), RowFilter.onlyLatestCell()))) .build()); final Function<FlatRow.Cell, Metric> transform = cell -> p.deserialize(cell.getQualifier(), cell.getValue()); fetches.add(readRows.directTransform(result -> { for (final FlatRow row : result) { watcher.readData(row.getCells().size()); final List<Metric> metrics = Lists.transform(row.getCells(), transform); metricsConsumer.accept(MetricCollection.build(type, metrics)); if (metrics.size() > 1) { watcher.reportRowDensity(getDensity(metrics)); } } return FetchData.result(fs.end()); })); } return async .collect(fetches, FetchData.collectResult(FETCH)) .onResolved(ignore -> watcher.accessedRows(prepared.size())); }

Target:
private AsyncFuture<FetchData.Result> fetchBatch( final FetchQuotaWatcher watcher, final MetricType type, final List<PreparedQuery> prepared, final BigtableConnection c, final Consumer<MetricCollection> metricsConsumer ) { final BigtableDataClient client = c.dataClient(); final List<AsyncFuture<FetchData.Result>> fetches = new ArrayList<>(prepared.size()); for (final PreparedQuery p : prepared) { QueryTrace.NamedWatch fs = QueryTrace.watch(FETCH_SEGMENT); final AsyncFuture<List<FlatRow>> readRows = client.readRows(table, ReadRowsRequest .builder() .rowKey(p.request.getRowKey()) .filter(RowFilter.chain(Arrays.asList(RowFilter .newColumnRangeBuilder(p.request.getColumnFamily()) .startQualifierOpen(p.request.getStartQualifierOpen()) .endQualifierClosed(p.request.getEndQualifierClosed()) .build(), RowFilter.onlyLatestCell()))) .build()); final Function<FlatRow.Cell, Metric> transform = cell -> p.deserialize(cell.getQualifier(), cell.getValue()); fetches.add(readRows.directTransform(result -> { for (final FlatRow row : result) { watcher.readData(row.getCells().size()); final List<Metric> metrics = Lists.transform(row.getCells(), transform); metricsConsumer.accept(MetricCollection.build(type, metrics)); } return FetchData.result(fs.end()); })); } return async .collect(fetches, FetchData.collectResult(FETCH)) .onResolved(ignore -> watcher.accessedRows(prepared.size())); }
Source:
public <K2, V2> LinkedHashMultimap<K2, V2> map(BiFunction<? super K, ? super V, Tuple2<K2, V2>> mapper) { return null; }

Target:
public <K2, V2> LinkedHashMultimap<K2, V2> map(BiFunction<? super K, ? super V, Tuple2<K2, V2>> mapper) { return Multimaps.map(this, emptyInstance(), mapper); }